The Random Ramblings

lost? dazed? confused? dont come here then as this aint goona help!!

Restart VM Guests from the CLI

Not having run Windows for a very long time now, the lack of a client for anything other than windows obviously causes some difficulty.

Mostly this has been resolved by amazon instances and a custom AMI. This costs money every time it switched on and, generally because I'm normally getting dragged in a million different directions, I forget to switch it off. These need to be very big machines as its windows and therefore chunks of money down the drain.

Knowing that there was a command line set of tools that I have used in the past I had suspected that this would be the best way forward for me but trying to get clear info out of the documentation was painful.

A lot of google foo and I managed to find a post by a gentleman called Robert Chase and vmware command line tools that made life so easy. I don't want to take the full content as I believe if your interested in this his blog is well worth a read but just in case the site disappears for what ever reason here are the commands he mentions!!

vim-cmd vmsvc/getallvms Lists all vm's running on hypervisor and provides vmid

vim-cmd vmsvc/ vmid Powers off vmid referenced from getallvms command

vim-cmd vmsvc/power.on vmid Powers off vmid referenced from getallvms command

vim-cmd vmsvc/power.reboot vmid Reboots vmid referenced from getallvms command

vim-cmd vmsvc/destroy vmid Deletes the vmdk and vmx files from disk

vim-cmd hostsvc/maintenance_mode_enter Puts hypervisor into maintenance mode

vim-cmd hostsvc/maintenance_mode_exit Takes hypervisor out of maintenance mode

vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx Registers vm in hypervisor inventory

vim-cmd vmsvc/unregister vmid Unregisters vm with hypervisor

vim-cmd vmsvc/tools.install vmid Starts vmware tools installation for VM

vim-cmd hostsvc/net/info Provides information about hypervisor networking

chkconfig -l Shows daemons running on hypervisor. Can also be used for configuration.

esxtop Same as linux top for vmware

vmkerrcode -l List of vmkernel errors

esxcfg-info Lists a LOT of information about the esx host

esxcfg-nics -l Lists information about NIC's. Can also be used for configuration.

esxcfg-vswitch -l Lists information about virtual switching. Can also be used for configuration.

dcui Provides console screen to ssh session

vsish Vmware interactive shell

decodeSel /var/log/ipmi_sel.raw Read System Event Log of server

Saving my bacon on many occasions now.....

Find Me
Javascript learning