Virtual machine (VM) disks are placed in the storage specified when creating the VM. If the storage is unavailable or full, the VM will not be created.
If the storage was not specified in the settings, the platform uses special tags to select the storage. Tags are set in VM configurations and settings of the cluster storages. When a VM is created, its disks get the tags set in the configuration. If the tag sets of disk and storage match, the disk will be placed in that storage. If a storage with the right tag set is not found, the VM will not be created.
If neither storage nor tags were specified when creating a VM, the VM will be placed in the default cluster storage. If this storage is not specified, unavailable or full, the VM will not be created.
Using tags
Storage selection algorithm
To select the storage facility, the platform:
- Forms a list of available storages, sorted in descending order of free space.
Example: There are three storages connected to the cluster: SSD1 (25 GB free), SSD2 (10 GB free), SSD3 (400 GB free). A list will be formed:
- SSD3.
- SSD1.
- SSD2.
-
Sequentially, the platform will check storages from the list against the tags. The disk's tag set must be fully included in the storage's tag set. Examples:
- If the storage tags match the disk's tags and there is enough space in the storage, the platform places the disk in the storage.
- If a storage with the right tag set is not found, the platform does not create a VM.
Managing tags
By default, nvme, hdd and ssd tags are created in the platform. These tags cannot be deleted. You can add your own tag when you create a configuration or connect a storage.
You can also manage tags via API requests:
-
to get the list of tags, run the request
GET https://domain.com/vm/v3/tag
-
to create a tag, run the request
POST https://domain.com/vm/v3/tag
with the parameter
{ "name": string, "note": string }
Comments -
to delete a tag, run the request
DELETE https://domain.com/vm/v3/tag/<id>
Comments