Does Virtual Server 2005 R2 have a command line interface, that's versatile enough?
Here is a situation. I run a Win2k VM on an old memory constrained machine. I allocate it 378MB of RAM and the VM runs just fine. Once a month, inside the VM, I backup the (a very large) database, compress it using 7Zip and ftp it to the backup site (all in a script).
Unfortunately the compression part takes a massive amount of RAM (far exceeding the 378MB), it goes for the paging file and brings absolutely everything to a crawl and literally takes 2-3 days, if left unattended. So to fix this, I have to shutdown the VM, give it temporarily 768MB of RAM and then the whole thing finishes in 20 minutes.
So, is there a way do the following automatically from the host machine in a script?
- Shutdown the guest OS (I think, I got this part)
- Change the RAM allocation from 378 to 768
- Start the guest OS again
then, 1 hour later, do everything in reverse.
Edit: thx to Wesley 'Nonapeptide' for the links. I cobbled up a script and it works like butter. It takes the memory amount as a parameter. Here it is for any folks who might want to do this:
if Wscript.Arguments.Count = 0 then Wscript.Quit end if memory = Wscript.Arguments(0) Set objVS = CreateObject("VirtualServer.Application") Set objVM = objVS.FindVirtualMachine("vbRad.com") Set objGuestOS = objVM.GuestOS Set objTask = objGuestOS.Shutdown() objTask.WaitForCompletion(600000) objVM.Memory = memory Set objTask = objVM.Startup() objTask.WaitForCompletion(600000)