I prefer to use apache-libcloud instead of openstack python API to access openstack instance.

How can I get the flavor's vcpu information using libcloud ?

#nc= get_openstack()
flavors = nc.list_sizes()
for flavor in flavors:
    print flavor.id, flavor.name, flavor.ram, flavor.disk, flavor.bandwidth
    # print flavor.vcpus # this is not supported.

It is supported in Openstack API.

有帮助吗?

解决方案

This information is now supported in libcloud API (ver - 0.13) driver for openstack. You can call flavor.vcpus to get the vCPU information.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top