QEMU VM Memory Hot Add
QEMU is a cross-platform computing emulator that is quick and open source. It can emulate a variety of hardware architectures and usually works together with libvirt to provide user VMs with emulated hardware operating environment, offering easy management and scheduling of large-scale VMs.
VM memory hotplug is a virtualization technology that dynamically expands the memory capacity of a running VM based on QEMU. However, on the current AArch64 architecture platform, the native QEMU 6.2.0 faces a technical limitation: It cannot start VMs whose initial memory in the NUMA configuration is configured 0, and cannot provide the memory hotplug function to such VMs. This limitation narrows the QEMU application scenarios.
The Kunpeng BoostKit QEMU VM memory hotplug feature is based on QEMU's existing memory hotplug logic and extends functions through patches. The feature is open-sourced and released on Gitee. This feature makes the VM's XML configuration file contain a NUMA node with 0 initial memory and dynamically adds memory to the NUMA node using memory hotplug commands. This improvement greatly widens the QEMU application scenarios.
Application Scenarios
In large-scale VMs and centralized management scenarios, especially on cloud computing platforms, NUMA nodes that are temporarily allocated with 0 memory are often reserved in VMs in advance, aiming to efficiently manage large-scale VMs. This method ensures that memory resources can be quickly increased and allocated when more memory is required, facilitating dynamic memory expansion.
Constraints
- OS
- VM specification
Among the NUMA nodes configured for a VM, a maximum of one NUMA node whose initial memory is 0 is supported.
- Hotplug specification
The VM XML configuration file must contain the maxMemory node as required by QEMU. This node specifies the number of memory slots (setting the slots attributes) dedicated for VM's memory hotplug and the maximum total memory that can be achieved through hotplug (setting the value of maxMemory).
In addition to the constraints in the VM XML configuration file, some configuration parameters in physical machines also put constraints on the maximum number of hotplug operations on the corresponding VMs and the maximum memory capacity provided by memory hotplug. The specific constraints depend on the OS type.