Skip to content

Flavors CLI reference

See https://docs.openstack.org/nova/2023.2/cli/index.html.

These commands allow you to create, list, show, delete, and manage properties and access for flavors. The <flavor_id_or_name> and <project_id> in the commands are placeholders that should be replaced with the actual IDs or names of the flavors and projects. Here is a list of some common commands for working with flavors.

List flavors

Bash
openstack flavor list

Show flavor details

Bash
openstack flavor show <flavor_id_or_name>

Create a flavor

Bash
openstack flavor create --id <flavor_id> --ram <ram_in_mb> --disk <disk_in_gb> --vcpus <num_vcpus> <flavor_name>
  • <flavor_id>: Unique ID for the flavor (optional; if not provided, OpenStack will generate one).
  • <ram_in_mb>: Amount of RAM in megabytes.
  • <disk_in_gb>: Size of the root disk in gigabytes.
  • <num_vcpus>: Number of virtual CPUs.
  • <flavor_name>: Name of the flavor.

Delete a flavor

Bash
openstack flavor delete <flavor_id_or_name>

Set flavor properties

Bash
openstack flavor set --property <key>=<value> <flavor_id_or_name>
- Set custom properties for a flavor, such as hw:cpu_policy=dedicated for CPU pinning.

Unset flavor properties

Bash
openstack flavor unset --property <key> <flavor_id_or_name>
- Remove custom properties from a flavor.

List flavor access

Bash
openstack flavor access list --flavor <flavor_id_or_name>
- List the projects that have access to a private flavor.

Add flavor access

Bash
openstack flavor access add --flavor <flavor_id_or_name> --project <project_id>
- Grant access to a private flavor to a specific project.

Remove flavor access

Bash
openstack flavor access remove --flavor <flavor_id_or_name> --project <project_id>
- Revoke access to a private flavor from a specific project.