Virtual Machine Memory and CPU Hot-Plug Configurations

  • 20 January 2022
  • 0 replies
  • 2341 views

Userlevel 2
Badge +4
  • Nutanix Employee
  • 69 replies

Memory and CPUs are hot-pluggable on guest VMs running on AHV. You can increase the memory allocation and the number of CPUs on your VMs while the VMs are powered on. You can change the number of vCPUs (sockets) while the VMs are powered on. However, you cannot change the number of cores per socket while the VMs are powered on.

You can change the memory and CPU configuration of your VMs by using the Acropolis CLI (aCLI), Prism Element (see Managing a VM (AHV) in the Prism Web Console Guide), or Prism Central (see Managing a VM (AHV and Self Service) in the Prism Central Guide).

Memory OS Limitations

  1. On Linux operating systems, the Linux kernel might not make the hot-plugged memory online. If the memory is not online, you cannot use the new memory. Perform the following procedure to make the memory online.

    • Identify the memory block that is offline.
      Display the status of all of the memory.
      $ cat /sys/devices/system/memory/memoryXXX/state 

Display the state of a specific memory block.
$ grep line /sys/devices/system/memory/*/state 

  • Make the memory online.
    $ echo online > /sys/devices/system/memory/memoryXXX/state 

If your VM has CentoOS 7.2 as the guest OS and less than 3 GB memory, hot plugging more memory to that VM so that the final memory is greater than 3 GB, results in a memory-overflow condition. To resolve the issue, restart the guest OS (CentOS 7.2) with the following setting:
swiotlb=force 

 

CPU OS Limitation

On CentOS operating systems, if the hot-plugged CPUs are not displayed in /proc/cpuinfo, you might have to bring the CPUs online. For each hot-plugged CPU, run the following command to bring the CPU online.

$ echo 1 > /sys/devices/system/cpu/cpu<n>/online  

 

Hot-Plugging the Memory and CPUs on Virtual Machines (AHV)

Perform the following procedure to hot plug the memory and CPUs on the AHV VMs.

Procedure

  1. Log on the Controller VM with SSH.

Update the memory allocation for the VM.
nutanix@cvm$ acli vm.update vm-name memory=new_memory_size 

  1. Replace vm-name with the name of the VM and new_memory_size with the memory size.

Update the number of CPUs on the VM.
nutanix@cvm$ acli vm.update vm-name num_vcpus=n 

  1. Replace vm-name with the name of the VM and n with the number of CPUs.

 


This topic has been closed for comments