More ESXi 4.1 Tech Mode commands
- May 14th, 2011
- Write comment
Today, I found myself in the awkward position of having to figure out how to bring my newly upgraded ( ESXi 4.1 to 4.1 Update 1 ) host out of Maintenance Mode using Tech Mode commands, because I did not realize that I had to upgrade the vSphere client. It was even worse, because I thought I could download the new client from the ESXi server itself (http://esxi-hostnam). Instead, the ESXi host just provides a link to the VMware site. Ooopps. My LAN DNS servers are running on the same physical host, due to lack of funding. So, this little adventure forced me to discover a few more commands to manage an ESXi host from the Tech mode command line.
First off is a command that will tell you more information than you possibly ever want to know about your ESXi host. This command will spew out hundreds of lines of information about the host.
vim-cmd hostsvc/hostsummary
I highly recommend using grep to find the information you need. For instance, I used the following command to determine whether the host was in Maintenance Mode:
vim-cmd hostsvc/hostsummary | grep -i main
inMaintenanceMode = false,
To put the host into Maintenance Mode:
vim-cmd hostsvc/maintenance_mode_enter
To take the host out of Maintenance Mode:
vim-cmd hostsvc/maintenance_mode_exit
I have written about this command before, but it seems appropriate to list it here. To display all guests:
vim-cmd vmsvc/getallvms
You can also use the following command to get a “summary” of a guest:
# vim-cmd vmsvc/get.summary 160
Again, I recommend using grep, because you get a lot of output.
# vim-cmd vmsvc/get.summary 160 | grep -i name
guestFullName =
hostName =
name = “White2”,
vmPathName = “[1TBVolume] White2/White2.vmx”,
guestFullName = “Microsoft Windows Vista (32-bit)”,
Or:
# vim-cmd vmsvc/get.summary 272 | grep -i state
runtimeState = (vim.vm.DeviceRuntimeInfo.VirtualEthernetCardRuntimeState) {
connectionState = “connected”,
powerState = “poweredOff”,
faultToleranceState = “notConfigured”,
recordReplayState = “inactive”,
getallvms will display the Vmids of all the guests. You will need these to power on your guests from Tech Mode. The following command will display whether a guest is power on or not:
# vim-cmd vmsvc/power.getstate 160
Retrieved runtime info
Powered off
Finally, to power on a guest using the Vmid from getallvms command:
# vim-cmd vmsvc/power.on 272
Powering on VM:
Furthermore, here is how you can add a new configuration from Tech Mode:
vim-cmd solo/registervm pathtovmxconfigurationfile
To remove a configuration:
vim-cmd vmsvc/unregister Vmid
To check the version:
vmware -v