Rexxer

Some tips for me and other

VmWare ESXi CLI useful commands

Show services on the host and their default state upon boot (on/off)

cat /etc/chkconfig.db

Restart all services on the host

/sbin/services.sh restart

Show config file of vCenter vpxa agent

cat /etc/vmware/vpxa/vpxa.cfg

Enter maintenance mode

vim-cmd hostsvc/maintenance_mode_enter

Virtual machine operations

vim-vmd solo/registervm <path to VM’s .vmx file> – register VM on a host vim-cmd vmsvc/getallvms – list all VMs registered on the host

* in the following commands replace <vmid> with virtual machine ID obtained by running the previous command

vim-cmd vmsvc/power.getstate <vmid> – show power state of a VM vim-cmd vmsvc/power.shutdown  <vmid>  – shutdown a VM (shutdown guest) vim-cmd vmsvc/power.reset  <vmid>  – reset a VM vim-cmd vmsvc/power.off <vmid>  – power off a VM vim-cmd vmsvc/power.on <vmid> – power on a VM vim-cmd vmsvc/power.reboot <vmid> – reboot a VM vim-cmd vmsvc/get.summary  <vmid>  – get summary information for a VM vim-cmd vmsvc/unregister  <vmid>  – unregister a VM from a host

Leave a Reply