5.4. Virtual Memory

5.4.1. Hot Plugging Virtual Memory

You can hot plug virtual memory. Hot plugging means enabling or disabling devices while a virtual machine is running. Each time memory is hot plugged, it appears as a new memory device in the Vm Devices tab in the details view of the virtual machine, up to a maximum of 16 available slots. When the virtual machine is restarted, these devices are cleared from the Vm Devices tab without reducing the virtual machine’s memory, allowing you to hot plug more memory devices. If the hot plug fails (for example, if there are no more available slots), the memory increase will be applied when the virtual machine is restarted.

Important

This feature is currently not supported for the self-hosted engine Manager virtual machine.

Hot Plugging Virtual Memory

  1. Click ComputeVirtual Machines and select a running virtual machine.
  2. Click Edit.
  3. Click the System tab.
  4. Increase the Memory Size by entering the total amount required. Memory can be added in multiples of 256 MB. By default, the maximum memory allowed for the virtual machine is set to 4x the memory size specified. Though the value is changed in the user interface, the maximum value is not hot plugged, and you will see the pending changes icon ( pendingchanges ). To avoid that, you can change the maximum memory back to the original value.
  5. Click OK.

    This action opens the Pending Virtual Machine changes window, as some values such as maxMemorySizeMb and minAllocatedMem will not change until the virtual machine is restarted. However, the hot plug action is triggered by the change to the Memory Size value, which can be applied immediately.

  6. Click OK.

The virtual machine’s Defined Memory is updated in the General tab in the details view. You can see the newly added memory device in the Vm Devices tab in the details view.

5.4.2. Hot Unplugging Virtual Memory

You can hot unplug virtual memory. Hot unplugging means disabling devices while a virtual machine is running.

Important
  • Only memory added with hot plugging can be hot unplugged.
  • The virtual machine operating system must support memory hot unplugging.
  • The virtual machines must not have a memory balloon device enabled. This feature is disabled by default.
  • All blocks of the hot-plugged memory must be set to online_movable in the virtual machine’s device management rules. In virtual machines running up-to-date versions of Red Hat Enterprise Linux or CoreOS, this rule is set by default. For information on device management rules, consult the documentation for the virtual machine’s operating system.

If any of these conditions are not met, the memory hot unplug action may fail or cause unexpected behavior.

Hot Unplugging Virtual Memory

  1. Click ComputeVirtual Machines and select a running virtual machine.
  2. Click the Vm Devices tab.
  3. In the Hot Unplug column, click Hot Unplug beside the memory device to be removed.
  4. Click OK in the Memory Hot Unplug window.

The Physical Memory Guaranteed value for the virtual machine is decremented automatically if necessary.