Sunday, March 7, 2010

I like to configure my VMWare Guests to manual startup/shutdown because I use the host for both as a management platform and a developer workstation.

To assist me with managing such environment, i use VI Tookit. Only 1.0 is compatible with VMWare Server 2.0, here. Install it on either x86 or amd64 box. Then, add a few lines of configuration to initialize the PSSnapin into your user’s PowerShell profile location:

Add-PSSnapin Vmware.VimAutomation.core
. "C:\Program Files (x86)\VMware\Infrastructure\VIToolkitForWindows\Scripts\Initialize-VIToolkitEnvironment.ps1"

Fire up PowerShell and you can do the following now

Connect-VIServer -Server "vmware_host" -Port 8333
get-vm sqldev2k8 | shutdown-vmguest