Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 def restore_from_file(self, path):
     """
     Override BaseVM restore_from_file method
     """
     virsh.restore(self.name, path, uri=self.connect_uri)
Ejemplo n.º 4
0
 def restore_from_file(self, path):
     """
     Override BaseVM restore_from_file method
     """
     virsh.restore(self.name, path, uri=self.connect_uri)