Assigning a flavor

Flavors are used to determine the CPU, memory, and storage size of the instance. OpenStack comes with a predefined set of flavors, with different sizes that range from tiny to extra large. For the cirros image, we will use the small flavor, which has 2 GB RAM, 1 vCPU, and 20 GB storage. Access to flavors doesn't have a standalone API client; rather, it's a part of the nova client.

You can see all available built-in flavors at OpenStack GUI | Admin | Flavors:

The script will be as follows:

from keystoneauth1.identity import v3from keystoneauth1 import sessionfrom novaclient import client as nclientfrom pprint import pprint ...

Get Hands-On Enterprise Automation with Python. now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.