14.18. Managing Resources for Guest Virtual Machines
virsh allows the grouping and allocation of resources on a per guest virtual machine basis. This is managed by the libvirt daemon, which creates cgroups and manages them on behalf of the guest virtual machine. The only thing that is left for the system administrator to do is to either query or set tunables against specified guest virtual machines. The following tunables may used:
memory- The memory controller allows for setting limits on RAM and swap usage and querying cumulative usage of all processes in the group
cpuset- The CPU set controller binds processes within a group to a set of CPUs and controls migration between CPUs.
cpuacct- The CPU accounting controller provides information about CPU usage for a group of processes.
cpu-The CPU scheduler controller controls the prioritization of processes in the group. This is similar to granting
devices- The devices controller grants access control lists on character and block devices.
freezer- The freezer controller pauses and resumes execution of processes in the group. This is similar to
SIGSTOPfor the whole group.
net_cls- The network class controller manages network utilization by associating processes with a
In creating a group hierarchy cgroup will leave mount point and directory setup entirely to the administrators’ discretion and is more complex than just adding some mount points to
/etc/fstab. It is necessary to setup the directory hierarchy and decide how processes get placed within it. This can be done with the following virsh commands:
schedinfo- described in Section 14.19, “Setting Schedule Parameters”
blkiotune- described in Section 14.20, “Display or Set Block I/O Parameters”
domiftune- described in Section 14.5.9, “Setting Network Interface Bandwidth Parameters”
memtune- described in Section 14.21, “Configuring Memory Tuning”