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

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 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 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.

    Many of the time No changes to the RDM files (.vmdk or metadata pointer) are required to take advantage of the added disk space. But it is advisable to unmap the RDM and Re-Map is to the VM to clear any stale cache. 
     
  • 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


Increasing the size of a disk partition
Determining if there are leftover delta files or snapshots that VMware vSphere or Infrastructure Client cannot detect
Extending a RDM with snapshots can result in corrupted data
Creating a snapshot for an ESXi/ESX virtual machine fails with the error: File is larger than maximum file size supported
扩展裸设备映射 (RDM) 的大小
Raw デバイス マッピング(RDM)のサイズを拡張する
ESX/ESXi 3.x/4.x hosts do not support 2-terabyte LUNs