Objective 7.4 – Migrate Virtual Machines Print E-mail
Written by Matthijs van den Berg   
Wednesday, 18 November 2009 23:44

Knowledge

  • Identify compatibility requirements
    For a VMotion to work some requirements need to be met. Those requirements depend on the specific environment you are using. Some factors are:
    • What type of migration are you performing (cold, hot, storage)
    • What type of licenses do you have (need enterprise for VMotion!)
    • Is your hardware suited for VMotion / Storage VMotion
  • Cite the three methods of virtual machine migration
    • Cold Migration
      a cold migration is a migration of a VM when it is powered off. The benefits of a cold migration are:
      • You can move the VM files, also when those are not on shared storage
      • The Host you move the VM to does not need to have the same CPU

        The downside is, obvious, that you need to power down the VM. I think that VMotion of a suspended VM is also a cold migration. Almost the same benefits apply here, with the exception of the host CPU. Those must be of the same proc family for the migration of a suspended VM to work.
    • VMotion
      Migration with VMotion allows virtual machine working processes to continue throughout a migration. The entire state of the virtual machine, as well as its configuration file, if necessary, is moved to the new host, while the associated virtual disk remains in the same location on storage that is shared between the two hosts. After the virtual machine state is migrated to the alternate host, the virtual machine runs on the new host. The state information includes the current memory content and all the information that defines and identifies the virtual machine. The memory content includes transaction data and whatever bits of the operating system and applications are in the memory. The defining and identification information stored in the state includes all the data that maps to the virtual machine hardware elements, such as BIOS, devices, CPU, MAC addresses for the Ethernet cards, chip set states, registers, and so forth. When you migrate a virtual machine with VMotion, the new host for the virtual machine must meet compatibility requirements in order for the migration to proceed.
      The benefits of a VMotion are that there is no host downtime. The downsides are:
      • Need shared storage
      • Need a (preferably dedicated) Gigabit network connection
      • The ESX hosts need to be configured in exactly the same manner (like network names, storage etc.)
      • You need processors from the same family or use Enhanced VMotion to broaden the compatibility of the processors.
      • You cannot move the storage of the VM, you need ….
    • Storage VMotion
      Use migration with Storage VMotion to relocate a virtual machine’s configuration file and virtual disks while the virtual machine is powered on.

      You cannot change the virtual machine’s execution host during a migration with Storage VMotion. You can use storage VMotion while the VM keeps on running. This allows you to free up space in storage array’s without downtime.
  • Understand/Apply
    Migration with VMotion allows virtual machine working processes to continue throughout a migration. The entire state of the virtual machine as well as its configuration file, if necessary, is moved to the new host, while the associated virtual disk remains in the same location on storage that is shared between the two hosts. After the virtual machine state is migrated to the alternate host, the virtual machine runs on the new host. The state information includes the current memory content and all the information that defines and identifies the virtual machine. The memory content includes transaction data and whatever bits of the operating system and applications are in the memory. The defining and identification information stored in the state includes all the data that maps to the virtual machine hardware elements, such as BIOS, devices, CPU, MAC addresses for the Ethernet cards, chip set states, registers, and so forth. When you migrate a virtual machine with VMotion, the new host for the virtual machine must meet compatibility requirements in order for the migration to proceed.
    Migration with VMotion happens in three stages:
    • When the migration with VMotion is requested, vCenter Server verifies that the existing virtual machine is in a stable state with its current host.
    • The virtual machine state information (memory, registers, and network connections) is copied to the target host.
    • The virtual machine resumes its activities on the new host. If any error occurs during migration, the virtual machines revert to their original states and locations.

      Migration of a suspended virtual machine and migration with VMotion can be referred to as hot migration, because they allow migration of a virtual machine without powering it off.
  • Determine migration use cases
    There can be several reasons why to migrate a VM from one hosts to another. Some scenarios are:
    • Migrate VMs to perform hard- and or software maintenance of the host or underlying layers as network / storage
    • Migrate VMs for migration purposes
    • Migrate VMs for balancing the use of resources (automated with DRS)
    • Migrate VMs to separate certain servers onto different hosts
    • Migrate VMs to automatically shut down remaining hosts for power savings (DPM)
    • Migrate VMs for disaster recovery reasons
  • Compare and contrast migration technologies
    You can migrate VMs for several reasons as described above. To be able to know how to migrate you need to now about several migration options:
    • VMotion
      For the live migration of a VM from one ESX hosts to another. No downtime
    • Storage VMotion
      With storage VMotion techniques you can migrate the files the VM uses from one VMFS to another storage array. No downtime for the VM.
    • VMware converter
      you can use the VMware converter to migrate VMs of physical machines to a VM. Usually this requires downtime and the old machine is not removed (default).
  • Migrate a virtual machine using VMotion
    To migrate a VM using the vSphere Client GUI:
    • Right click the VM
    • Select “Migrate…” from the menu
    • The following wizard appears
      vmotionwiz
    • Select “Change host”
    • On the “Select Destination” select the Cluster to migrate to
    • On the “Select Resource Pool” select the resource pool to migrate to
    • On the VMotion priority select with what priority a VM will be Motioned:
      High Priority migration (the  recommended and first option in vSphere called: Reserve CPU …) will VMotion the VM and reserve the resources this VM needs on both the source and destination hosts. If those CPU resources cannot be allocated the VMotion will fail!
      Low Priority migration:  Resources are not reserved on the source / destination hosts. The migration will take longer and the VM might become unavailable for some time!
    • Finish to start the VMotion (remember that there is a maximum to the number of concurrent VMotion.
  • Migrate a virtual machine using Storage VMotion
    This method used the same start as the normal VMotion but has a few different steps. Since I have Copy Past:
    • Right click the VM
    • Select “Migrate…” from the menu
    • The following wizard appears
      storagevmotion
    • Select “Change datastore”
    • On the “Select Resource Pool” select the resource pool to migrate to
    • On the Select Datastore screen select the data store you would like to move to. If you would like to separate several files of a VM (configuration files, different disks, etc) you can select the “Advanced” option that allows you to pick a data store from per disk or for the configuration files.
      selectdatastore
    • Select the format you would like to disk to use. Here you can change a thin disk to a thick disk or visa versa.
    • Finish to start the VMotion (remember that there is a maximum to the number of concurrent VMotions.
  • Cold migrate a virtual machine
    And the last option of the Migrate wizard only applies to VMs that are turned off or are in “Suspended” state. You can perform a migration of the ESX host and the datastore in one migration.
    coldvmotion

    Since this option uses a combination of the options you’ll find in the wizards described above I will not go into detail. The only change is the select host you need to specifically select and ESX host to migrate to.

Tools


 

VCP4 Studie Guide - Fast Find