Virtualization made simple for Everyone.
Enable CPU Hot Add

Hi All, today I am going to explain how we can leverage the Hot add CPU and Memory feature on a Virtual Machine. This can be a very handy feature if we are running a production environment that cannot allow downtime.

Today I am going to cover the following topics.

What is Hot Plug CPU

What is Hot Plug Memory

Perquisite to enable

How to enable the settings

What is Hot Plug CPU

Hot Plug CPU is a technique that can dynamically increase the cpu cores for a VM that supports HOT add CPU. This is however depended on the guest OS which you are running. I have found on Linux based CentOS /Red Hat any version above 6.5 supports this feature.

How can we forget Microsoft Windows Server? Dont worry any OS from 2012 above are fully supported. ( 2012 R2/ 2016 and 2019 )

What is Hot Plug Memory

Dynamically increasing the memory of a running VM is hotplug memory. this is fully supported from Linux servers Red Hat / Centos based from 6.5 and above and Windows server above 2012.

Perquisite to Enable Hot Add

  1. The virtual machine has a guest operating system that supports Memory hot-add functionality.
  2. The virtual machine is using hardware version 7 or later.
  3. VMware Tools is installed.
  4. Power off the Virtual Machine to enable hot-add.Can be scripted with

PowerCLI, can be used to enable this on a lot of VM’s to make our life easy. However, we need to power off for the settings to take effect.

A swift Google search will point you some good scripts disclaimer Please test it on a test VM before running on development or production servers.

Note the hot add feature required a full power off and on operation on VM, not a reboot. ( reboot will not work)

httpss://code.vmware.com/forums/2530/vsphere-powercli#573518

httpss://

Function Enable-vCpuAndMemHotAdd($vm){
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$extra1 = New-Object VMware.Vim.optionvalue
$extra1.Key=”mem.hotadd”
$extra1.Value=”true”
$vmConfigSpec.extraconfig += $extra1
$extra2 = New-Object VMware.Vim.optionvalue
$extra2.Key=”vcpu.hotadd”
$extra2.Value=”true”
$vmConfigSpec.extraconfig += $extra2
$vm.Extensiondata.ReconfigVM($vmConfigSpec)
}
Get-Content “c:\listofvms.txt” | %{
$vm = Get-VM -Name $_
Enable-vCpuAndMemHotAdd $vm
}

You can also find a really neet script which I like a lot on this website: virtuallythatguy.co.uk/how-to-set-vm-hot-plug-for-memory-and-cpu-vcpu-and-vmem-hot-plug-using-powercli/

Vmware Settings Expand the CPU

CPU Hot Plug

Edit Settings for the VM, expand the CPU on the CPU Hot Plug check Enable CPU Hot Add.

Hot Plug Memory

Edit Settings for the VM, expand the Memory on the Memory Hot Plug check Enable.

The limitation with Memory increase

Always remember that if the memory is under 3 GB Memory can not be increased above 4 without power off and increase to 4 GB or higher.

by:

Leave a Reply

Your email address will not be published. Required fields are marked *