ceph: do not enable app on pool

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 <seb@redhat.com>
This commit is contained in:
Sébastien Han committed 2019-10-22 15:14:28 +02:00
1 parent eccea9fa05
commit eafc2a477e
4 files changed
+22 -11

No files matched your search

@@ -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 {
+11 -6
View File
@@ -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))
+1
View File
@@ -42,4 +42,5 @@ type Pool struct {
DeviceClass string `json:"deviceClass"`
ReplicatedConfig ReplicatedPoolConfig `json:"replicatedConfig"`
ErasureCodedConfig ErasureCodedPoolConfig `json:"erasureCodedConfig"`
NotEnableAppPool bool `json:"notEnableAppPool"`
}
+4
View File
@@ -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,