It happens often to have to do maintenance on Virtual Machines bacause of an exhaustion of computing resources. A web server with many more visitors than those predicted when it was sized, a database server with newly added application, there are many examples.
In thse situations, a sysadmin schedules the activity on the virtual machine in non working hours(usually nights or weekends), stops the VM, changes settings by adding more cpu or ram, and restarts the VM. Even if this task takes only few minutes, it would be possible to avoid it completely by choosing a compatible guest OS and pre-emptively configure the VM to support HotAdd and HotPlug, that is the ability to add (note carefully, ONLY add) RAM or CPU to a running VM without the need to stop it.
Which VMware licenses you need?
These features have been introduced first in 4.0, and is supported only if the virtual machine uses at least virtual hardware 7 and has VMware Tools installed. Even if these two requirements are satisfied, not all vSphere editions has those features, but you will need at least Advanced (vSphere 4.0 e 4.1) or Enterprise (vSphere 5.0).
Which Guest OSes are supported?
Once you have one of the correct vSphere license, you will have to check if the desired Gust OS is among those supported; not all the generally supported OS support hotadding CPU or RAM. I’ve found no official list from VMware about the supported OS, best way of checking is to take a look in the appropriate section in the VM settings (note that CPU Hot Plug has an even smaller support list):
(In my example, a VM with Windows 2003 Enterprise 64 bit supports Memory HotAdd but not CPU HotPlug). Jason Boche has tested several Windows OSes in regards to Hot Add, and wrote a blog post that you can read here.
Enabling HotAdd / HotPlug
Has you can already imagine looking at the previous screenshot, that is the section where you can change HotAdd/HotPlug behaviour, while the VM is powered off.
Adding CPU or RAM
Once the features are enabled, you will be able to add CPU or RAM while the VM is running. To do this you will go in the hardware section of the VM settings, where you will find a modified view of the usual settings:
Increasing the RAM of this VM, you will see the sudden change in the Performance Monitor inside vCenter:
while inside the guest VM you will see the change in RAM size while the uptime counter is going on without any pause or reset:
Why you should use it?
During the initial configuration is easy to enable these features since the VM in not in production yet, it requires only a few more clicks. When the VM is then in production having these features enabled can be a further step in the uptime of the VM, since you can increase RAM or CPU in a suffering VM without the need to stop it.
The best solution is to enable these features directly in a template, in order to have newly created VMs already enabled even if you forget to manually enable HotAdd/HotPlug on every VM.
Final Note: there are some issues regarding some linux kernel/distribution, and also in some Windows version. Check VMware KB.
2 thoughts on “Pre-emptively enable HotAdd/HotPlug of a VM”
One point you’ve missed is that enabling hot add (either CPU or RAM) does have a performance impact which is why VMware don’t enable this feature by default. All the details can be found at Duncan’s blog;
Hi Ed, thanks for clarification, really appreciated.
Comments are closed.