pool: built-in pools require flag to force creation

Ceph added a check recently that prevents creation of the
built-in pools that start with a dot, such as .nfs, .mgr,
and .rgw.root. These pools require a --yes-i-really-mean-it
flag to be passed to force the creation now.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
Travis Nielsen committed 2022-05-25 17:26:15 -06:00
1 parent 75af3ae547
commit dd3ea3e760
2 files changed
+6

No files matched your search

+3
View File
@@ -447,6 +447,9 @@ func createReplicatedPoolForApp(context *clusterd.Context, clusterInfo *ClusterI
// Create the pool since it doesn't exist yet
// If there was some error other than ENOENT (not exists), go ahead and ensure the pool is created anyway
args := []string{"osd", "pool", "create", pool.Name, pgCount, "replicated", crushRuleName, "--size", strconv.FormatUint(uint64(pool.Replicated.Size), 10)}
if strings.HasPrefix(pool.Name, ".") && clusterInfo.CephVersion.IsAtLeastReef() {
args = append(args, "--yes-i-really-mean-it")
}
output, err := NewCephCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to create replicated pool %s. %s", pool.Name, string(output))
+3
View File
@@ -304,6 +304,9 @@ func (r *ReconcileCephNFS) configureNFSPool(n *cephv1.CephNFS) error {
logger.Infof("configuring pool %q for nfs", poolName)
args := []string{"osd", "pool", "create", poolName}
if r.clusterInfo.CephVersion.IsAtLeastReef() {
args = append(args, "--yes-i-really-mean-it")
}
output, err := cephclient.NewCephCommand(r.context, r.clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to create default NFS pool %q. %s", poolName, string(output))