Hosts occasionally require maintenance in virtual infrastructures. To prevent a lengthy service disruption while...
a host is offline, you need to perform a virtual machine migration. Unfortunately, the free version of VMware ESXi doesn't offer advanced virtual machine migration features, such as vMotion or High Availability, to simplify this task.
But if you need to perform hardware maintenance with limited downtime, you still have options. With a storage area network (SAN) and another ESXi host, you can carry out a manual virtual machine migration, and then service a host’s hardware.
How to manually perform a virtual machine migration
A SAN provides hosts with flexible access to storage, which is where the Virtual Machine File System and virtual machine (VM) image files reside. Connected ESXi hosts can see -- but cannot access -- these files without manual intervention. All you need to do is import a virtual machine’s VMX file into the host’s inventory database.
After connecting a host to a SAN, you will see the Virtual Machine File System with no VM files. Then right-click the data store. From the menu, select Browse Datastore, which opens a file browser. You should now see all your virtual machines.
Next, power off the virtual machines that you want to migrate. (This step is essential. If you don't power off VMs to be migrated, you risk VM data corruption.) Then open the configuration directory to locate each virtual machine’s VMX configuration file. After finding these files, right-click on a VMX file and select Add to Inventory, which opens a wizard to specify the name and resource pool that you want to use for the virtual machine. In this wizard, you can just accept the default steps to add the VM to the new ESXi host.
Now you can start the virtual machine. ESXi will recognize that the VM was moved. It will ask if you have copied or moved the virtual machine to its new location. Select I copied it to prevent the network interfaces from being renamed. If renamed, the network interfaces will break because the new names won’t match the VM’s configuration.
The virtual machine will start, and you'll be ready to use it again. Note that the VM is no longer available at its original location. The status now displays: Unknown (invalid). It's a good idea to right-click on it and remove it from the original host’s inventory. Once you've finished the maintenance procedure, you can simply repeat this procedure in the opposite direction to return the VM to its original host.
This virtual machine migration procedure is flawed, though. It involves downtime and a short, manual process. If you don't like it, you can buy a licensed version of VMware vSphere that offers vMotion and High Availability. But remember that these virtual machine migration features are expensive.