One of the most amazing new features of vSphere is the ability to hot add hardware into a supported guest OS. However, when you need to upgrade your 20 node web farm, all of the right clicks and slider moves can become cumbersome. That is where VMware PowerCLI (PowerShell) comes to the rescue! A few notes:
- This can only be done on vSphere
- This can only be done on supported guest OSs.
- This can only be done after the VMware tools have been updated
- And only with VM Hardware version 7.
- You must enable hot-add in the settings of the VM (this one got me for a bit)
Got that? Now, the basic procedure is not all that different from changing resources of a powered off VM. Before:
The Magic Command! – get-vm -Name "dc01" | Set-VM -MemoryMB 512
Where “dc01” is the VM or list of VMs you want to change and 512 is the new memory config in MB you want.
Here is what it looks like during:
Here is what it looks like after:
And with that, your web farm is happy, and you have again saved the day with PowerShell. As always drop a line in the comments if this was useful, or if you have any questions or comments.