From: Ricardo Dias Date: Mon, 23 Apr 2018 09:43:10 +0000 (+0100) Subject: mgr/dashboard: Add support for RBD snapshot copy X-Git-Tag: v13.1.0~92^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa735d54a211fd0da042a7f896680ed70a776b1f;p=ceph-ci.git mgr/dashboard: Add support for RBD snapshot copy Signed-off-by: Ricardo Dias --- diff --git a/src/pybind/mgr/dashboard/controllers/rbd.py b/src/pybind/mgr/dashboard/controllers/rbd.py index 424706ffa7e..1642b3b6bc7 100644 --- a/src/pybind/mgr/dashboard/controllers/rbd.py +++ b/src/pybind/mgr/dashboard/controllers/rbd.py @@ -329,7 +329,7 @@ class Rbd(RESTController): 'dest_image_name': '{dest_image_name}'}, 2.0) @RESTController.resource(['POST']) def copy(self, pool_name, image_name, dest_pool_name, dest_image_name, - obj_size=None, features=None, stripe_unit=None, + snapshot_name=None, obj_size=None, features=None, stripe_unit=None, stripe_count=None, data_pool=None): def _src_copy(s_ioctx, s_img): @@ -342,6 +342,9 @@ class Rbd(RESTController): # Set features feature_bitmask = _format_features(features) + if snapshot_name: + s_img.set_snap(snapshot_name) + s_img.copy(d_ioctx, dest_image_name, feature_bitmask, l_order, stripe_unit, stripe_count, data_pool)