vCLI: Managing Hosts
As I want to get deeper into VMware CLI (vCLI) I decided to make a summary of the vSphere Command-Line Interface Installation and Scripting Guide. Every chapter will be a separate blog post.
This summary is meant for my documentation but feel free to make use of it.
In this blog post: Managing Hosts
reboot, shutdown a host
shutdown hosts in maintenance mode
vicfg-hostops [connect options] –operation shutdown
shutdown hosts not in maintenance mode
vicfg-hostops [connect options] –operation shutdown –force
shutdown hosts in cluser or datacenter
vicfg-hostops [connect options] –operation shutdown –cluster [clustername]
vicfg-hostops [connect options] –operation shutdown –datacenter [datacentername]
Reboot hosts
Change the operation shutdown into reboot
Maintenance Mode
Entering Maintenance Mode
vicfg-hostops –operation enter (–cluser or –datacenter)
Check Maintenance Mode
Entering Maintenance Mode
vicfg-hostops –operation check
Exiting Maintenance Mode
vicfg-hostops –operation exit
Backup Configuration (host has to be in maintenanc mode)
Backup configuration information
vicfg-cfgbackup [connection options] -s /tmp/esxi-backup.txt
Restore configuration information
vicfg-cfgbackup [connection options] -l /tmp/esxi-backup.txt
Restore factory settings
vicfg-cfgbackup [connection options] -r
Host updates
which bulletins are installed
vihostupdate [connection options] –query
Which bulletins are available in the bundle
vihostupdate [connection options] –list –bundle https://webserver/bundle.zip
Which bulletions in the bundle are applicable to your host
vihostupdate [connection options] –scan –bundle https://webserver/bundle.zip
Install all or some bulletins from the bundle on your host
vihostupdate [connection options] –install –bundle https://webserver/bundle.zip,https://webserver2/budle2.zip
Make use of a metadata file
vihostupdate [connection options] –list –metadata https://webserver/metadata.zip
Install all bulletions using a metadata file
vihostupdate [connection options] –install –metadata https://webserver/metadata.zip
Install some bulletins using a metadata file
vihostupdate [connection options] –list –metadata https://webserver/metadata.zip –bulletin bulletin1,bulletin2
Removing a bulletin from a host (not vmware patches or updates)
vihostupdate [connection options] –remove –bulletin bulletin1
Active Directory Configuartion
- Make sure time is synchronized between ESXi host and AD Server
- ESX host is pingable from AD Server by DNS name
- AD server is pinable form ESX host by DNS name
vicfg-authconfig –server=[ESX server ip adress]
–username=[ESX server admin name]
–password=
–authschema AD –hoindomain [ad domain name]
–adusername=[AD admnistration name]
–adpassword=
Check authentication
vicfg-authconfig –list
About Michael
Michael Wilmsen is a experienced VMware Architect with more than 20 years in the IT industry. Main focus is VMware vSphere, Horizon View and Hyper Converged with a deep interest into performance and architecture.
Michael is VCDX 210 certified, has been rewarded with the vExpert title from 2011, Nutanix Tech Champion and a Nutanix Platform Professional.