Creating custom flavors for virtual machines
In the compute cluster, a configuration template for virtual machines is called a flavor. Flavors simplify VM deployment. They allow you to set the number of virtual CPU cores and the amount of RAM a virtual machine will use. By default, five predefined flavors are created with the following parameters:
Name | vCPUs | Memory |
---|---|---|
tiny | 1 | 512 MiB |
small | 1 | 2 GiB |
medium | 2 | 4 GiB |
large | 4 | 8 GiB |
xlarge | 8 | 16 GiB |
You can create custom flavors with different sets of vCPU and RAM resources, or delete existing flavors, including the predefined ones.
To create a custom flavor
Admin panel
Command-line interface
Use the following command:
vinfra service compute flavor create [--swap <size-mb>] --vcpus <vcpus> --ram <size-mb> <flavor-name>
--swap <size-mb>
- Swap space size, in megabytes
--vcpus <vcpus>
- Number of virtual CPUs
--ram <size-mb>
- Memory size, in megabytes
<flavor-name>
- Flavor name
For example, to create a flavor called myflavor
with 1 vCPU and 3 GB of RAM, run:
# vinfra service compute flavor create myflavor --vcpus 1 --ram 3072
The new flavor will appear in the vinfra service compute flavor list
output:
# vinfra service compute flavor list +--------------------------------------+----------+-------+------+-------+ | id | name | ram | swap | vcpus | +--------------------------------------+----------+-------+------+-------+ | 100 | tiny | 512 | 0 | 1 | | 101 | small | 2048 | 0 | 1 | | 102 | medium | 4096 | 0 | 2 | | 103 | large | 8192 | 0 | 4 | | 104 | xlarge | 16384 | 0 | 8 | | 2e32ebd2-5d83-45fd-a526-3ae4a6658078 | myflavor | 3072 | 0 | 1 | +--------------------------------------+----------+-------+------+-------+
To delete a flavor
Admin panel
- On the Compute > Virtual machines > Flavors tab, select the flavor you want to delete, and then click Delete.
-
Click Delete in the confirmation window.
Command-line interface
Use the following command:
vinfra service compute flavor delete <flavor>
<flavor>
- Flavor ID or name
For example, to delete the flavor myflavor
, run:
# vinfra service compute flavor delete myflavor