Python Nova Client
One of my requirement was to use python nova client API to fetch the IP Address of the VM. Here are some of the ways to achieve it.
Go through the following URL. This is the documentation on how to use the API.
https://pypi.python.org/pypi/python-novaclient/
This code will show the VMs launched by admin user only.
A Sample Code is shown below.
One of my requirement was to use python nova client API to fetch the IP Address of the VM. Here are some of the ways to achieve it.
Go through the following URL. This is the documentation on how to use the API.
https://pypi.python.org/pypi/python-novaclient/
This code will show the VMs launched by admin user only.
A Sample Code is shown below.
The Details such as VERSION,USER,PASSWORD,TENANT,AUTH_URL can be found from admin-openrc.sh
List of Servers shall be iterated as follows
for i in nt.server.list()
print i
addresses attribute will show the list of IP Addresses being allotted. The following code will show the VMs launched by all the Users.
Reference:
https://pypi.python.org/pypi/python-novaclient/
https://github.com/larsks/openstack-api-samples/blob/master/nova_example.py
Attributes of the server instance are listed below.
No comments:
Post a Comment