Add support for full VM backups

Adds support for exporting full VM backups, including configuration,
metainfo, and RBD disk images, with incremental support.
This commit is contained in:
2023-10-17 10:15:06 -04:00
parent 6e83300d78
commit b997c6f31e
5 changed files with 323 additions and 1 deletions

View File

@ -470,6 +470,34 @@ def vm_define(
return output, retcode
@ZKConnection(config)
def vm_backup(
zkhandler,
domain,
target_path,
incremental_parent=None,
retain_snapshots=False,
):
"""
Back up a VM to a local (primary coordinator) filesystem path.
"""
retflag, retdata = pvc_vm.backup_vm(
zkhandler,
domain,
target_path,
incremental_parent,
retain_snapshots,
)
if retflag:
retcode = 200
else:
retcode = 400
output = {"message": retdata.replace('"', "'")}
return output, retcode
@ZKConnection(config)
def vm_attach_device(zkhandler, vm, device_spec_xml):
"""