Virtual machine migration: The old-fashioned way

Virtual machine migration: The old-fashioned way

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.

    Requires Free Membership to View

    When you register, my team of editors will also send you alerts covering all areas of VMware, such as implementing VMware-related virtualization technologies for server consolidation, disaster recovery and backup strategies, management and performance, VM migration and more.

    Margie Semilof, Editorial Director

    By submitting your registration information to SearchVMware.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchVMware.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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.

Figure 1
After selecting Browse Datastore, you'll see all the files for every virtual machine. (Click image for an enlarged view.)

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.

Figure 2
Finding the VMX file to add a virtual machine to another host. (Click image for an enlarged view.)

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.

This was first published in May 2011

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.