summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/volumes/module.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/pybind/mgr/volumes/module.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/pybind/mgr/volumes/module.py b/src/pybind/mgr/volumes/module.py
index b9c8e7893..8a50baaad 100644
--- a/src/pybind/mgr/volumes/module.py
+++ b/src/pybind/mgr/volumes/module.py
@@ -483,8 +483,13 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
Option(
'snapshot_clone_delay',
type='int',
- default=0,
- desc='Delay clone begin operation by snapshot_clone_delay seconds')
+ default=0,
+ desc='Delay clone begin operation by snapshot_clone_delay seconds'),
+ Option(
+ 'snapshot_clone_no_wait',
+ type='bool',
+ default=True,
+ desc='Reject subvolume clone request when cloner threads are busy')
]
def __init__(self, *args, **kwargs):
@@ -492,6 +497,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
# for mypy
self.max_concurrent_clones = None
self.snapshot_clone_delay = None
+ self.snapshot_clone_no_wait = None
self.lock = threading.Lock()
super(Module, self).__init__(*args, **kwargs)
# Initialize config option members
@@ -522,6 +528,8 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
self.vc.cloner.reconfigure_max_concurrent_clones(self.max_concurrent_clones)
elif opt['name'] == "snapshot_clone_delay":
self.vc.cloner.reconfigure_snapshot_clone_delay(self.snapshot_clone_delay)
+ elif opt['name'] == "snapshot_clone_no_wait":
+ self.vc.cloner.reconfigure_reject_clones(self.snapshot_clone_no_wait)
def handle_command(self, inbuf, cmd):
handler_name = "_cmd_" + cmd['prefix'].replace(" ", "_")
@@ -845,3 +853,19 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
def _cmd_fs_clone_cancel(self, inbuf, cmd):
return self.vc.clone_cancel(
vol_name=cmd['vol_name'], clone_name=cmd['clone_name'], group_name=cmd.get('group_name', None))
+
+ # remote method
+ def subvolume_getpath(self, vol_name, subvol, group_name):
+ return self.vc.subvolume_getpath(vol_name=vol_name,
+ sub_name=subvol,
+ group_name=group_name)
+
+ # remote method
+ def subvolume_ls(self, vol_name, group_name):
+ return self.vc.list_subvolumes(vol_name=vol_name, group_name=group_name)
+
+ # remote method
+ def subvolume_info(self, vol_name, subvol, group_name):
+ return self.vc.subvolume_info(vol_name=vol_name,
+ sub_name=subvol,
+ group_name=group_name)