How to migrate a RDM backed disk to a new storage array
search cancel

How to migrate a RDM backed disk to a new storage array

book

Article ID: 385983

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

When migrating from one storage array to a new array, disks that are created as RDMs need to have the data transferred off of the current backing LUNs and onto new LUNs located on the new storage array.

Environment

VMware ESXi 6.x
VMware ESXi 7.x
VMware ESXi 8.x

Resolution

Warning: Please ensure all steps are reviewed and followed accurately to ensure integrity of RDM data. 

When migrating data from RDM LUNs to a new storage array, there are two primary options:

Option 1: Convert RDMs to VMDKs and Migrate

This process involves:

  1. Converting the RDM into a VMDK.
  2. Performing a Storage vMotion to move the VMDK to the new datastore.
  3. Converting the VMDK back to an RDM.

Step 1: Converting the RDM to a VMDK

  • Converting a Virtual RDM

    Virtual mode RDM data can be converted to a VMDK disk with Storage vMotion by selecting the Disk Format from Advance View. This operation can be performed when the VM is either in a powered on or powered off state.

    1. Initiate a Storage vMotion of the VM with Virtual RDM disks attached.

      Example VM

      In the below example, Hard Disk 3 (1 TB) which is a RAW LUN is attached to the VM as a Virtual compatibility RDM.



    2. Use the Advanced option in the Storage vMotion wizard
    3. Change the disk format for the RDM disk by using the "Thick" or "Thin" option from the Disk Format drop down

      Note: If the destination format is not changed to thick or thin provisioned for an RDM in the advanced section of the migration wizard, only the RDM mapping file will be migrated to the destination datastore.



    4. Select the destination datastore and proceed with the Storage vMotion.
    5. Once the Storage vMotion task is completed, the Virtual RDM disk will be converted to a VMDK disk.
  • Converting a Physical RDM

    • Method 1: VM Powered Off
      1. Power off the VM.
      2. Initiate a Storage vMotion of the VM with the Physical RDM disks attached.
      3. Use the Advanced option in the Storage vMotion wizard
      4. Change the disk format for the RDM disk by using the "Thick" or "Thin" option from the Disk Format drop down

        Note: If the destination format is not changed to thick or thin provisioned for an RDM in the advanced section of the migration wizard, only the RDM mapping file will be migrated to the destination datastore.

      5. Select the destination datastore and proceed with the Storage vMotion.
      6. Once the Storage vMotion task is completed, the Virtual RDM disk will be converted to a VMDK disk.

    • Method 2: VM Powered On
      1. Remove the RDM disk from the VM, and delete it from disk to ensure that the RDM mapping file is deleted. This will not delete the data in the RDM.



      2. Re-add the RDM LUN as a Virtual RDM disk: Virtual Machine -> Edit Settings -> RDM Disk -> Add.



      3. Select the RAW LUN to add it as Virtual RDM disk and click OK.



      4. Select the Compatibility Mode as "Virtual" and click OK.



      5. Once the same RAW LUN is added back as Virtual RDM, initiate a Storage vMotion of the VM with the new Virtual RDM disk attached.
      6. Storage vMotion the Virtual RDM disk by changing the Disk Format to either Thick or Thin to convert the RDM to a VMDK.3
      7. Use the Advanced option in the Storage vMotion wizard
      8. Change the disk format for the RDM disk by using the "Thick" or "Thin" option from the Disk Format drop down

        Note: If the destination format is not changed to thick or thin provisioned for an RDM in the advanced section of the migration wizard, only the RDM mapping file will be migrated to the destination datastore.

      9. Select the destination datastore and proceed with the Storage vMotion.
      10. Once the Storage vMotion task is completed, the Virtual RDM disk will be converted to a VMDK disk.

Step 2: Performing a Storage vMotion to move the VMDK to the new datastore

  • After the RDM has been converted to a VMDK, perform another Storage vMotion of the VMDK to the new storage.

Step 3: Converting the VMDK back to an RDM

  • To convert the VMDK disk back into an RDM, perform one of the following commands for either Virtual or Physical compatibility mode.
    • For Virtual compatibility mode
      • Run the following command:

        vmkfstools –i srcfile -d rdm:/vmfs/devices/disks/identifier /vmfs/volumes/datastore/vmdir/vmname.vmdk

        Note: The identifier value represents the value recorded in Step 1: Converting the RDM to a VMDK.



        Example
        vmkfstools -i olddisk.vmdk -d rdm:/vmfs/devices/disks/naa.############################# /vmfs/volumes/TestDatastore/TestVM/rdmdisk.vmdk

    • For Physical compatibility mode
      • Run the following command:

        vmkfstools –i srcfile -d rdmp:/vmfs/devices/disks/identifier /vmfs/volumes/datastore/vmdir/vmname.vmdk 

        Note: The identifier value represents the value recorded in Step 1: Converting the RDM to a VMDK.

        Example
        vmkfstools -i olddisk.vmdk -d rdmp:/vmfs/devices/disks/naa.############################# /vmfs/volumes/TestDatastore/TestVM/rdmdisk.vmdk

Option 2: Clone RDM to New RDM

This process involves directly cloning the data from an existing RDM to a new RDM on the target array using vmkfstools.

Prerequisites

To perform the clone of the RDM to a new RDM on the new storage array, collect the following information

  • Descriptor file of the source RDM

    Example
    /vmfs/volumes/olddatastore/vmname/vmname.vmdk

  • Identifier of the target LUN

    Example
    /vmfs/devices/disks/naa.#############################
  • Target descriptor file path (the identifier of the LUN that will be used to write the RDM data to; this must be as large or larger then the LUN on the original array.)

    Example
    /vmfs/volumes/newdatastore/vmname/vmname.vmdk

Clone Commands

Run the appropriate command for either the Virtual or Physical compatibility mode.

  • For Virtual compatibility mode
    • Run the following command:

      vmkfstools –i srcfile -d rdm:/vmfs/devices/disks/identifier /vmfs/volumes/datastore/vmdir/vmname.vmdk

      Example
      vmkfstools -i /vmfs/volumes/olddatastore/vmname/vmname.vmdk -d rdm:/vmfs/devices/disks/naa.############################# /vmfs/volumes/newdatastore/vmname/vmname.vmdk

  • For Physical compatibility mode
    • Run the following command:

      vmkfstools –i srcfile -d rdmp:/vmfs/devices/disks/identifier /vmfs/volumes/datastore/vmdir/vmname.vmdk

      Example
      vmkfstools -i /vmfs/volumes/olddatastore/vmname/vmname.vmdk -d rdmp:/vmfs/devices/disks/naa.############################# /vmfs/volumes/newdatastore/vmname/vmname.vmdk

Additional Information