Is there a way to connect to the vCenter via SSH and put the ESXi host server into maintenance mode using a command?
ysiguchi,
Are you required to do it from vCenter? You could just install vSphere CLI - VMware {code} somewhere, but I don't think vCenter would be my first choice.
Lars
Hi,
Place a Host in Maintenance Mode
vicfg-hostops --server=server_name --operation enter
vicfg-hostops --server=server_name --operation info
Enter Maintenance mode:
vicfg-hostops --server server_name --username user_name --password pass_word --operation enter
Exit Maintenance mode:
vicfg-hostops --server server_name --username user_name --password pass_word --operation exit
-----------------------------------
https://www.vladan.fr/esxi-maintenance-mode/
ESXi Maintenance Mode Via CLI How-to And Some More Commands
To enter maintenance mode using the command line interface, use this command:
*********************************************************************
esxcli system maintenanceMode set –enable true
To exit maintenance mode use this command:
esxcli system maintenanceMode set –enable false
Alternatively, there is another command to enter and to exit maintenance mode:
To enter maintenance mode:
vim-cmd /hostsvc/maintenance_mode_enter
To exit maintenance mode:
vimsh -n -e /hostsvc/maintenance_mode_exit
AlessandroRomeo68,
vicfg-hostops and vim-cmd are not available on vCenter 6.7, but should work fine on earlier releases.
Lars
...another solution to the answer above (It is much better)
https://www.vmwareblog.org/closed-maintenance-things-know-maintenance-mode/
ARomeo