Set appropriate application tag for pools created

Use cases are emerging for the Ceph pool application tags. Let's set
appropriate name for the pools created for CephFS.

Change-Id: Iea36466f5038136727b7a6b62578cb3d0f964a6e
Reference: http://docs.ceph.com/docs/master/rados/operations/pools/#associate-pool-to-application
This commit is contained in:
Frode Nordahl 2019-02-20 07:34:45 +01:00
parent 579c0e4322
commit 34a4dcc0ec
2 changed files with 7 additions and 2 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
*.swp
.testrepository
.tox
__pycache__
.stestr

View File

@ -19,6 +19,7 @@ class CephClient(RelationBase):
scope = scopes.GLOBAL
auto_accessors = ['mds_key', 'fsid', 'auth']
ceph_pool_app_name = 'cephfs'
@hook('{requires:ceph-mds}-relation-{joined}')
def joined(self):
@ -71,10 +72,12 @@ class CephClient(RelationBase):
rq = CephBrokerRq()
rq.add_op_create_pool(name="{}_data".format(name),
replica_count=replicas,
weight=None)
weight=None,
app_name=self.ceph_pool_app_name)
rq.add_op_create_pool(name="{}_metadata".format(name),
replica_count=replicas,
weight=None)
weight=None,
app_name=self.ceph_pool_app_name)
# Create CephFS
rq.ops.append({
'op': 'create-cephfs',