There are times when you need to perform hardware maintenance (such as adding a new Network Interface Card [NIC]) on VMware hosts, or the host simply disconnects from vCenter. The only way to perform maintenance is to shutdown or reboot the hosts. To minimize damage, here’s the procedure I use:
- Run vSphere client on the workstation. Do not use the vSphere client on the servers. The reason being – a server might be a virtual machine (VM) which will go down.
- Using vSphere client, connect to VMware host, *not* the vCenter server.
- Login as user root.
- Shutdown all the VM’s, by right clicking the VM, selecting Power, Shutdown Guest. This is faster than logging in to each machine using RDP and shutting it down. The vmtools though have to be up to date, or else the Shutdown Guest option will be grayed out. If Shutdown Guest is grayed out, you need to login to the VM to shut it down. Performing “Power Off” on the VM should be the last resort.
- Once all the VM’s are powered down, right click on the VMware host and select Enter Maintenance Mode.
- Go to the console of the VMware host, and press Alt-F11 to get the login prompt.
- Login as root.
- Issue the command “shutdown -h now” to power down the host. If you just want to reboot, issue the command “shutdown -r now”.
- Wait until the machine is powered off.
- Perform maintenance.
- Power on the VMware host. Look for any problems on the screen. The equivalent of blue screen in VMware is purple screen. When there’s a purple screen, that means there is something very wrong.
- When the VMware host is all booted up, go back to your workstation, and connect using vSphere client to the VMware host.
- Right click on the Vmware host first, and select “Exit Maintenance Mode”
- Power On all the VM’s.
If there are multiple VMware hosts, and Vmotion is licensed and enabled (i.e. Enterprise License), you can vmotion VMs to the other hosts, and perform maintenance. When the host gets back, you can vmotion back the VM’s to the host, and do the same maintenance on the other.