Creating flavors
You can create custom flavors with different sets of vCPU and RAM resources:
- Public flavors are visible to all projects in the cluster. Any user from any project can use these flavors to create virtual machines.
-
Private flavors are visible only to projects that are explicitly granted access. Only users from those projects can use these flavors to create VMs. Private flavors are useful when you need to:
- Ensure only certain projects can access specific VM configurations
- Create tailored configurations not suited for general use
- Implement internal cost controls or usage restrictions
Limitations
- Self-service users can view and select flavors only if they are public or explicitly shared.
To create a flavor
Admin panel
- On the Compute > Virtual machines > Flavors tab, click Create flavor.
-
In the Create flavor window, specify a flavor name, a number of virtual CPU cores, an amount of RAM.
-
In the GPUs field, click Add, select a GPU alias, and specify the number of GPUs to attach to the flavor.
-
In the Access section, configure the flavor access:
- To make the flavor public, select Public.
- To share the flavor with all projects in a domain, select Private, click Add in the Projects field, select the required domain. Then, click Apply.
- To share the flavor with specific projects in a domain, select Private, click Add in the Projects field, click the required domain, and select projects. Then, click Apply.
- To make the flavor private with no access, select Private.
- Click Create.
Command-line interface
Use the following command:
vinfra service compute flavor create [--swap <size-mb>] --vcpus <vcpus> --ram <size-mb> [--property <key=value>]
[--gpu <alias:count>] [--public] <flavor-name>
<flavor-name>- Flavor name
--swap <size-mb>- Swap space size, in megabytes
--vcpus <vcpus>- Number of virtual CPUs
--ram <size-mb>- Memory size, in megabytes
--property <key=value>- Property to set on the flavor in
key=valueformat. Can be specified multiple times. --gpu <alias:count>- GPU configuration in
alias:countformat (e.g.,L40S:2). Can be specified multiple times. The system will automatically determine the GPU type (vGPU or host passthrough) and set the appropriate flavor properties. --public- Make the flavor public (clears
access_list)
Example 1. To create the public flavor myflavor with 1 vCPU and 4 GB of RAM, run:
# vinfra service compute flavor create myflavor --vcpus 1 --ram 4096 --public
The new flavor will appear in the vinfra service compute flavor list output:
# vinfra service compute flavor list +--------------------------------------+----------+-------+------+-------+-----+-----------+ | id | name | ram | swap | vcpus | gpu | is_public | +--------------------------------------+----------+-------+------+-------+-----+-----------+ | 100 | tiny | 512 | 0 | 1 | 0 | True | | 101 | small | 2048 | 0 | 1 | 0 | True | | 102 | medium | 4096 | 0 | 2 | 0 | True | | 103 | large | 8192 | 0 | 4 | 0 | True | | 104 | xlarge | 16384 | 0 | 8 | 0 | True | | d60d75f0-853e-4009-bf75-bf42e0105b96 | myflavor | 4096 | 0 | 1 | 0 | True | +--------------------------------------+----------+-------+------+-------+-----+-----------+
Example 2. To create the GPU-based flavor gpu-nvidia-319-2 with 16 CPU, 64 GB of RAM, and 2 GPUs with the alias nvidia-319 and share it with the project myproject in the domain mydomain, run:
# vinfra service compute flavor create gpu-nvidia-319-2 --vcpus 16 --ram 65536 --gpu nvidia-319:2 \
--access-list '[{"domain_id": "mydomain", "projects": ["myproject"]}]'
+-------------+-----------------------------------------------+
| Field | Value |
+-------------+-----------------------------------------------+
| access_list | - domain_id: b90248ec48d74b9ab87bb26b95388918 |
| gpu | 2 |
| id | e6c59a72-c297-439b-afa5-058e97b263f6 |
| is_public | False |
| name | gpu-nvidia-319-2 |
| placements | [] |
| properties | resources:VGPU: '2' |
| | trait:CUSTOM_NVIDIA_319: required |
| ram | 65536 |
| swap | 0 |
| vcpus | 16 |
+-------------+-----------------------------------------------+