4.4. Using Online Memory Management for Virtual Machines

Online memory management is a new feature of Virtuozzo 7, based on memory hotplugging and ballooning, that allows increasing or reducing VM memory on the fly, without rebooting the VM. OOM enables the following scenarios:

  • Pay-As-You-Grow (PAYG), customers can scale VM vertically according to workload;
  • Changing billing plans without reboot.

The feature can only be enabled for stopped virtual machines with at least 1GB of RAM. To enable online memory management, run:

# prlctl stop myvm
# prlctl set myvm --mem-hotplug on
# prlctl start myvm

To check that the feature works:

  1. Wait until VM is fully booted and the balloon driver is loaded, then run:

    # virsh dominfo myvm

    Used Memory should be 1GB while Max Memory should be 5GB. The balloon size should be about 7GB now.

  2. Now increase memory size to 1.5GB:

    # prlctl set myvm --memsize 1536
  3. Check the VM memory:

    # virsh dominfo myvm

    Used Memory should be 1.5GB.

  4. Reduce the amount of VM memory to 1GB:

    # prlctl set myvm --memsize 1024
  5. Check the VM memory again:

    # virsh dominfo myvm