def start_vm(self, vm):
"""Start virtual machine instance on Libvirt
:param vm: virtual machine
:type vm: object
"""
if self.is_running(vm):
LOG.debug("VM %s is running" % vm.name())
return True
try:
vm.create()
LOG.debug("Importing VM %s" % vm)
# the raise exception is to force the vm state be checked again
raise Exception
except libvirt.libvirtError as ex:
raise ex
评论列表
文章目录