Thursday, January 19, 2012

Collection of ESXi commands to manage VMs

1. esxcli vms vm list ( esxcli vm process list) - lists VM and the world id, you can kill, send NMI mask using vm-support command.(esxcli vm process kill ,
2. vm-support -V, vm-support -x ,vm-support -X - captures screenshot,etc.,
vmdumper
vmdumper: [options]

3.vim-cmd /vmsvc/getallvms
4.vim-cmd /vmsvc/unregister
5. vim-cmd /solo/register /path/to/file.vmx
6. vim-cmd /vmsvc/power.getstate
7.vim-cmd /vmsvc/power.off
8.vim-cmd /vmsvc/power.on
9. vim-cmd vmsvc/device.getdevices $id|egrep -i "vmdk|compat"
10. vim-cmd vmsvc/get.config
11. vim-cmd vmsvc/get.datastores 35
12.vim-cmd vmsvc/device.diskaddexisting
13. vim-cmd hostsvc/datastore/summary datastore2
14. vim-cmd hostsvc/refresh_services
15. vim-cmd vmsvc/message
16. vim-cmd vmsvc/tools.install

To find the ip addresses allocated

for vm in `vim-cmd vmsvc/getallvms | awk '{print $1}'|grep -v -i vmid`; do vim-cmd vmsvc/get.summary $vm |grep -i ipAdd;done

I used to find a duplicate ip....

1 comment: