Command line tips and tricks #3

Enter maintenance mode from the ESX command line:

vimsh -n -e /hostsvc/maintenance_mode_enter

Backup every running vm via vcb in just one command:

for /f “tokens=2 delims=:” %%i in (’vcbvmname -h <virtualcenterserver> -u <user> -p <password> -s Powerstate:on ^| find “name:”‘) do cscript pre-command.wsf “c:\program files\vmware\vmware consolidated backup framework\” %%i fullvm

Enable VMotion from the command line:

vimsh -n -e “hostsvc/vmotion/vnic_set vmk0″

2 Responses to “ Command line tips and tricks #3 ”

  1. You might as well mention:

    vimsh -n -e /hostsvc/maintenance_mode_exit

    Caveat to the Enter Maint. Mode, it does not automatically VMotion your VMs as you would through manual Maint. Mode.

  2. [...] For anyone who doesn’t subscribe to Duncan Epping’s great blog, he reminded me of this great command line snippet: [...]

Leave a Reply