Dec 17, 2016

How To Migrate VMFS 5 Datastore to VMFS 6 Datastore


This guide provides information on migrating existing vSphere VMFS 5 datastore to vSphere VMFS 6 datastore.







VMFS 6 is the new filesystem of vSphere 6.5. The new filesystem supports 512e advanced format drives and is 4098 sector (4K) aligned. It also supports automatic UNMAP, which asynchronously tracks freed blocks and sends UNMAPs to backend storage in background.

VMFS 5 and VMFS 6 can coexist. However, due to the changes done in VMFS 6 metadata structures to make it 4K aligned, you cannot inline/offline upgrade from VMFS5 to VMFS6.

You can leverage the new VMFS 6 capabilities by creating a new VMFS 6 datastore and provisioning new virtual machines to it or migrating the existing virtual machines from VMFS 5 datastore to VMFS 6 datastore.

Prerequisites

In this KB we are assuming that vSphere admins are upgrading their VMFS datastores one at a time. The below description applies mostly to these scenarios. Though the basic workflow will not change if someone wants to perform upgrade of multiple datastores in parallel. 
Keep the following info handy while you plan for your VMFS datastore upgrade:
  • Identify the VMFS datastore that must be upgraded to VMFS 6 file system type. For example, DS-1.
  • Identify the name of the vCenter Server and list of all ESX hosts sharing the datastore with credentials.
  • All ESX hosts and the vCenter server must be upgraded to vSphere 6.5.


Note: Do not proceed with datastore upgrade until all ESX hosts which share the datastore are upgraded to vSphere 6.5. If you do not upgrade, older ESX hosts lose connectivity to the new VMFS 6 datastore after upgrading. This may impact the business continuity.

  • Spare datastore with equal or more capacity, which is shared with all ESX hosts. For example, DS-2 in this KB. The DS-2 datastore is used to temporarily host all virtual machines from the DS-1 datastore.


Requirements when you are automating the process using windows powershell scripts:

  • Windows 2008/2008 R2/2012 on 64bit in a domain environment. The windows host used for launching the utility.
  • PowerShell 2.0 or above, with all policies set. vSphere powershell plugins installed. Should be able to launch as Administrator. Execute in 64bit PowerShell environment.


Different deployment use cases and migration steps

Note: You can directly migrate your virtual machines from VMFS 5 datastores to VMFS 6 datastores using Storage vMotion. However, below is the recommended process for different deployment scenarios.


Usecase 1: One vCenter Server having inventory of registered virtual machines running from datastore DS-1.

The DS-1 datastore of VMFS 5 (or VMFS 3) must be upgraded to datastore with filesystem type VMFS 6.  This datastore is shared with all the ESX hosts in the inventory and has some virtual machines running from this datastore.

To upgrade:

  • Perform version check for the vCenter Server and all ESX hosts.


Note: All ESXi hosts and vCenter Server must be of vSphere 6.5. Do not proceed if any one of ESXi hosts is not vSphere 6.5. Proceeding further means business continuity loss and the new datastore is not visible in old ESX hosts.

  • Perform all pre checks for free space availability on datastore DS-2.  Available space on DS-2 must be equal or more than the datastore DS-1 space.
  • Ensure that the datastore DS-2 is VMFS 5 type.
  • Prepare list of all virtual machines in the vCenter Server’s inventory that are hosted on datastore DS-1.
  • Evacuate the datastore DS-1. For this, migrate all the virtual machines running from datastore DS-1 to datastore DS-2. Storage vMotion operations are performed on these virtual machines.

  • Perform one migration at a time to avoid disrupting the performance of remaining datacenter entities. Keep track of any migration failures, if any, re-trigger the migration for those virtual machines. 

  • Ensure that datastore DS-1 is empty by listing files on this datastore.


