From eafc2a477efa85e96cd46ad8f3688302bdefb54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 22 Oct 2019 11:21:18 +0200 Subject: [PATCH] ceph: do not enable app on pool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The command `fs new` already enable the application pool settings for the cephfs pools so we don't need to run that command again. Signed-off-by: Sébastien Han --- pkg/daemon/ceph/client/erasure-code-profile.go | 11 ++++++----- pkg/daemon/ceph/client/pool.go | 17 +++++++++++------ pkg/daemon/ceph/model/pool.go | 1 + pkg/operator/ceph/file/filesystem.go | 4 ++++ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/pkg/daemon/ceph/client/erasure-code-profile.go b/pkg/daemon/ceph/client/erasure-code-profile.go index 223400f03..305b8cdc2 100644 --- a/pkg/daemon/ceph/client/erasure-code-profile.go +++ b/pkg/daemon/ceph/client/erasure-code-profile.go @@ -113,11 +113,12 @@ func DeleteErasureCodeProfile(context *clusterd.Context, clusterName string, era func ModelPoolToCephPool(modelPool model.Pool) CephStoragePoolDetails { pool := CephStoragePoolDetails{ - Name: modelPool.Name, - Number: modelPool.Number, - FailureDomain: modelPool.FailureDomain, - CrushRoot: modelPool.CrushRoot, - DeviceClass: modelPool.DeviceClass, + Name: modelPool.Name, + Number: modelPool.Number, + FailureDomain: modelPool.FailureDomain, + CrushRoot: modelPool.CrushRoot, + DeviceClass: modelPool.DeviceClass, + NotEnableAppPool: modelPool.NotEnableAppPool, } if modelPool.Type == model.Replicated { diff --git a/pkg/daemon/ceph/client/pool.go b/pkg/daemon/ceph/client/pool.go index a2c3b6360..628b53678 100644 --- a/pkg/daemon/ceph/client/pool.go +++ b/pkg/daemon/ceph/client/pool.go @@ -44,6 +44,7 @@ type CephStoragePoolDetails struct { FailureDomain string `json:"failureDomain"` CrushRoot string `json:"crushRoot"` DeviceClass string `json:"deviceClass"` + NotEnableAppPool bool `json:"notEnableAppPool"` } type CephStoragePoolStats struct { @@ -241,9 +242,11 @@ func CreateECPoolForApp(context *clusterd.Context, clusterName string, newPool C } } - err = givePoolAppTag(context, clusterName, newPool.Name, appName) - if err != nil { - return err + if !newPool.NotEnableAppPool { + err = givePoolAppTag(context, clusterName, newPool.Name, appName) + if err != nil { + return err + } } logger.Infof("creating EC pool %s succeeded, buf: %s", newPool.Name, string(buf)) @@ -269,9 +272,11 @@ func CreateReplicatedPoolForApp(context *clusterd.Context, clusterName string, n } // ensure that the newly created pool gets an application tag - err = givePoolAppTag(context, clusterName, newPool.Name, appName) - if err != nil { - return err + if !newPool.NotEnableAppPool { + err = givePoolAppTag(context, clusterName, newPool.Name, appName) + if err != nil { + return err + } } logger.Infof("creating replicated pool %s succeeded, buf: %s", newPool.Name, string(buf)) diff --git a/pkg/daemon/ceph/model/pool.go b/pkg/daemon/ceph/model/pool.go index d37ec1be9..72f0c91f7 100644 --- a/pkg/daemon/ceph/model/pool.go +++ b/pkg/daemon/ceph/model/pool.go @@ -42,4 +42,5 @@ type Pool struct { DeviceClass string `json:"deviceClass"` ReplicatedConfig ReplicatedPoolConfig `json:"replicatedConfig"` ErasureCodedConfig ErasureCodedPoolConfig `json:"erasureCodedConfig"` + NotEnableAppPool bool `json:"notEnableAppPool"` } diff --git a/pkg/operator/ceph/file/filesystem.go b/pkg/operator/ceph/file/filesystem.go index 629a4f5a2..25f9b1bd4 100644 --- a/pkg/operator/ceph/file/filesystem.go +++ b/pkg/operator/ceph/file/filesystem.go @@ -152,6 +152,10 @@ func newFS(name string, metadataPool *model.Pool, dataPools []*model.Pool, activ pool.Name = fmt.Sprintf("%s-%s%d", name, dataPoolSuffix, i) } + // For the filesystem pool we don't want to enable the application pool + // since it's being done via 'fs new' already + metadataPool.NotEnableAppPool = true + return &Filesystem{ Name: name, metadataPool: metadataPool,