首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python libcloud在vAPP中创建VM

python libcloud在vAPP中创建VM
EN

Stack Overflow用户
提问于 2014-08-03 19:37:35
回答 1查看 291关注 0票数 1

我可以使用libcloud在云中创建一个节点( vAPP ),但是API没有提到在现有vAPP中创建VM的方法。有人试过这个吗?

http://libcloud.readthedocs.org/en/latest/compute/drivers/vcloud.html

代码语言:javascript
复制
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver

import libcloud.security  

def testConnection():
    #libcloud.security.VERIFY_SSL_CERT = True
    vcloud = get_driver(Provider.VCLOUD)
    driver = vcloud("user@org", "xxxxx", host='portal.local', api_version='5.1')   

    nodes = driver.list_nodes()    
    for i in nodes:
        print i      
    images = driver.list_images()    
    image = [i for i in images if i.name == "New Base VM vApp"][0]
    print image   

    locations = driver.list_locations()
    print locations

    vdcs = driver.vdcs
    vdc = [i for i in vdcs if "VDC_NAME" in i.name ][0]    
    for i in vdcs:
        if "VDC_NAME" in i.name:
            print "VDC\n"
            print i
            dev_test_vdc = i.name
            print i    
    print "creating node"
    node = driver.create_node(name="test_vAPP", image=image,  ex_vdc=dev_test_vdc, ex_clone_timeout=500)

def main():
    testConnection()

if __name__ == "__main__":
    main()
EN

回答 1

Stack Overflow用户

发布于 2014-10-07 01:23:13

作为libcloud中vCloud驱动程序的贡献者,恐怕没有对此的支持。vApps是否以1:1的方式映射到虚拟机。您可以在github上阅读方法create_node的实现

但是,您可以contribute这类功能。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25104261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档