On ESXi, various types of data, including photos and videos, are stored on virtual servers. Typically, disks used by virtual machines are represented as virtual disk (VMDK) files.
Although backups are in place, there is concern that if ESXi itself fails, extracting data by connecting the physical HDD to another system may not be straightforward. Instead of relying on VMDK files, RDM allows direct mapping of physical HDDs, enabling direct write operations on the disk.
HDD Identifier Confirmation #
Connect to ESXi via SSH and execute the following command to retrieve the HDD identifier:
ls /vmfs/devices/disks/
Example output:
t10.ATA_____ST2000DM0012D1ER164__________________________________Z4A08J89
t10.ATA_____TOSHIBA_THNSNJ128GCSU___________________________64IS100AT7DW
t10.ATA_____WDC_WD30EZRZ2D00GXCB0_________________________WD2DWCL7K4RPLA3U
t10.ATA_____WDC_WD40EZRZ2D00GXCB0_________________________WD2DWCL747VPAHCJ
From this list, identify the HDD to be used. In this case, the third entry, a Western Digital 3TB HDD, is selected.
Creating the Mapping File Storage Location #
Create a directory to store the mapping file. While the location is arbitrary, placing it under the datastore for clarity is recommended.
cd /vmfs/volumes/datastore1
mkdir rdm
Creating the Mapping File #
Use the vmkfstools
command to create a VMDK file that maps the physical HDD to a virtual disk.
vmkfstools -z /vmfs/devices/disks/t10.ATA_____WDC_WD30EZRZ2D00GXCB0_________________________WD2DWCL7K4RPLA3U /vmfs/volumes/datastore1/rdm/WD2DWCL7K4RPLA3U.vmdk
Assigning to a Virtual Machine #
During the creation or modification of a virtual machine, select “Use an existing virtual disk” and specify the previously created VMDK file.
Conclusion #
By mapping a physical HDD using RDM, direct access to the HDD from the virtual machine becomes possible.