Implement configurable replcfg (client-side)
Implements administrator-selectable replication configurations for new pools in PVC clusters, overriding the default of copies=3,mincopies=2.
This commit is contained in:
@ -870,12 +870,12 @@ def ceph_pool_list(limit=None):
|
||||
pvc_common.stopZKConnection(zk_conn)
|
||||
return flask.jsonify(retdata), retcode
|
||||
|
||||
def ceph_pool_add(name, pgs):
|
||||
def ceph_pool_add(name, pgs, replcfg):
|
||||
"""
|
||||
Add a Ceph RBD pool to the PVC Ceph storage cluster.
|
||||
"""
|
||||
zk_conn = pvc_common.startZKConnection(config['coordinators'])
|
||||
retflag, retdata = pvc_ceph.add_pool(zk_conn, name, pgs)
|
||||
retflag, retdata = pvc_ceph.add_pool(zk_conn, name, pgs, replcfg)
|
||||
if retflag:
|
||||
retcode = 200
|
||||
else:
|
||||
|
@ -755,6 +755,13 @@ def api_ceph_pool_root():
|
||||
# We default to a very small number; DOCUMENT THIS
|
||||
pgs = 128
|
||||
|
||||
# Get replication configuration
|
||||
if 'replcfg' in flask.request.values:
|
||||
replcfg = flask.request.values['replcfg']
|
||||
else:
|
||||
# We default to copies=3,mincopies=2
|
||||
replcfg = 'copies=3,mincopies=2'
|
||||
|
||||
return pvcapi.ceph_pool_add(pool, pgs)
|
||||
|
||||
@api.route('/api/v1/storage/ceph/pool/<pool>', methods=['GET', 'DELETE'])
|
||||
|
Reference in New Issue
Block a user