vmware vmotion

16
VMware vMotion: A complete guide Alyssa Wood, Assistant Site Editor Reprints VMware vMotion allows for the live migration of virtual machines, and it is one of the best- known features of vSphere. The 2010 release of vSphere 4.1 improved VMware vMotion by allowing administrators to migrate more than one virtual machine (VM) at a time. (In contrast, Microsoft only debuted Hyper-V Live Migration in 2009, with the release of Windows Server 2008 R2.) VMware vMotion enables the live migration of VMs from one host to another with continuous uptime. It allows admins to perform server maintenance without disrupting guest VMs, and it makes disaster recovery faster and more efficient. In addition, vMotion facilitates VM load balancing across physical hosts. That improves VM performance and optimizes resource usage. There are a few VMware vMotion requirements to know before you begin installation. You might also encounter some roadblocks as you perform live migrations, but the following resources can help you overcome them. This guide also covers VMware Storage vMotion, which extends the vMotion concept from hosts to data stores. TABLE OF CONTENTS Getting started | Troubleshooting vMotion | Storage vMotion | GETTING STARTED WITH VMOTION VMware vMotion works with other VMware features -- VMware Distributed Resource Scheduler, Distributed Power Management and Update Manager -- to provide load balancing and make it easier to perform server maintenance. First, learn how the live migration process actually works and make sure you meet the VMware vMotion requirements. Then you can download and configure vMotion and, finally, perform a vMotion. (That’s actually the easiest part.) Downloading, configuring and using vMotion in vSphere 4 VMware vMotion is a feature of the Advanced, Enterprise and Enterprise Plus versions of the vSphere suite. The vMotion requirements include rules about shared storage, VM affinity, CPU compatibility and cluster organization. You also need to add a vMotion-enabled VMkernel

Upload: linkomirusha1287

Post on 26-Oct-2014

113 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: VMware vMotion

VMware vMotion: A complete guide Alyssa Wood, Assistant Site Editor Reprints

VMware vMotion allows for the live migration of virtual machines, and it is one of the best-known features of vSphere. The 2010 release of vSphere 4.1 improved VMware vMotion by allowing administrators to migrate more than one virtual machine (VM) at a time. (In contrast, Microsoft only debuted Hyper-V Live Migration in 2009, with the release of Windows Server 2008 R2.)

VMware vMotion enables the live migration of VMs from one host to another with continuous uptime. It allows admins to perform server maintenance without disrupting guest VMs, and it makes disaster recovery faster and more efficient. In addition, vMotion facilitates VM load balancing across physical hosts. That improves VM performance and optimizes resource usage.

There are a few VMware vMotion requirements to know before you begin installation. You might also encounter some roadblocks as you perform live migrations, but the following resources can help you overcome them. This guide also covers VMware Storage vMotion, which extends the vMotion concept from hosts to data stores.

TABLE OF CONTENTS Getting started | Troubleshooting vMotion | Storage vMotion |

GETTING STARTED WITH VMOTION

VMware vMotion works with other VMware features -- VMware Distributed Resource Scheduler, Distributed Power Management and Update Manager -- to provide load balancing and make it easier to perform server maintenance. First, learn how the live migration process actually works and make sure you meet the VMware vMotion requirements. Then you can download and configure vMotion and, finally, perform a vMotion. (That’s actually the easiest part.)

Downloading, configuring and using vMotion in vSphere 4 VMware vMotion is a feature of the Advanced, Enterprise and Enterprise Plus versions of the vSphere suite. The vMotion requirements include rules about shared storage, VM affinity, CPU compatibility and cluster organization. You also need to add a vMotion-enabled VMkernel

Page 2: VMware vMotion

adapter if you use Fibre Channel storage. Once your configuration is all set, it’s easy to request a vMotion live migration with just a few clicks inside the vSphere client.

How do I download VMotion? With vSphere 4, you obtain VMotion by purchasing the Advanced, Enterprise or Enterprise Plus version of the vSphere suite. You must also have vCenter 4, which is purchased separately. You cannot add VMotion as a standalone add-on as you could with VMware Infrastructure 3. The big plus is that VMotion is not a separate license key that you have to enter or combine with other license keys; your license for VMotion is included in the version of vSphere you select.

To get the latest pricing on the versions of the VMware product lineup that contain VMotion, visit VMware's Store, or check out the VMware Purchase Advisor.

But if I were you, instead of making a purchase off the bat, I would first evaluate vSphere 4, vCenter and the VMotion feature set. You can get a 60-day evaluation of vSphere 4 Enterprise Plus and vCenter, which includes VMotion and other advanced features. A quick word of caution, however; ensure that your servers are compatible with vSphere by checking the VMware Hardware Compatibility Guide.

How does VMotion work? No matter how many times I use VMotion, I still find it completely amazing. Think about it: The computer you use to view this Web page could be moving from one physical server to another, without your knowledge, and you may never know.

The process of migrating a powered-on virtual machine from one host server to another host without having to power off a VM is known as a "hot" or "live" migration.

We can break the actual process of a VMotion down into a series of steps:

