Before working with the Compute service, you’ll need to create a connection
to your OpenStack cloud by following the Connect user guide. This will
provide you with the conn
variable used in the examples below.
Table of Contents
The primary resource of the Compute service is the server.
A server is a virtual machine that provides access to a compute instance being run by your cloud provider.
Full example: compute resource list
An image is the operating system you want to use for your server.
Full example: compute resource list
A flavor is the resource configuration for a server. Each flavor is a unique combination of disk, memory, vCPUs, and network bandwidth.
Full example: compute resource list
A key pair is the public key and private key of public–key cryptography. They are used to encrypt and decrypt login information when connecting to your server.
Full example: compute resource create
At minimum, a server requires a name, an image, a flavor, and a network on creation. You can discover the names and IDs of these attributes by listing them as above and then using the find methods to get the appropriate resources.
Ideally you’ll also create a server using a keypair so you can login to that server with the private key.
Servers take time to boot so we call wait_for_server
to wait
for it to become active.
Full example: compute resource create
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.