Search

5.4. Virtual Memory

download PDF

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.

Note

If you might need to later hot unplug the memory that you are now hot plugging, see Hot Unplugging Virtual Memory.

Procedure

  1. Click Compute Virtual 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 disables devices while a virtual machine is running.

Prerequisites

  • Only memory added with hot plugging can be hot unplugged.
  • The virtual machine’s operating system must support memory hot unplugging.
  • The virtual machine 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.
  • To ensure that hot plugged memory can be hot unplugged later, add the movable_node option to the kernel command line of the virtual machine as follows and reboot the virtual machine:

    # grubby --update-kernel=ALL --args="movable_node"

For more information, see Setting kernel command-line parameters in the RHEL 8 document Managing, monitoring and updating the kernel.

Procedure

  1. Click Compute Virtual 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.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.