def main():
dic = {}
vconn = libvirt.open('qemu:///system')
try:
name = sys.argv[1]
except IndexError, e:
print e
sys.exit()
dic.update(getUUID())
# dic.update(getIP())
dic.update({'http_host': '192.168.10.213'})
dic.update(getMAC())
dic.update(getPort())
dic.update(getName(name))
xml = XML % dic
if createVM(vconn, name, xml):
print 'created vmachine name is: %s, and port is %s' % (dic['name'], dic['port'])
time.sleep(15)
runVM(vconn, xml, name)
评论列表
文章目录