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.

  • We haven't had a chance to start playing with center operations / orchestration yet... But I suspect the feature may exist there? Feb 26 '14 at 12:47
  • I would have thought this could be achieved with PowerCLI to shutdown the VM, edit the settings and then power on the VM Feb 26 '14 at 12:49
  • @TimAlexander you are correct. It only took 10 more minutes of googling around to find the answer: ict-freak.nl/2010/05/07/…
    – er_tomas
    Feb 26 '14 at 12:56

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.

  • 4 years later, and I find myself having to do the same thing as the OP :) My advice here is probably bad, but this should either be a native VMware feature or easier to script. The time it takes for me to set up the scripting infrastructure is quite a bit longer than just doing everything manually.
    – ewwhite
    Mar 10 '18 at 11:18

your script would look like

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
  • 1
    Thanks for the input. I'm sure the OP would appreciate some additional guidance on how to make this run unattended. Aug 8 '14 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.