def create_vm(conn, xml_path):
"""Define a new domain in Libvirt, creating new Virtual Machine
:param conn: Libvirt connection
:type conn: object
:param xml_path: full path for XML with VM definition
:type xml_path: str
:return True
:rtype Boolean
"""
LOG.debug("VM creation, defining new domain in libvirt")
try:
conn.defineXMLFlags(xml_path)
LOG.debug("VM creation, complete")
return True
except (SystemExit, libvirtError) as ex:
LOG.error(ex)
raise SystemExit(1)
评论列表
文章目录