Create a flavor
To create cloud servers via the OpenStack CLI and Terraform, flavorings are used to define the number of vCPUs, RAM, and local disk size (optional) of the server. Through the OpenStack API, you can create a GPU flavor. Flavors correspond to arbitrary configurations, consider the available values of arbitrary linec configurations when creating a flavor.
OpenStack CLI
Terraform
OpenStack API
Flavor will only be available for a single project and pool for which you have configured authorization in the OpenStack API.
-
Create a flavor:
openstack flavor create \
--private \
--vcpus <vcpu> \
--ram <ram_size> \
--disk <disk_size> \
<flavor_name>Specify:
<vcpu>- number of vCPUs;<ram_size>- RAM size in MB;- optional:
<disk_size>- local disk size in GB. To create a flavor with a network disk, the value must be zero; <flavor_name>- flavor name. Must be unique and not match the names of previously deleted flavors. You can view the list of existing flavor names using theopenstack flavor list.
Example of creating a flavor with 1 vCPU, 1 GB RAM, local disk size of 5 GB:
openstack flavor create --private --vcpus 1 --ram 1024 --disk 5 new_flavor
Use the Create Flavor instructions in the Terraform documentation.
You can only create a GPU flavor through the OpenStack API.
-
In the query output, copy the value of
X-Subject-Token. -
Open the CLI on the local computer.
-
Create a request to create a flavor:
curl 'https://<pool>.cloud.api.selcloud.ru/compute/v2.1/flavors' \
-H 'X-Auth-Token: <x_auth_token>' \
-H 'Content-Type: application/json' \
--data-raw '{"flavor":{"name":"<flavor_name>","os-flavor-access:is_public":false,"vcpus":<vcpu_amount>,"ram":<ram_size>,"disk":<disk_size>,"gpu":"<gpu_type>:<gpu_amount>"}}'Specify:
<pool>- pool in which the flavor will be created, e.g.ru-7. Address (URL) depends on the region and pool, you can see in the URL list;<x_auth_token>- The IAM token you copied in step 2;<flavor_name>- flavor name. Must be unique and not match the names of previously deleted flavors;<vcpu_amount>- vCPU count;<ram_size>- RAM size in MB;- optional:
<disk_size>- local disk size in GB. Only NVIDIA® A100 40Gb, NVIDIA® A100 80Gb, or NVIDIA® A30 in the ru-7a and ru-7b pool segment can be used for flavoring with a local disk. To create a network disk flavor, the value must be zero; <gpu_type>- GPU name, e.g.T4,A100(without the wordsNVIDIA®,Tesla). The list can be seen in the table Available GPUs;<gpu_amount>- GPU count.
Sample request to create a flavor with 2 vCPUs, 2 GB RAM, bootable network disk, and NVIDIA® Tesla T4 GPU in the ru-7a pool segment:
curl 'https://ru-7.cloud.api.selcloud.ru/compute/v2.1/flavors' \
-H 'X-Auth-Token: AbCD813261b...' \
-H 'Content-Type: application/json' \
--data-raw '{"flavor":{"name":"flavor-name","os-flavor-access:is_public":false,"vcpus":2,"ram":2048,"disk":0,"gpu":"T4:1"}}'