【问题标题】:python libcloud create VM inside vAPPpython libcloud在vAPP中创建VM
【发布时间】:2014-08-03 11:37:34
【问题描述】:

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

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

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()

【问题讨论】:

    标签: python linux vcloud-director-rest-api libcloud


    【解决方案1】:

    作为 libcloud 中 vCloud 驱动程序的贡献者,恐怕没有对此的支持。 vApp 以 1:1 的方式映射到 VM。你可以在github阅读方法create_node的实现@

    但是你可以contribute 这样的功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-16
      • 1970-01-01
      • 1970-01-01
      • 2020-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多