Creating a flavor
When we boot a compute instance, we provide a flavor as a parameter. A flavor defines the resources of a compute instance, such as CPU, memory, and storage. On the Pike release of OpenStack, the default flavors are set as follows:
Flavor | VCPUs | Disk (in GB) | RAM (in MB) |
| 1 | 1 | 512 |
| 1 | 20 | 2048 |
| 2 | 40 | 4096 |
| 4 | 80 | 8192 |
| 8 | 160 | 16384 |
However, in many cases, the default flavors are not suitable for our needs.
How to do it…
OpenStack lets us create our own flavors, as follows:
- name: Create a custom flavor os_nova_flavor: name: custom1 ram: 1024 vcpus: 1 disk: 10 ephemeral: 10 state: present
The os_nova_flavor
module takes a name and parameters for the desired resources to create a custom flavor. Once the flavor is created, we can use the dashboard or os_server
Ansible module to create a compute instance in the usual way, but with the new flavor.