Creating Raw Device Maps from the command line using the vmkfstools command
search cancel

Creating Raw Device Maps from the command line using the vmkfstools command

book

Article ID: 306534

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to create Raw Device Maps (RDMs) for virtual machines from the ESX/ESXi command line.
 
You may want to use this procedure when:
  • You want to create an RDM for a virtual machine, but you do not have access to the vSphere Client
  • You want to create an RDM for a LUN presented from an Egenera SAN virtualization device
  • The option to create an RDM for a virtual machine is unavailable, even when an eligible storage LUN is presented to the host


Environment

VMware ESXi 3.5.x Installable
VMware ESXi 4.1.x Installable
VMware ESXi 4.0.x Embedded
VMware ESX Server 3.5.x
VMware ESXi 4.1.x Embedded
VMware ESXi 3.5.x Embedded
VMware vSphere ESXi 5.1
VMware ESX 4.1.x
VMware ESXi 4.0.x Installable
VMware ESX 4.0.x
VMware vSphere ESXi 5.0

Resolution

To create an RDM from the command line:
  1. Log in to your host via SSH or from the direct console. For more information, see Enabling root SSH login on an ESX host (8375637) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
     
  2. Determine the VML identifier of the storage LUN that you want to use as an RDM. For more information, see Identifying disks when working with VMware ESX/ESXi (1014953).
     
  3. Create the mapping files using a vmkfstools command similar to:

    # vmkfstools -r /vmfs/devices/disks/vml.0000000000766d686261323a303a30 /vmfs/volumes/SAN_DATA1/Windows2008_VM/Windows2008_VM_RAWDISK1.vmdk

    This command creates a virtual compatibility mode RDM for the storage LUN referenced as vml.0000000000766d686261323a303a30 in the datastore SAN_DATA1 , subdirectory Windows2008_VM , with the virtual disk pointer file Windows2008_VM_RAWDISK1.vmdk. This virtual disk may now be added as an existing disk to the virtual machine.

    Note: If you want to create a physical compatibility mode (passthrough) RDM that does not support snapshots, use a vmkfstools command similar to:

    # vmkfstools -z /vmfs/devices/disks/vml.0000000000766d686261323a303a30 /vmfs/volumes/SAN_DATA1/Windows2008_VM/Windows2008_VM_RAWDISK1.vmdk

    Note: In case if the command fails with the error message when creating the mapping file for virtual RDM "Failed to reopen virtual disk: Failed to lock the file", we need to represent the RDM LUNs from storage side.

    # vmkfstools -r /vmfs/devices/disks/vml.0200200000600508b40008ad580001d00002810000485356333030 /vmfs/volumes/521a7a17-7620a688-6f81-0017a4771024/NZWGNSEV01/NZWGNSEV01_13-rdm.vmdk
    Failed to reopen virtual disk: Failed to lock the file (16392).


Additional Information