Saturday, April 14, 2018

Migrate Virtual Machines

 Migrate Virtual Machines

**ITEMS IN BOLD ARE TOPICS PULLED FROM THE BLUEPRINT**
Knowledge
  • Identify ESXi host and virtual machine requirements for vMotion and Storage vMotion
    • There are multiple host and virtual machine requirements in order to perform vMotion and Storage vMotions on any given virtual machine
    • Host Requirements for vMotion and Storage vMotion
      • Each host participating in a vMotion needs to have the proper licensing
      • The hosts participating in a vMotion need to meet the networking requirements for vMotion
      • The hosts participating in a vMotion must meet shared storage requirements
    • Virtual Machine Requirements for vMotion and Storage vMotion
      • The VM must not have raw disks in use for clustering
      • No virtual devices backed by physical devices that the destination host does not also have access to
      • If the VM is using a USB passthrough, ensure the device is enabled for vMotion
      • The VM must not have a virtual device backed by a device on a client computer

  • Identify Enhanced vMotion Compataibility CPU requirements
    • In order to perform a vMotion between hosts the processors on those hosts need to meet certain requirements in order for the vMotion to take place.  In an effort to make more hosts compatible with each other, which is to say more processors compatible, Enhanced vMotion Compatibility (EVC) was created.  EVC allows for hosts with processors with different clock speeds, cache sizes, and other CPU differing features, to vMotion VMs between each other (processors must be from the same vendor class, i.e. AMD or Intel and the same processor family). 
    • Certain CPUs within the same family will not be compatible, especially if there is a major change to the instruction set
    • There are multiple modes in which you can be set for EVC, see Objective 5.1 for details
    • What is EVC actually doing?   EVC figures out the common instructions/features amongst all hosts’ CPUs and then masks the unique features from the virtual machines running in that DRS cluster.  This ensures that execution of CPU instructions will successfully resume on the destination host once a vMotion has completed
    • To sum up EVC CPU requirements:
      • CPUs must be in the same vendor class (can’t mix Intel and AMD processors)
      • CPUs must also be from the same processor family (all CPUs within the same family may not be compatible)

  • Identify snapshot requirements for vMotion/Storage vMotion migration
    • Basic vMotion requirements apply to virtual machines with snapshots.  As long as the location of the snapshots are accessible by both source and destination host (default is virtual machine folder)
    • Basic Storage vMotion requirements apply to virtual machines with snapshots.  This is new to vSphere 5 as earlier versions did not support performing a storage vMotion on virtual machines with snapshots

  • Migrate virtual machine using vMotion/Storage vMotion
    • Migrations are pretty simple using the vSphere Client and the vSphere Web Client.  For this purpose I’ll only cover the thick client
    • Migrating a Virtual Machine using vMotion – has vDatacenter boundary
        1. Log in to vCenter using the VI Client
        2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters)
        3. Right-click on the virtual machine you want to vMotion and select Migrate…
        4. The Migrate Virtual Machine wizard will display, select Change host > click Next
        5. Choose a DRS cluster or individual host you want to migrate to > click Next
        6. Choose between High priority and Standard priority, High is the default > click Next
        7. Click Finish
    • Migrating a Virtual Machine using Storage vMotion
        1. Log in to vCenter using the VI Client
        2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters)
        3. Right-click on the virtual machine you want to storage vMotion and select Migrate…
        4. The Migrate Virtual Machine wizard will display, select Change datastore > click Next
        5. Choose a format for the destination virtual disk
          1. Same format as source (default)
          2. Thick Provision Lazy Zeroed
          3. Thick Provision Eager Zeroed
          4. Thin Provision
        6. Choose whether you want to change the VM storage profile or not
        7. Choose a new datastore or datastore cluster
        8. If you selected a datastore cluster in step 7 and want to disable storage DRS check the Disable Storage DRS for this virtual machine checkbox and manually select a destination datastore in the pane below > click Next
        9. Click Finish
  • Configure virtual machine swap file location
    • There are three different locations that you can configure the swap file location of a virtual machine.  If the host is not part of a cluster, you configure it per-host.  If the host is part of a cluster, you configure it for the cluster or you can configure it for an individual virtual machine regardless if the host it runs on is part of a cluster or not
    • Configure Virtual Machine Swap Location – Cluster
        1. Log in to vCenter using the VI Client
        2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters)
        3. Right-click on the cluster you want to configure and select Edit Settings…
        4. Select Swapfile Location from the list on the left
        5. Select either Store the swapfile in the same directory as the virtual machine (recommended) or select Store the swapfile in the datastore specified by the host.  Selecting the second option will allow you to edit the swapfile on a per-host basis
        6. Click OK when finished
    • Configure Virtual Machine Swap Location – Host
        1. Log in to vCenter using the VI Client
        2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters)
        3. Select the host you want to configure the swapfile location for from the left
        4. In the right pane select the Configuration tab
        5. Underneath the Software menu click the Virtual Machine Swapfile Location hyperlink
        6. In the top left of the center pane click the Edit… hyperlink
        7. Choose the datastore you want to store the swapfile on
        8. Click OK when finished
    • Configure Virtual Machine Swap Location – Virtual Machine
        1. Log in to vCenter using the VI Client
        2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters)
        3. Right-click the virtual machine you want to configure and select Edit Settings
        4. Choose the Options tab on top
        5. Select Swapfile Location, which is the very last option in the list
        6. Choose Default, which uses the settings of the cluster (if in a cluster), choose Always store with the virtual machine or choose Store in host’s swapfile datastore
        7. Click OK when finished

  • Migrate a powered-off or suspended virtual machine
    • Migrating a powered-off or suspended VM is pretty straight-forward, it is a similar process to a normal vMotion
    • Migrate a Powered-off or Suspended Virtual Machine – has vCenter boundary
        1. Log in to vCenter using the VI Client
        2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters)
        3. Right-click on the virtual machine you want to vMotion and select Migrate…
        4. Leave the default option of Change both host and datastore or choose either host or datastore – if you are migrating to another vDatacenter you must choose the default > click Next
        5. Choose the DRS cluster or individual host for the destination > click Next
        6. If you select a DRS in the previous step choose now you must choose an individual host > click Next
        7. Select the format for the virtual disk
        8. If applicable select a VM Storage Profile
        9. Select a datastore or datastore cluster, if you select a datastore cluster you have the option of checking the Disable Storage DRS for this virtual machine checkbox, doing so requires you to select an individual datastore from that datastore cluster and configuring advanced settings
        10. Click Next
        11. Click Finish

  • Utilize Storage vMotion techniques (changing virtual disk type, renaming virtual machines, etc.)
    • Storage vMotion has more uses than just moving data from one datastore to another.  You can change the virtual disk format, apply storage profiles, split up virtual disks and disable Storage DRS
    • You can change your virtual disk format to one of the three virtual disk format options:
      • Thick Provision Lazy Zeroed – this will allocate the space, but will not write to every block (zero it out) until first write
      • Thick Provision Eager Zeroed – this will allocate the space and zero out all of it up front, because of this thick provision eager zeroed disks take longer to create/storage vMotion
      • Thin Provision – this will logically allocate space, and the virtual machine will think it has all physical capacity, but the space is allocated as needed.  Be careful of over-commitment and ensure you have proper alarms setup if you are going to over-commit using virtual disk thin provisioning
    • You can change the VM Storage Profile during a storage vMotion, which an administrator will have pre-configured (this option is not available if you don’t have any storage profiles defined)
    • You can split up your virtual disk files also.  Clicking the Advanced button in the storage vMotion wizard on the Storage page brings up another window that allows you to choose, individually, where you store your configuration files and virtual hard disks
    • If you are selecting a datastore cluster as your destination storage you also have the option to disable storage DRS for that particular virtual machine.  At that point you can manually choose a datastore from that datastore cluster

No comments:

Post a Comment