Note: Proceed further only if datastore DS-1 is empty.

  • Unmount datastore DS-1 from all ESX hosts.
  • Delete datastore DS-1.
  • Create a new datastore with the VMFS 6 filesystem using the same lun. For example, DS-1.
  • Trigger a storage rescan operation on all hosts and wait for few minutes for this operation to complete.
  • Move all virtual machines back to datastore DS-1 from datastore DS-2 by performing storage vMotion operation. It is suggested to migrate one virtual machine at a time. Keep track of any migration failures, if any, re-trigger migration for those virtual machines.
  • Note: If you have Storage DRS configured in this environment and you are using SDC, you can also use datastore maintenance mode feature to aid in the above steps. See Usecase 5 for more information.

Usecase 2: One vCenter Server having inventory of registered virtual machines running from datastore DS-1. Datastore DS-1 also has some orphaned data which is not registered in the vCenter Server’s inventory.

To upgrade:

  • Perform version check for vCenter Server and all ESX hosts.

Note: All ESXi hosts and vCenter Server must be of vSphere 6.5. Do not proceed if any one of ESXi hosts is not vSphere 6.5. Proceeding further means business continuity loss and the new datastore is not visible in old ESX hosts.

  • Perform all pre checks for free space availability on datastore DS-2. Available space on DS-2 must be equal or more than the datastore DS-1 space.
  • Ensure that the datastore DS-2 is VMFS 5 type.
  • Prepare list of all virtual machines in the vCenter Server’s inventory that are hosted on datastore DS-1.
  • Evacuate the datastore DS-1. For this, migrate all the virtual machines running from datastore DS-1 to datastore DS-2. Storage vMotion operations are performed on these virtual machines. 
Perform one migration at a time to avoid disrupting the performance of remaining datacenter entities. Keep track of any migration failures, if any, re-trigger the migration for those virtual machines.
  • Prepare the list of files (orphaned files, not registered to the vCenter Server’s inventory) present on datastore DS-1.
  • Start moving these files to datastore DS-2 one at a time. It is suggested to use one of the recommended ways to move files on VMFS datastores. 

For example, vmkfstools utility on ESX commandline, powershell cmdlets. 

  • Ensure that datastore DS-1 is empty by listing files on this datastore. Proceed further only if datastore DS-1 is empty.
  • Unmount datastore DS-1 from all the ESX hosts.
  • Delete datastore DS-1.
  • Create a new datastore with the VMFS 6 filesystem using the same lun. For example, DS-1.
  • Trigger a storage rescan operation on all hosts and wait for few minutes for this operation to complete.
  • Move all virtual machines back to datastore DS-1 from datastore DS-2 by performing storage vMotion operation. It is suggested to migrate one virtual machine at a time. Keep track of any migration failures, if any, re-trigger migration for those virtual machines.
  • Move orphaned data files back to datastore DS-2 one at a time. It is suggested to use one of the recommended ways to move files on VMFS datastores. 

For example, vmkfstools utility on ESX commandline, powershell cmdlets.

Note: You cannot use Storage DRS and SDC reliably in this case because datastore maintenance operation evacuates a datastore with known virtual machine objects only. For example, virtual machines that are registered to the vCenter Server’s inventory. Any other data on the datastore is left behind.

Usecase 3: One vCenter Server having inventory of registered virtual machines running from datastore DS-1. Datastore DS-1 has some virtual machines configured with virtual disk affinity rules.

To upgrade:

  • Perform version check for vCenter Server and all ESX hosts.

Note: All ESXi hosts and vCenter Server must be of vSphere 6.5. Do not proceed if any one of ESXi hosts is not vSphere 6.5. Proceeding further means business continuity loss and the new datastore is not visible in old ESX hosts.






  • Perform all pre checks for free space availability on datastore DS-2. Available space on DS-2 must be equal or more than the datastore DS-1 space.
  • Ensure that the datastore DS-2 is VMFS 5 type.
  • Prepare list of all virtual machines in the vCenter Server’s inventory that are hosted on datastore DS-1.
  • Identify virtual machines and virtual disks that are configured for disk affinity rules and are hosted from datastore DS-1. If automatic storage load balancing is configured in the cluster, change it to manual setting. Make a note of all the storage affinity rules currently configured.
  • Evacuate the datastore DS-1. For this, migrate all the virtual machines running from datastore DS-1 to datastore DS-2. Storage vMotion operations are performed on these virtual machines. 

