From dd3ea3e76055d2d160c20d97ffe82c01290cc271 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Wed, 4 May 2022 17:48:22 -0600 Subject: [PATCH] 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 --- pkg/daemon/ceph/client/pool.go | 3 +++ pkg/operator/ceph/nfs/nfs.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkg/daemon/ceph/client/pool.go b/pkg/daemon/ceph/client/pool.go index fc7e4b9cf..4e7edf198 100644 --- a/pkg/daemon/ceph/client/pool.go +++ b/pkg/daemon/ceph/client/pool.go @@ -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)) diff --git a/pkg/operator/ceph/nfs/nfs.go b/pkg/operator/ceph/nfs/nfs.go index 3b1635e13..04d8ce62b 100644 --- a/pkg/operator/ceph/nfs/nfs.go +++ b/pkg/operator/ceph/nfs/nfs.go @@ -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))