def restore_from_file(self, path): """ Override BaseVM restore_from_file method """ state = virsh.domstate(self.name) if state not in ("shut off",): raise virt_vm.VMStatusError("Can not restore VM that is %s" % state) logging.debug("Restoring VM from %s" % path) virsh.restore(path, uri=self.connect_uri) state = virsh.domstate(self.name) if state not in ("paused", "running"): raise virt_vm.VMStatusError("VM not paused after restore, it is %s." % state)
def restore_from_file(self, path): """ Override BaseVM restore_from_file method """ state = virsh.domstate(self.name) if state not in ('shut off',): raise virt_vm.VMStatusError("Can not restore VM that is %s" % state) logging.debug("Restoring VM from %s" % path) virsh.restore(path, uri=self.connect_uri) state = virsh.domstate(self.name) if state not in ('paused','running'): raise virt_vm.VMStatusError("VM not paused after restore, it is %s." % state)
def restore_from_file(self, path): """ Override BaseVM restore_from_file method """ virsh.restore(self.name, path, uri=self.connect_uri)