Perform one migration at a time to avoid disrupting the performance of remaining datacenter entities. Keep track of any migration failures, if any, re-trigger the migration for those virtual machines.

  • Ensure that datastore DS-1 is empty by listing files on this datastore. Proceed further only if datastore DS-1 is empty.
  • Unmount the datastore DS-1 from all ESX hosts.
  • Delete the datastore DS-1.
  • Create a new datastore with the VMFS 6 filesystem using the same lun. For example, DS-1.
  • Trigger a storage rescan operation on all hosts and wait for few minutes for this operation to complete.
  • Add this datastore back to datastore cluster as earlier.
  • Move all virtual machines back to datastore DS-1 from datastore DS-2 by performing storage vMotion operation. It is suggested to migrate one virtual machine at a time. Keep track of any migration failures, if any, re-trigger migration for those virtual machines.
  • Add all the storage affinity rules back as earlier (from step #5). If automatic storage load balancing is configured in the cluster, change it back to the original setting (automatic mode). 
Note: If you have Storage DRS configured in this environment and you are using SDC, you can also use datastore maintenance mode feature to aid in the above steps. See Usecase 5 below for more detailed description on this.

Usecase 4: One vCenter Server having inventory of registered virtual machines running from datastore DS-1. Datastore DS-1 has some virtual machines with multiple virtual disks attached. At least one of these virtual disks for these virtual machines is hosted from datastore DS-1.

To upgrade:

  • Perform version check for vCenter Server and all ESX hosts.

Note: All ESXi hosts and vCenter Server must be of vSphere 6.5. Do not proceed if any one of ESXi hosts is not vSphere 6.5. Proceeding further means business continuity loss and the new datastore is not visible in old ESX hosts.

  • Perform all pre checks for free space availability on datastore DS-2. Available space on DS-2 must be equal or more than the datastore DS-1 space.
  • Ensure that the datastore DS-2 is VMFS 5 type.
  • Prepare list of all virtual machines in the vCenter Server’s inventory that are hosted on datastore DS-1.
  • Evacuate the datastore DS-1. For this, migrate all the virtual machines running from datastore DS-1 to datastore DS-2. Storage vMotion operations are performed on these virtual machines. 

Perform one migration at a time to avoid disrupting the performance of remaining datacenter entities. Keep track of any migration failures, if any, re-trigger the migration for those virtual machines.

  • In virtual machines with multiple virtual disks, in which atleast one disk hosted from datastore DS-1. Migrate only these particular virtual disks to datastore DS-2. Keep a list of such virtual machines and virtual disks.
  • Ensure that datastore DS-1 is empty by listing files on this datastore. Proceed further only if datastore DS-1 is empty.
  • Unmount datastore DS-1 from all ESX hosts.
  • Delete datastore DS-1.
  • Create a new datastore with the VMFS 6 filesystem using the same lun. For example, DS-1.
  • Trigger a storage rescan operation on all hosts and wait for few minutes for this operation to complete.
  • Move all virtual machines back to datastore DS-1 from datastore DS-2 by performing storage vMotion operation. It is suggested to migrate one virtual machine at a time. Keep track of any migration failures, if any, re-trigger migration for those virtual machines.
  • Migrate virtual disks identified in step # 6 back to datastore DS-1.

Usecase 5: One vCenter Server having inventory of registered virtual machines running from datastore DS-1. Storage DRS is being used and datastore DS-1 is part of Storage Datastore Cluster (SDC). Automatic load balancing features are turned ON for space and IO load balancing in this SDC.
This is the usecase with one vCenter Server in the environment. The datastore DS-1 is of type VMFS 5 (or VMFS 3) and must be upgraded to datastore with filesystem type VMFS 6. The vCenter Server is also configured with Storage DRS. There is a Storage Datastore Cluster (SDC) created and datastore DS-1 is part of this datastore cluster. This datastore cluster is also configured to have storage space and IO load balancing in fully automatic mode.

To upgrade:

  • Perform version check for vCenter Server and all ESX hosts.

Note: All ESXi hosts and vCenter Server must be of vSphere 6.5. Do not proceed if any one of ESXi hosts is not vSphere 6.5. Proceeding further means business continuity loss and the new datastore is not visible in old ESX hosts.

  • Perform all pre checks for free space availability on datastore DS-2. Available space on DS-2 must be equal or more than the datastore DS-1 space.
  • Ensure that the datastore DS-2 is VMFS 5 type and is empty.
  • Add datastore DS-2 to this datastore cluster.
  • Put datastore DS-1 into maintenance mode. This should start evacuating datastore DS-1 with storage vMotion operations on the virtual machines. You also observe some of virtual machine moving towards datastore DS-2.
  • Ensure that datastore DS-1 is empty by listing files on this datastore. Proceed further only if datastore DS-1 is empty.
  • Unmount datastore DS-1 from all ESX hosts.
  • Delete datastore DS-1.
  • Create a new datastore with the VMFS 6 filesystem using the same lun. For example, DS-1.
  • Trigger a storage rescan operation on all hosts and wait for few minutes for this operation to complete.
  • Add datastore DS-1 back to the Storage Datastore Cluster.
  • Put datastore DS-2 into maintenance mode. This starts evacuating datastore DS-2 with Storage vMotion operations on the virtual machines.
  • Move the datastore DS-2 out of the datastore cluster.
  • Exit maintenance mode for datastore DS-2.

Usecase 6: The vCenter Server is having inventory of registered virtual machines running from datastore DS-1. At least one ESX server which also has inventory of registered virtual machines running from the same datastore DS-1. This ESX server is not added to any vCenter Server’s inventory.
One vCenter Server in the environment. The datastore DS-1 is of type VMFS 5 (or VMFS 3) and must to be upgraded to datastore with filesystem type VMFS 6.  This datastore is shared with all the ESX hosts in the vCenter inventory and has some virtual machines running from this datastore. Additionally, this datastore is also shared with at least one ESX host. This ESX host is not added to vCenter Server inventory. There are some virtual machines running from this ESX host and datastore DS-1.  Let us call this ESX host as ESX-1 in below steps.

To upgrade:

  • Perform version check for vCenter Server and all ESX hosts.

Note: All ESXi hosts and vCenter Server must be of vSphere 6.5. Do not proceed if any one of ESXi hosts is not vSphere 6.5. Proceeding further means business continuity loss and the new datastore is not visible in old ESX hosts.

  • Perform version check for ESX server EWSX-1. This ESX host must be vSphere 6.5.

Note: Do not proceed if any one of ESXi hosts is not vSphere 6.5. 

  • Perform all pre checks for free space availability on datastore DS-2. Available space on DS-2 must be equal or more than the datastore DS-1 space.
  • Ensure that the datastore DS-2 is of VMFS 5 type.
  • Ensure that the datastore DS-2 is visible from host ESX-1.
  • Add ESX-1 to the vCenter Server inventory.
  • Prepare the list of virtual machines in the vCenter Server’s inventory that are hosted on datastore DS-1.
  • Prepare list of virtual machines running from ESX server ESX-1 and hosted on datastore DS-1.
  • Evacuate the datastore DS-1. For this, migrate all the virtual machines running from datastore DS-1 to datastore DS-2 by performing storage vMotion operations on these virtual machines. 

Perform one migration at a time to avoid disrupting the performance of remaining datacenter entities. Keep track of any migration failures, if any, re-trigger the migration for those virtual machines.

  • Ensure that datastore DS-1 is empty by listing files on this datastore. Proceed further only if datastore DS-1 is empty.
  • Unmount datastore DS-1 from all ESX hosts.
  • Delete datastore DS-1.
Note: You may have other deployment situations which may require you to take some extra precautions while doing this migration. Attached to this article is the 2147824_SampleMigrationVMFS5ToVMFS6.ps1 script. Ensure that you understand your environment and perform migration steps accordingly.
 Attached is a sample script name “2147824_SampleMigrationVMFS5ToVMFS6.ps1".








The contents of the article was taken from VMware Knowledge Base

Post a Comment

 
TECHNOCRACY © 2012-2017