PCs

vSphere tips and tricks for host maintenance mode

Maintenance mode is one of the best features of an ESX(i) host administrative process. Rickatron shares some tips and tricks in this post for this aspect of virtualization.

When I first became familiar with ESX 3, I noticed that the host had this action called maintenance mode. I immediately saw the value of this feature, and have been a big fan of using it ever since. As it turns out, the key technologies around vSphere such as vMotion and Storage vMotion allow virtual machines to be migrated from one ESX(i) host to another, but there still may be work to be done on the actual host. This is where maintenance mode can really help keep the environment clean.

Maintenance mode simply evacuates running virtual machines from an ESX(i) host and allows it to be a good place to do a number of administrative tasks, including rebooting the host. You enter maintenance mode by right-clicking on the host as shown in Figure A:

Figure A

In vSphere environments where there is a cluster and vMotion technologies are licensed, the virtual machines will migrate to other hosts in the cluster. If local attached storage is in use, these virtual machines will not automatically migrate off of the host. Further, vSphere Essentials Plus licensing or higher will allow migration using vMotion. Once the host is evacuated, the administrative tasks can begin. Here is a list of some of the administrative tasks best served by using maintenance mode:

  • Perform updates: vCenter Update Manager provides updates to ESX(i), and reboots may be required.
  • Configure storage or multipathing: You don’t want to do this while virtual machines are running on the host. This includes rescanning and adding new datastores.
  • Add memory or processors to the host: You will need to shut the host down to do this.
  • Core host configuration: Any advanced settings being set on the host, or things like setting up time (such as NTP client) would be a good idea to do while the host is in maintenance mode.
  • Changing licensing for a host: You don’t want to have any errors in the licensing configuration that may cause unexpected behavior on the virtual machines while they are running.

There are a few changes to consider with maintenance mode, however. First of all, changes to storage configuration topics may not be exclusive to a host. In any situation where there is multipathing, changes are on the same storage network or storage fabric as the other hosts, so use caution from the perspective of the shared storage resources. Lastly, give consideration to any HA and DRS rules and capacity reservations, as the cluster capacity may shrink.

The key takeaway is to USE maintenance mode. Frequently, I respond to the “ESXi” or “vSphere” public searches in Twitter when I see someone complain of some weird situations. I’ll ask if they were using maintenance mode. Sadly, it is usually not the case. In what ways do you use maintenance mode for your ESX(i) hosts? Share your comments below.

About

Rick Vanover is a software strategy specialist for Veeam Software, based in Columbus, Ohio. Rick has years of IT experience and focuses on virtualization, Windows-based server administration, and system hardware.

2 comments
b4real
b4real

The insane purist would zone in one host at a time then add ;0)

cjones
cjones

Hi, In your article you state the following: "Configure storage or multipathing: You don’t want to do this while virtual machines are running on the host. This includes rescanning and adding new datastores." However, in a vSphere Cluster when you add storage to a host a rescan is automatically triggered on all other hosts in the cluster. Putting one host in Maintenance Mode doesn't really serve any purpose. The only way you could achieve what you suggest is to present the storage to each host individually, put the host into maintenance mode and add the storage, then repeat with the next host. With clusters supporting up to 32 hosts this would change a task that takes a few minutes (create storage, present to all hosts, add storage on one host and rescan all other hosts) to taking over an hour (entering maintenance mode, waiting for VMs to evacuate which can take 20 mins or more depending on VM density, present storage, add storage to host, exit maintenance mode, repeat for possibly up to 32 hosts). Whilst I am also a lover of the Maintenance Mode feature, it doesn't really seem to add much value to performing storage operations such as additions and removals. Configuring Multipathing I can agree with using Maintenance Mode, however your multipathing policy for each datastore should be configured long before you place VMs on them.