Managing IO Classes

Introduction To IO Classes

KVM and OpenVZ virtual systems can have an IO class set that controls their relative priority when accessing the disk on the host system. The class is a number that ranges from 0 to 7, and VMs with a lower class number have a *higher* priority when accessing local disk. IO priority also effects contention with other processes on the host system in the same way, such as webservers or databases.

Setting The IO Class For A System
The class for an existing system can be changed on the **Resources Limits** page, under the **Resources** category on the left menu. The **Disk IO class** field is a simple drop-down menu, for selecting a class ranging from 0 (best priority) to 7 (worst). When the **Save** button is clicked, the IO class will be immediately changed.

The IO class can also be set when creating a KVM or OpenVZ virtual system, in the **Resource limit options** section. The default class for new systems can be set at **Cloudmin Settings** -> **Cloudmin Configuration** -> **KVM settings** (or the section for OpenVZ).

IO Classes And System Owners
By default, only the master administrator (`root`) in Cloudmin can manage the IO classes of virtual systems. However, this can be adjusted on a per-owner or per-plan basis. On the **Edit System Owner** or **Edit Account Plan** page, you can check the **Change IO class** box in the **Allowed actions for system owners** section to grant access to this feature.

Be careful allowing system owners to modify the IO class though, as Cloudmin doesn't prevent an owner from granting all his systems the highest priority, which may come at the expense of other VMs on processes on the host system.

Setting The IO Class Via The API
The API command `modify-limits` can also be used to set the IO class for a virtual system, using the `--ioclass` parameter. For example, from the shell you could run :

# cloudmin modify-limits --host kvmioclass.home --ioclass 7
Setting IO class on KVM system kvmioclass.home to 7 ..
.. done

The same parameter can be used when calling the API remotely.