From fa735d54a211fd0da042a7f896680ed70a776b1f Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Mon, 23 Apr 2018 10:43:10 +0100 Subject: [PATCH] mgr/dashboard: Add support for RBD snapshot copy Signed-off-by: Ricardo Dias --- src/pybind/mgr/dashboard/controllers/rbd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5