Complete VM restore functionality

This commit is contained in:
2023-10-23 22:23:17 -04:00
parent d3b3fdfc80
commit 8d256a1737
5 changed files with 329 additions and 74 deletions

View File

@ -498,6 +498,32 @@ def vm_backup(
return output, retcode
@ZKConnection(config)
def vm_restore(
zkhandler,
domain,
target_path,
datestring,
):
"""
Restore a VM from a local (primary coordinator) filesystem path.
"""
retflag, retdata = pvc_vm.restore_vm(
zkhandler,
domain,
target_path,
datestring,
)
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):
"""