Developing OpenStack image service applicationsÂ
As discussed in Chapter 3, Exploring OpenStack Private Cloud, the OpenStack imaging service called Glance stores all the VM images in various formats such as qcow2
, raw
, and so on. We saw how we could use the OpenStack dashboard to upload, download, and launch a VM image from the Glance database. Lets now see how we can perform the same operations using the Python SDK.
Listing images
We must first create the connection object as explained in the previous section. The VM images stored in the Glance database can be listed simply by iterating over the list by referring to the sub-class compute
 of the connection object and invoking the images()
function.
This function returns a list of all the VM images present in the Glance database in your project:
# Import the OpenStack connection class from the SDK from openstack import connection # Create a connection object by calling the constructor and pass the security information conn = connection.Connection...