Allow passing zk_only into VM snapshot creation

This commit is contained in:
Joshua Boniface 2024-08-20 12:57:53 -04:00
parent 3fb52a13c2
commit f42a1bad0e
1 changed files with 4 additions and 2 deletions

View File

@ -1235,7 +1235,7 @@ def get_list(
# #
# VM Snapshot Tasks # VM Snapshot Tasks
# #
def create_vm_snapshot(zkhandler, domain, snapshot_name=None): def create_vm_snapshot(zkhandler, domain, snapshot_name=None, zk_only=False):
# Validate that VM exists in cluster # Validate that VM exists in cluster
dom_uuid = getDomainUUID(zkhandler, domain) dom_uuid = getDomainUUID(zkhandler, domain)
if not dom_uuid: if not dom_uuid:
@ -1277,7 +1277,9 @@ def create_vm_snapshot(zkhandler, domain, snapshot_name=None):
# Iterrate through and create a snapshot for each RBD volume # Iterrate through and create a snapshot for each RBD volume
for rbd in rbd_list: for rbd in rbd_list:
pool, volume = rbd.split("/") pool, volume = rbd.split("/")
ret, msg = ceph.add_snapshot(zkhandler, pool, volume, snapshot_name) ret, msg = ceph.add_snapshot(
zkhandler, pool, volume, snapshot_name, zk_only=zk_only
)
if not ret: if not ret:
cleanup_failure() cleanup_failure()
return False, msg return False, msg