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

Launching a VM

One of the most important operations that our application might have to perform is launching a new virtual machine on OpenStack. Launching a VM requires the VM name, Glance image name, the network name to connect this VM to, and the keypair to be used. Once these parameters are available, we can easily launch a virtual machine using the create_server() function call. 

The following program creates image, flavor, network, and keypair objects and launches a virtual machine. Note that we are using the create_keypair() function that we wrote in the last section. The wait_for_server() function will ensure that the program waits for the VM to launch and then proceeds:

def create_vm(conn): server_name = "packt-pub-vm" # The name to ...
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