Add clone volume command to CLI

This commit is contained in:
Joshua Boniface 2019-10-10 14:11:13 -04:00
parent f6b40911f8
commit 6c9b49d7cd
1 changed files with 21 additions and 0 deletions

View File

@ -1550,6 +1550,27 @@ def ceph_volume_rename(pool, name, new_name):
retcode, retmsg = pvc_ceph.rename_volume(zk_conn, pool, name, new_name)
cleanup(retcode, retmsg, zk_conn)
###############################################################################
# pvc storage ceph volume clone
###############################################################################
@click.command(name='rename', short_help='Clone RBD volume.')
@click.argument(
'pool'
)
@click.argument(
'name'
)
@click.argument(
'new_name'
)
def ceph_volume_clone(pool, name, new_name):
"""
Clone a Ceph RBD volume with name NAME in pool POOL to name NEW_NAME in pool POOL.
"""
zk_conn = pvc_common.startZKConnection(zk_host)
retcode, retmsg = pvc_ceph.clone_volume(zk_conn, pool, name, new_name)
cleanup(retcode, retmsg, zk_conn)
###############################################################################
# pvc storage ceph volume list
###############################################################################