Add RAM to VMware VM with scheduled task?

I need to add RAM to a web server on a production environment.

The server is a Windows 2008 server VM running on ESXi 5 that does not support hot plugging of memory.

I want to add RAM to it and it has to be done outside working hours. I am wondering if it's possible to schedule a task to add the RAM to the VM and then turn on the machine.

I know I have the choice of doing it manually myself but I'm wondering if it's possible to automate it via a scheduled task.


Yep PowerCLI should do this.

A combination of Shutdown-VMGuest, Get-VM | Set-VM and GET-VM | start-vm should allow you to do this if you save as a ps1 file you should be able to use task scheduler to run the script out of hours.


Despite the fact that this can be scheduled or automated, I would still insist on doing the VM hardware modification work manually. It's clearly not something that needs to be replicated large-scale, and the amount of time it takes is minimal. I don't understand why you wouldn't do this live.


your script would look like

#Shutdown
get-vm -name XXX | shutdown-VMguest

#wait 30 sec
start-sleep -s 30

#it should be off
get-vm -name XXX | set-vm -memoryGB 999

#Start it
get-vm -name XXX | start-VM