Andy Fox | 21 September 2012
Yes, I know, this feature has been around since vSphere 4, but having checked, I could not believe that I had not written a blog about it, so here it is!
Ordinarily, it is not possible to either add memory or cpus to a powered on virtual machine. However, there is a hardware capability in a number of modern server class systems that enables the addition of physical ram and cpus whilst the server is powered on.
In order to facilitate this, the installed OS (Operating System) must be able to detect the hardware change, and make the additional resources available.
Starting with Windows Server 2003 Service Pack 1, Enterprise Edition and Datacenter Edition supports hot-add on both x64-based and Intel Itanium-based 64-bit platforms.
Windows Server 2003, Enterprise Edition and Datacenter Edition support hot-add memory on x86-based ACPI platforms only.
Linux guests using kernel version 2.6.19 or higher should also support hot-add.
In a virtual environment, the physical hardware does not necessarily need to support hot add, as long as the guest OS does, so we can take advantage of this feature to increase memory/cpu within the virtual machine without the need to restart it, saving valuable time.
The option to enable hot-add must be configured within the vm when it is powered off, it cannot be enabled while the vm is on:
The original memory as displayed in Windows:
After being enabled, when the vm is powered on, the memory/cpu can be increased:
Windows showing the increased memory:
As you can see Windows (or any other OS that supports hot-add) will instantly update to indicate the increased resources available.
Several blogs have previously identified this feature, with a lot indicating a potential limitation in the effectiveness of this feature. The issue surrounds an applications' ability to effectively support this feature as well as the OS. If the application upon start up, identifies the amount of resource (at the time) that is available, if it does not have the ability to recheck at regular intervals, the application would never know that resources have been increased, and therefore would never be able to take advantage of the increased resources.
Whilst I totally agree with this observation, I would suggest that it would be much quicker restarting the application/service to ensure that it re-evaluates the amount of resources available than restarting the OS to add additional resources in the first place.
Therefore I would always suggest that hot-add is enabled in all virtual machines.