Expanding the size of a Raw Device Mapping (RDM)
search cancel

Expanding the size of a Raw Device Mapping (RDM)

book

Article ID: 314350

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides information about expanding a Raw Device Mapping (RDM) that is in use by a virtual machine.


Environment

VMware vSphere ESXi 6.5
VMware vCenter Server 6.5.x
VMware vSphere ESXi 6.7
VMware vCenter Server 6.7.x
VMware vSphere ESXi 7.0.0
VMware vCenter Server 6.0.x
VMware vSphere ESXi 6.0
VMware vCenter Server 7.0.x
VMware vCenter Server 8.0.x

Resolution

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. 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 64TB (from ESXi 5.x). 

Note: RDMs cannot be expanded if any VM SCSI controller has SCSI Bus Sharing set to Physical.
 
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 pass-thru 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.

    • After the physical compatibility mode LUN size is changed, you will find the size of the RDM disk descriptor file does not match the new size of the lun and the VM's settings for disk size still show the old size of the RDM.  The host LUN device and guest OS shows report the new size of the disk correctly after rescanning storage/disks.
      • The size mismatch is a cosmetic issue, but it can be updated by removing and adding the disk back to all the connected VM.
        • NOTE:  An outage will be required for the VMs mapped to the RDM to correct the size of the descriptor file and disk size info in VM settings. 
        • Process to correct descriptor file size and VM settings disk size information:

          • Shut down RDM connected VMs.
          • Document RDM disk settings (multi-writer mode/physical mode type/etc.) along with the RDM SCSI controller settings (SCSI ID)
          • Remove the RDM from all of the connected VMs (DO NOT DELETE THE DISK).
            • Select EDIT SETTINGS
            • Remove the RDM disk.
            • Save the settings change and proceed to next VM to repeat the change until all VMs are updated.
          • After all connected VMs have the disk removed, add the RDM back to the VMs using the original SCSI controller and disk configuration that was documented before the disk was removed.
          • After all the VMs have the disk reconfigured, power on the VMs one by one and verify the following:
            • VM disk info shows correct size.
            • Datastore vmkd descriptor files show matching size of LUN.
               
  • Virtual compatibility mode

    To safely expand the RDM:
    1. Expand the RDM LUN from the SAN side. Contact your vendor for assistance.
    2. Perform rescan on the ESX and verify the new LUN size is observed.
    3. svMotion the RDM pointer files or recreate the RDM mapping with the following steps to update the mapped disk size:
      • Shut down the Virtual machine
      • Note scsiX:Y position of the RDM in VM Settings and then remove the RDM file from the Virtual Machine and delete from disk ( Navigate to VM Settings > Add > Hard Disk > RDM, select the scsiX:Y position that the RDM was using before and then power on the virtual machine)
      • On the array, increase the size of the LUN that the RDM pointed to
      • Re-add the LUN as an RDM to the Virtual Machine
      • Power on the VM and add the RDM with right SCSI info which you have noted earlier 
    4. Perform a re-scan from the guest operating system 
Note: When making a changes to LUNs presented to one or more VMware ESX hosts, you must perform a storage rescan on all hosts which are presented that LUN so that the new size is consistent across all hosts.
Altering the partition table information is done within the guest operating system.
 
 The following tools can increase the size of a Windows partition:
  • diskpart
  • Partition magic
  • Altaris

The following tools can increase the size of a Linux partition:

  • parted
  • gparted

Caution: To avoid data loss, closely follow vendor documentation.

Note: If you are using third party Recovery Point management software (EMC and possibly others), it does not allow the proper presentation or rescan the LUN.

To resolve this issue, temporarily remove the storage from the RP utility and readd it after the rescan.


For more information, see RDM Virtual and Physical Compatibility Modes.

Note:  If you use the Vsphere Web Client, consult  After expanding a LUN, the VMware vSphere Web Client does not display the correct size of an RDM before going ahead with the steps above


Note: For both physical and virtual compatibility mode, you may also have to increase the size of the partition. For more information, see Increasing the size of a disk partition (1004071).

Note: If physical mode RDM did not detect the (expanded) correct size, removing and re-add pointers will help


Additional Information