8_installvm.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:python 作者: hienha 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号