1. A request has been made that VM A should be migrated (or "VMotioned") from ESX A to

ESX B.

2. VM-A's memory is pre-copied from ESX A to ESX B while ongoing changes are written to a

memory bitmap on ESX A.

3. VM-A is quiesced on ESX A and VM A's memory bitmap is copied to ESX B.

4. VM A is started on ESX B and all access to VM A is now directed to the copy running on ESX

B.

5. The rest of VM A's memory is copied from ESX A all the while memory is being read and

written from VM A on ESX A when applications attempt to access that memory on VM A on

ESX B.

Page 3: VMware vMotion

6. If the migration is successful, VM A is unregistered on ESX A. What are the requirements to perform a VMotion? Before you use VMotion in your infrastructure, you need to make sure you meet the requirements. Although the list looks long, the actual process is pretty simple, so don't be alarmed.

The VM cannot be connected to a CD-ROM or floppy drive that is using an ISO or floppy

image stored on a drive that is local to the host server.

The VM's affinity must not be set (aka, bound to physical CPUs).

The VM must not be clustered with another VM (using a cluster service like the Microsoft

Cluster Service (MSCS)).

The two ESX servers involved must use (the same) shared storage.

The two ESX servers involved must be connected via Gigabit Ethernet (or better).

The two ESX servers involved must have access to the same physical networks.

The two ESX servers involved must have compatible CPUs. (See support on Intel andAMD).

Note that these are most -- but not all -- of the requirements. For the complete set of

requirements see the vSphere 4 Basic System Administration Guide, specifically Virtual

Machine Management -- Migrating Virtual Machines (chapter 16) -- Migrating with VMotion

(page 188). If any of the above conditions are not met VMotion will not work. Luckily, the Migration Wizard tests for most of these before attempting a VMotion so that there is no possibility of downtime.

How do I configure VMotion in vSphere 4? Let's assume that you meet all the requirements above, which is a fairly safe assumption because you could meet those requirements simply by creating a new vSphere infrastructure with shared storage and connecting your ESX hosts to that shared storage.

At this point, the only configuration that you need to use VMotion is to add a VMotion-enabled VMkernel adapter. If you use Network File System (NFS) or software iSCSI for your storage area network (SAN) shared storage then you already have a VMkernel adapter. If your shared storage is Fibre Channel (FC), you will have to add a VMkernel adapter.

To do that, follow these steps on each ESX server:

1. Go into the Configuration tab, click on Networking, and click Add Networking.

2. Opt to add a new VMkernel Port.

Page 4: VMware vMotion

3. Add the new VMkernel port to an existing switch or create a new switch.

Page 5: VMware vMotion

4. On the Port Group Properties, it is critical that you check the checkbox that is next to "Use this Port Group for VMotion."

Page 6: VMware vMotion

5. You will have to use Dynamic Host Configuration Protocol (DHCP) or enter a static IP address for the VMkernel adapter (static is highly recommended).

Page 7: VMware vMotion

6. Finally, click Finish on the Ready to Complete window.

How do I perform a VMotion in vSphere 4? Now that you have met the requirements and configured VMotion, you are ready to perform the VMotion in vSphere 4. This is the easiest part.

1. Find the virtual machine that you want to migrate with VMotion in the inventory of the vSphere client.

2. Right-click on the virtual machine and click Migrate or click on the Summary tab and click Migrate.

Page 8: VMware vMotion

3. Select that you want to change the host that the virtual machine runs on. (If you select that, you want to change the data store then you are performing a Storage VMotion.)

Page 9: VMware vMotion

4. Select the destination host or cluster that you want to migrate the VM to. When you make that selection the compatibility check is performed. This is very important because this is where the vSphere client will analyze the destination host to see whether it meets the requirements. What you are looking for is "Validation Succeeded," as you see in the image below.

Page 10: VMware vMotion

If the validation was not successful, the vSphere client will tell you which issue you need to resolve.

5. Next, you can either take the default of Reserve CPU for optimal VMotion Performance (recommended) or opt to Perform with available CPU resources.

Page 11: VMware vMotion

6. Review the confirmation page and click Finish.

Page 12: VMware vMotion

Watch the Recent Tasks window to check the progress of your VMotion migration. You should see a task called Migrate Virtual Machine, and you can watch the progress as it says it is "Migrating the Active State of Virtual Machine," as you see below.

What you want to see is the word Completed under the Task status, as you see below.

Page 13: VMware vMotion

Your VMotion has now completed. You can verify this by checking to see which host your virtual machine is now running on. As you can see in the next picture, the VM that we migrated is now running on the new ESX server.

Understanding how VMware vMotion live migration works VMware's Distributed Resource Scheduler uses VMware vMotion live migration technology to move VMs off overloaded hosts. Doing so provides resource balance, and of course, has zero downtime for end users. With Distributed Power Management, vMotion moves VMs from one host to another when the virtual infrastructure load is low. That way, your organization saves on power and cooling costs. Update Manager even uses VMware vMotion to apply patches.

