LinuxCommandLibrary

openstack-flavor

Manage OpenStack VM flavors

TLDR

List all flavors

$ openstack flavor list
copy

Show details of a flavor
$ openstack flavor show [flavor_id_or_name]
copy

Create a new flavor with 2 vCPUs, 4GB RAM, and 20GB disk
$ openstack flavor create [flavor_name] --vcpus 2 --ram 4096 --disk 20
copy

Delete a flavor
$ openstack flavor delete [flavor_id_or_name]
copy

Create a flavor with 10GB ephemeral disk and 512MB swap space
$ openstack flavor create [flavor_name] --vcpus 4 --ram 8192 --disk 40 --ephemeral 10 --swap 512
copy

SYNOPSIS

openstack flavor <subcommand> [--options] [<arguments>]

Common Subcommands:
list [--all | --public | --private | --long]
show <flavor>
create [--id <uuid>] --ram <MiB> --disk <GiB> --vcpus <count> [--ephemeral <GiB>] [--swap <MiB>] [--rxtx-factor <factor>] [--public | --private] <name>
set [--name <new-name>] [--property <key=value>] <flavor>
unset [--property <key>] <flavor>
delete <flavor> [<flavor> ...]
access add <flavor> <project>
access remove <flavor> <project>

PARAMETERS

<flavor>
    The name or ID of the flavor to operate on.

--ram <MiB>
    Amount of RAM in MiB for a new flavor (required for create).

--disk <GiB>
    Size of the root disk in GiB for a new flavor (required for create).

--vcpus <count>
    Number of virtual CPUs for a new flavor (required for create).

--ephemeral <GiB>
    Size of the ephemeral disk in GiB (optional for create).

--swap <MiB>
    Size of the swap disk in MiB (optional for create).

--rxtx-factor <factor>
    Rate of network I/O in relation to the overall system (optional for create).

--public
    Makes the flavor public (visible to all projects) (for create/set).

--private
    Makes the flavor private (visible only to the creating project) (for create/set).

--id <uuid>
    A unique UUID to assign to the new flavor instead of a generated one (optional for create).

--property <key=value>
    Set an extra specification (key-value pair) on the flavor (for set).

--all
    List all flavors, including private ones not owned by the current project (for list).

--long
    List additional details about flavors, such as extra specs (for list).

DESCRIPTION

The openstack flavor command (part of the python-openstackclient) is a fundamental tool for cloud administrators and users to manage flavors within an OpenStack environment.
Flavors define the computing resources (CPU, RAM, disk) available to virtual machine instances. This command provides a comprehensive interface to list, create, show details of, modify, and delete flavors. It enables the definition of resource limits and capabilities for instances, ensuring consistent resource allocation and billing.
Common operations include creating custom flavors for specific workloads, managing public and private access to flavors, and inspecting existing flavor definitions. Proper flavor management is crucial for efficient resource utilization, cost management, and reliable instance provisioning in any OpenStack cloud.

CAVEATS

The openstack flavor command requires the python-openstackclient to be installed and configured with appropriate access to an OpenStack cloud.
Permissions are critical for creating, modifying, or deleting flavors; insufficient privileges will result in errors.
Flavor core properties (RAM, disk, vCPUs) cannot be modified after creation; only extra specs and visibility can be updated.
Deleting flavors that are currently in use by active virtual machine instances is generally prevented by OpenStack to maintain system stability.

<I>FLAVOR EXTRA SPECS</I>

Extra specs are arbitrary key-value pairs that can be associated with a flavor, allowing for additional capabilities or requirements beyond the basic RAM, disk, and vCPU. These can be used by schedulers or services to enforce specific hardware features, resource policies, or billing tags.
They are managed using the openstack flavor set --property <key=value> and openstack flavor unset --property <key> commands.

<I>PUBLIC VS. PRIVATE FLAVORS</I>

By default, flavors are public and visible to all projects within the OpenStack cloud. Private flavors, on the other hand, are only visible to the project that created them, or to specific projects explicitly granted access via the openstack flavor access add and openstack flavor access remove subcommands.
This distinction allows cloud administrators to offer controlled resource configurations tailored to specific tenants or use cases.

HISTORY

The openstack flavor command is an integral part of the python-openstackclient, a unified command-line interface designed to interact with various OpenStack services. Before its introduction, users typically relied on service-specific CLIs, such as nova-client for flavor management.
The unified client, which began consolidating various service clients around 2014, aimed to simplify OpenStack interactions by providing a consistent and cohesive interface across all services. This consolidation significantly improved the user experience, making flavor management more streamlined and accessible through a single, powerful command-line tool.

SEE ALSO

openstack server(1), openstack image(1), openstack network(1), openstack project(1)

Copied to clipboard