Skip to main content

How to manage VM disks and compute resources

A VM disk is a ZFS volume on a storage pool plus a record of its attachment to the VM: slot, sector size, I/O limits, and an optional label. There are five slots. The slot determines the device order for the guest, so it is either specified explicitly or vStack Center selects the first available one.

Disk operations fall into two groups. Some require the storage controller and therefore are not immediate: creating, expanding, and deleting a volume. Others change only records and limits: they take effect immediately if the VM is stopped and are sent to the node if it is running.

Compute resources are simpler. The vCPU count, RAM size, name, description, and boot media are edited in a single form on the VM card. The vCPU priority and class affect how the node scheduler divides CPU time among VMs. Ballooning changes the amount of memory the guest returns to the hypervisor without a restart.

Changes to vCPU and RAM are saved in the authoritative configuration and sent to the agent, but the guest sees the new values only after a restart. Editing these values does not restart the VM itself.

Disks appear in the Disks section of the VM card: a table with Name, Slot, Disk size (GB), Sector size, IOps limit, and MBps limit columns, and an Add disk button. The name, description, CPU (Cores), and RAM are edited in the form at the top of the card and saved with Save changes.

How to add a disk​

Access: Cluster master can access any VM; an ordinary user can access VMs in their VDCs (virtual data centers).

  1. Determine the size. The range is from 1 GB to 2 TB, and the size must be a multiple of both the logical and physical sector sizes.

  2. In the Disks section of the VM card, click Add disk and fill in the form. If no slot is explicitly specified, vStack Center selects the first available one:

    FieldValue
    Disk sizeFrom 1 GB to 2 TB
    Slot1–5; if omitted, an available slot is selected automatically
    Sector sizeLogical and physical sizes: 512 or 4096 bytes; the defaults are logical 512 and physical 4096; the logical size must not exceed the physical size
    MBps limitThroughput limit
    IOps limitOperations per second limit
    Name (label)Up to 127 characters
  3. Wait for the disk to appear in the Disks table. Its size, slot, sector size, and limits are also shown there.

Failures and workarounds:

FailureReasonWorkaround
-3408 Minimal size of new disk is 1GBThe size is less than 1 GBIncrease the size
-3409 New disk size exceeds 2TBThe size exceeds 2 TBSplit the data across multiple disks
-3410, -3411The size is not a multiple of the logical or physical sector sizeRound the size to a multiple of the sector size
-3412The logical sector is larger than the physical sectorChange the sector parameters
-3430, -3444 no available slotsAll five slots are occupiedFree a slot or use another disk
-3445 Slot N occupied alreadyThe selected slot is occupiedLeave the slot blank so vStack Center selects an available one
-3442, -3443 slot out of rangeThe slot is outside 1–5Specify a slot within the range
-3423 VM v3 should be upgraded firstThe VM configuration version is 3Upgrade the VM configuration version
-3447 vDC storage quota depletedThe disk does not fit within the VDC quotaIncrease the quota or reduce the disk size
-3448 VM is lockedAnother operation is in progressWait for it to finish

How to expand a disk​

A disk can only be expanded. Shrinking is not supported: the new size must be greater than the current size, in increments of 1 MB. Set the new size for the required disk in the Disks section of the VM card.

Typical failures: -7126 means the new size is not greater than the current size, -7127 means the size is not a multiple of 1 MB, -7147 means the VDC storage quota is exhausted, -7124 means the VM has no such disk, and -7128 means the VM is locked by another operation.

Expanding a volume does not expand the filesystem inside the guest. Use the guest OS tools to do that after the disk has been expanded.

How to delete a disk​

Deleting a disk requires the VM to be stopped: error -4424, "vm id==N must be stopped in order to remove disk", means exactly that. Stop the VM and delete the disk in the Disks section of its card.

A disk retained by a snapshot is a special case. vStack Center does not delete the volume; it marks it as retained and does not send the command to the storage controller. Space is freed when the snapshot is deleted. Other failures: -4433 means the VM's pool does not accept data, -4430 means the VM is locked, and -4423 means the VM configuration version does not support the operation.

How to set a disk label and limits​

A label is a user-defined disk name, shown in the Name column of the Disks section. An empty value clears the label. You need a VDC role with role_id ≤ 2 or the VM Developer role (7). A label longer than 127 characters is rejected with error -4047.

I/O limits are set in the MBps limit and IOps limit fields for the required disk. Set at least one of them; otherwise, the operation is rejected with error -7318.

For a stopped VM, the limit takes effect immediately. For a running VM, the command is sent to the node, and partial success is possible: "Ratelimit has been set (DB), but agent didn't apply it". This means the value was saved in the configuration, but the hypervisor did not accept it. The limit takes effect the next time the VM starts. Other failures: -7324 means the VM has no such disk, -7323 means configuration version 3, and -7328 means the VM is locked.

How to change vCPU, RAM, name, and boot media​

All these settings are edited in the form at the top of the VM card: Name, Description, CPU (Cores), RAM (in GB), and the boot media list, where none means no media is attached. Apply changes with Save changes, which becomes available when the form has edits. Access: Cluster master has full access; an ordinary user needs a role with role_id ≤ 2 or VM Developer (7) in the VM's VDC.

FieldLimit
CPU (Cores)From 1 to the maximum set in the cluster
RAMMinimum 512 MB; the maximum is set in the cluster
NameNew VM name
DescriptionDescription; an empty value clears it
Boot mediaA value from the cluster's media list; none means no media

Details to be aware of in advance:

  • Editing the form does not lock the VM. Two consecutive edits do not block each other, but they are not queued either. Do not save the form from two places simultaneously.
  • Error -3233, "ram param value is out of range", means the memory size is outside the allowed range.
  • -3223 means the vCPU count is outside the cluster range, -3244 means the selected boot media does not exist, and -3219 means the VM is locked by another operation.

How to change the memory of a running VM​

Ballooning returns some of the guest's memory to the hypervisor without a restart: you specify a target size, and a zero value clears the limit. It works only for VMs with ballooning enabled in their configuration.

Error -15412 means ballooning is not enabled for the VM. In that case, memory can only be changed through the form on the card and a restart. Error -15015 means the VM is locked by another operation.

How to change vCPU priority and class​

Neither setting locks the VM, and both work in two modes: for a powered-off VM, they update the configuration directly; for a running VM, they send the value to the node.

CPU priority sets the VM's weight for the node scheduler; the allowed range is 1–20. For a powered-off VM, vStack Center explicitly reports that the change was applied directly because the VM is not running.

The vCPU class appears in the vCPU class column of the VM list. Only the Cluster master role can change it: the Set VM vCPU Class (1603) and Set VM Reserved vCPU Class (1606) privileges are assigned only to that role; other roles receive -403. The first privilege allows values from 1 to 5, and the second allows 0. An attempt to go below the allowed minimum is rejected with error -5110.

If the VM stops while the command is being sent, the change is considered applied: vStack Center treats that agent response as success—the vCPU class was changed while the VM was not running.

See also​

API methods​

The API operations for this page are vms-add-disk, vms-disk-resize, vm-remove-disk, vm-disk-set-label, vm-ratelimit-disk, vm-set, vm-boot_media-list, vms-balloon, vms-cpu-priority, and vms-vcpu-class—see the API reference.