VMware Inc.'s VMotion feature performs live migration, which enables the movement of running virtual machines (VMs) from one physical ESX host to another. VMotion is one of the most sought-after and powerful capabilities in VMware vSphere because it enables so many critical infrastructure features while creating zero downtime for end users.

How VMotion works and capabilities

Load balancing: VMware's Distributed Resource Scheduler (DRS), you can load-balance virtual

infrastructure resources between ESX servers. If one of the hosts nears overutilization, guest VMs

can be migrated from one ESX Server to another while in use by end users (using VMotion).

Distributed Power Management (DPM): moves running VMs from one ESX server to another using

VMotion so that ESX Servers can be powered off when the load on the virtual infrastructure is low.

This can tremendously reduce a company's power and cooling costs.

Page 14: VMware vMotion

Maintenance of ESX servers: with VMotion, VMware administrators can move running virtual

machines off one ESX server to another to perform hardware or software maintenance, software

patches and so on ESX hosts. In fact, VMware's Update Manager(VUM) uses VMotion to apply

patches.

VMware's VMotion is offered in three of the six vSphere editions: Advanced, Enterprise and Enterprise Plus. Additionally VMware's vCenter is required.

Until recently, VMware had no competitors that offered anything similar to VMotion. With the release of Microsoft's Windows 2008 R2, Microsoft now has a similar feature to offer called "live migration."

As of September 2009, long-distance VMotion is officially supported by VMware but a tremendous amount of hardware and bandwidth are required to make this work.

VMware DRS and vMotion: Improve workload balance, prevent problems

Distributed Resource Scheduler (DRS) and VMware vMotion go hand in hand, but the features don’t always play nice together. DRS ensures that your resource requirements are enforced, and VMware vMotion performs a live migration when VMs and their resources need to be re-allocated. Still, using both VMware DRS and vMotion doesn’t guarantee perfect resource balancing. A vMotion live migration doesn’t always provide complete VM connectivity, and sometimes, a VM fails to migrate.

TROUBLESHOOTING VMOTION

It may be easy to use, but VMware vMotion is not without some minor problems. There are a few cases in which you could encounter VM crashes when you attempt a vMotion live migration. But with these workarounds, you can circumvent those problems before they happen. Pay attention to VM snapshots, storage network connections and CPU types as you decide which machines to migrate. With the right tools, you can even migrate VMs across separate data centers.

VMware VMotion network and storage connectivity issues When it comes time to migrate a VM from one host to another, you need to verify which other hosts have the right connections to accept that VM. VMware vMotion also requires access to shared storage, so in an infrastructure with lots of VMs and even more storage network

Page 15: VMware vMotion

connections, it can be difficult to manage those target hosts. Another caveat is that VMs that are being migrated must be able to access the same IP network. But there’s one solution to both network and storage problems with vMotion: dynamically allocating hosts.

Avoiding an Enhanced vMotion Compatibility gotcha If you don’t perform live migrations between hosts with identical CPUs, you could experience a vMotion crash. But Enhanced vMotion Compatibility (EVC) can prevent these crashes through CPU masking, which tricks the guest OSes into not recognizing the extra features that might disrupt a live migration. Masking CPUs is not a perfect solution, so make sure you understand how VMware EVC works before you try live migrating VMs between hosts with different CPU types.

Live migration across data centers with Overlay Transport Virtualization In the early days of VMware vMotion, a common complaint was that you couldn’t easily perform a live migration across physically separate data centers. In 2010, Cisco Systems developed a bridging method, known as Overlay Transport Virtualization (OTV), to facilitate vMotion between data centers. The setup is fairly simple and allows vMotion live migration across multiple data centers. As your virtual infrastructure grows and expands, the ability to migrate VMs to a remote location is invaluable for disaster recovery.

Troubleshooting VMware snapshots VMware snapshots, or exact copies of a VM at a specific point in time, are vital for virtual machine backup. But snapshots can pose problems during a VMware vMotion live migration. If you try to migrate a VM that has snapshots running, you’ll get an error message explaining that the VM will crash once that migration completes. Changing the default location for VM files disrupts the snapshot process, often because the destination host cannot access the same storage that the files are located on as the source host. If the VM has all its files on shared storage, however, vMotion won’t encounter any problems.

STORAGE VMOTION

Storage vMotion allows you to migrate guest OS virtual disks from one data store to another while the VM is running.

Storage vMotion: Application and performance Instead of simply moving VMs from one host to another, Storage vMotion also moves the storage location of a VM to the same new host. (This process avoids VM downtime.) Storage vMotion also checks the target data store for adequate space before a migration begins. In addition; it’s handy for converting disk types; you can change the disk format of a VM during the copy process.

Page 16: VMware vMotion

Using Storage vMotion to keep servers up when storage is down Storage vMotion is especially useful if you want to keep VMs powered on while a SAN is down. The details behind the Storage vMotion process also reinforce the necessity of snapshots. But there are a few requirements for using Storage vMotion. Virtual machine disks must be in persistent mode or be a raw device mapping that’s in virtual compatibility mode. The host that the VM is running on must also follow several requirements.