Skip to Content
Hybrid Cloud for Developers
book

Hybrid Cloud for Developers

by Manoj Hirway
April 2018
Intermediate to advanced content levelIntermediate to advanced
280 pages
8h 37m
English
Packt Publishing
Content preview from Hybrid Cloud for Developers

Uploading an image

In Chapter 2, Exploring AWS Cloud, we discussed different formats of image files such as raw, qcow2, and so on. The Glance image database stores these images, which can be used to launch VMs.

We can upload different formats of image files to the Glance image store. The following code uploads a qcow2 image for an Ubuntu operating system. We use the create_image() function and pass the image file path to it. The wait parameter makes the function wait for the image to be uploaded completely before returning back to the calling program:

def upload_image(conn):    print("Upload Image:")    # Load fake image data for the example.    data = 'This is fake image data.'    # Build the image attributes and upload the image.    image_attrs = { 'name': ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hybrid Cloud for Architects

Hybrid Cloud for Architects

Alok Shrivastwa
OpenStack: Building a Cloud Environment

OpenStack: Building a Cloud Environment

Alok Shrivastwa, Sunil Sarat, Kevin Jackson, Cody Bunch, Egle Sigler, Tony Campbell

Publisher Resources

ISBN: 9781788830874Supplemental Content