5

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.

er_tomas
  • 103
  • 4
  • 9
  • We haven't had a chance to start playing with center operations / orchestration yet... But I suspect the feature may exist there? – Daniel Widrick 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: http://ict-freak.nl/2010/05/07/powercli-script-to-schedule-memory-and-or-vcpu-updowngrade/ – er_tomas Feb 26 '14 at 12:56

3 Answers3

11

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.

  • Here's an example: http://ict-freak.nl/2010/05/07/powercli-script-to-schedule-memory-and-or-vcpu-updowngrade/ – er_tomas Feb 26 '14 at 13:00
5

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.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • 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
1

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