what is the proper way to shutdown a esx server? I moved all vms to another host already
One way is to login to the console an type shutdown now
Before shutting down it's best to switch the ESX host to Maintenance mode (has added benefit of automatically moving all VM's off the host)
vimsh -n -e /hostsvc/maintenance_mode_enter
bounce the ESX host
then bring it out of Maintenance mode with
vimsh -n -e /hostsvc/maintenance_mode_exit
with this method you don't have to start moving VM's back again as it will automate.
if you have VC then you can shut it down via there,
if you are directly connected to the VM Host via the VIC you can right click the node name and select shutdown or reboot if desired.
Alternatively you can at the console you can issue the following commands
shutdown -h now (this will shutdown the host machine)
shutdown -r now (this will reboot the host machine)
if you are ssh'd in you SU to root and issue the commands as shown above.
If you found this or any other post helpful please consider the use of the Helpfull/Correct buttons to award points
Kind Regards
Tom,
I entered this command from the console
vimsh -n -e /hostsvc/maintenance_mode_enter
what do i do next? In VC, I still see this host online and not in maintenance mode
ok after I entered this command
vimsh -n -e /hostsvc/maintenance_mode_enter
I went to the console and did a reboot
I see the vms migrated over to the other esx host.
is there a way for it to do a online migration instead of rebooting the vm?
It usually takes few minutes after switching a server to maintenance mode before it starts vMotion on it's VM's. Either you're not waiting long enough, or more likely you're having a VC not updating issue which quite a few people get.
Only other reason could be you have some how disabled vMotioning off of a host in M-mode.
If it's the updating issue, you may also find some VM's have frozen (or blank) status 'traffic lights'. If you do then at the console of the host do
service mgmt-vmware restart
then
service vmware-vpxa restart
Give this a few minutes to catch up. If still no status, also restart the VC service on VC server. None of this should affect the running of your VM's on the host (unless you're running 3.0.1 and have VM's set to auto power off/power on). If this step brings back you 'traffic lights' then try switching to maintenance mode again (via comand line or in VC).
telinit runlevel
It is much easier on ESX 3.x to just use 'poweroff' it calls init level -6 the same way shutdown does.
@ Tom
Thanks, the worked. I have a bad server disconnected from the network. I was able to bring it up, but I am not used to managing the hosts outside of the vCenter GUI. Thanks again.