Monday, March 3, 2014

Expanding the size of a Raw Device Mapping (RDM) attached to a VM


Warning: Ensure that there are no snapshots on the disk before attempting this operation. If there are snapshots present, commit them. Otherwise, you may experience data corruption (as described in Extending a RDM with snapshots may cause corruption (1005351). For more information, see Determining if there are leftover delta files that VMware Infrastructure Client cannot detect (1005049).

Note: Snapshots can only be taken with RDMs in Virtual Compatibility Mode. If you do not want to use snapshots, the maximum mapped LUN size in Physical Compatibility mode is 2 TB - 512 bytes in ESX/ESXi 4.x and 64TB in ESX/ESXi 5.x. For more information, see ESX/ESXi 3.x/4.x do not support 2-terabyte LUNs-125339 (3371739) and Calculating the overhead required by snapshot files (1012384).

The procedure to expand the size of the RDM depends on the type:
  • Physical compatibility mode

    Physical compatibility mode RDMs, which are also known as passthru RDMs, expose the physical properties of the mapped LUN to the guest operating system. For the guest operating system to recognize the added space to the expanded mapped LUN, perform a rescan from the ESX host, then from the guest operating system. This process does not require rebooting the virtual machine or the ESX host.

    No changes to the RDM files (.vmdk or metadata pointer) are required to take advantage of the added disk space.

  • Virtual compatibility mode

    To safely expand the RDM:
    1. Stop the virtual machine and remove the RDM from the virtual machine. Before you do this, note the scsiX:Y position of the RDM in VM Settings.
    2. Expand the RDM LUN from the SAN side. Contact your vendor for assistance.
    3. Perform rescan on the ESX and verify the new LUN size is observed.
    4. Recreate the RDM mapping to update the mapped disk size using one of these methods:
      • Utilize Storage vMotion to migrate the Virtual RDM disk's pointer file (vSphere 4.0 and later).
      • Power off the virtual machine, click VM Settings > Add > Hard Disk > RDM, select the scsiX:Y position that the RDM was using before, and then power on the virtual machine.
    5. Perform a rescan from the guest operating system. Consult your vendor for assistance.