In other contexts, such as the VirtualCenter client console, raw device mapping may be
described in terms such as “Mapping a VMFS volume into a datastore,” “Mapping a system LUN”
or “mapping a disk file to a physical disk volume.” These terms all refer to raw device mapping.
The following terms are used in this document or related documentation:
• Raw Disk — A disk volume accessed by a virtual machine as an alternative to a virtual disk
file; it may or may not be accessed via a mapping file.
• Raw Device — Any SCSI device accessed via a mapping file. For ESX Server 2.5, only disk
devices are supported.
• Raw LUN — A logical disk volume located in a SAN.
• LUN — Acronym for a logical unit number.
• Mapping File — A VMFS file containing metadata used to map and manage a raw device.
• Mapping — An abbreviated term for a raw device mapping.
• Mapped Device — A raw device managed by a mapping file.
• Metadata File — A mapping file.
• Compatibility Mode — The virtualization type used for SCSI device access (physical or
• SAN — Acronym for a storage area network.
• VMFS — A high-performance file system used by VMware ESX Server
Benefits of Raw Device Mapping:
User-Friendly Persistent Names
Raw device mapping provides a user-friendly name for a mapped device — the name of its
mapping file. When you use a mapping, you don’t need to refer to the device by its device
name, as required with previous versions of ESX Server. You refer to it by the name of the
mapping file — for example, use:
Dynamic Name Resolution
Raw device mapping stores unique identification information for each mapped device. The
VMFS file system resolves each mapping to its current SCSI device, regardless of changes in the
physical configuration of the server due to adapter hardware changes, path changes, device
relocation, and so forth.
Distributed File Locking
Raw device mapping makes it possible to use VMFS distributed locking for raw SCSI devices.
Distributed locking on a raw device mapping makes it safe to use a shared raw LUN without
losing data when two virtual machines on different servers access the same LUN.
Raw device mapping makes file permissions possible. The permissions of the mapping file are
applied at file open time to protect the mapped volume. Previously, permissions for raw devices
could not be enforced by the file system.
File System Operations
Raw device mapping makes it possible to use file system utilities to work with a mapped
volume, using the mapping file as a proxy. Most operations that are valid for an ordinary file can
be applied to the mapping file, and are redirected to operate on the mapped device.
Raw device mapping makes it possible to keep a redo log for a mapped volume. The redo log
has the name of the mapping file, with .REDO appended. Note that redo logs are not possible
when raw device mapping is used in physical compatibility mode.
Raw device mapping allows you to migrate a virtual machine with VMotion. Previously, this was
only possible for virtual machines that used virtual disk files. When you use raw device mapping,
the mapping file acts as a proxy to allow VirtualCenter to migrate the virtual machine using the
same mechanism that exists for virtual disk files.
Note: You cannot migrate virtual machines with raw, clustered, or non-persistent mode disks
using VMotion. If you have clustered disks, you can store them on separate VMFS volumes from
the virtual machines prior to migrating them using VMotion.
SAN Management Agents
Raw device mapping makes it possible to run some SAN management agents inside a virtual
machine. Similarly, any software that needs to access a device using raw SCSI commands can be
run inside a virtual machine. This kind of software may be referred to as “SCSI target based
Limitations of Raw Device Mapping:
Not Available for Block Devices or RAID Devices
Raw device mapping (in the current implementation) uses a SCSI serial number to identify the
mapped volume. Since block devices and some direct-attach RAID devices do not export serial
numbers, they can’t be used in raw device mappings.
Not Available for Devices Attached to a Shared Adapter
If your SCSI adapter is configured as a shared adapter, you can’t use raw device mapping for any
of its devices. Only adapters dedicated to the VMkernel support raw device mapping.
Available with VMFS-2 Volumes Only
Raw device mapping requires the VMFS-2 format. If you choose not to convert your VMFS
volume from VMFS-1 format to VMFS-2 format, you cannot use raw device mapping.
No Redo Log in Physical Compatibility Mode
If you are using raw device mapping in physical compatibility mode, you can’t use a redo log
with the disk. Physical compatibility mode allows the virtual machine to manage its own
snapshot or mirroring operations. This conflicts with the SCSI virtualization objectives of physical
Virtual Compatibility Mode Versus Physical Compatibility Mode:
Virtual mode for a mapping specifies full virtualization of the mapped device. It appears to the
guest operating system exactly the same as a virtual disk file in a VMFS volume. The real
hardware characteristics are hidden. Virtual mode allows customers using raw disks to realize
the benefits of VMFS such as advanced file locking for data protection and redo logs for
streamlining development processes. Virtual mode is also more portable across storage
hardware, presenting the same behavior as a virtual disk file.
Physical mode for a raw device mapping specifies minimal SCSI virtualization of the mapped
device, allowing the greatest flexibility for SAN management software. In physical mode, the
VMkernel passes all SCSI commands to the device, with one exception: The REPORT LUNs
command is virtualized, so that the VMkernel can isolate the LUN for the owning virtual
machine. Otherwise, all physical characteristics of the underlying hardware are exposed. Physical
mode is useful to run SAN management agents or other SCSI target based software in the virtual
machine. Physical mode also allows virtual to physical clustering for cost-effective high
Raw Device Mapping with Virtual Machine Clusters
VMware recommends the use of raw device mapping with virtual machine clusters that need to
access the same raw LUN for failover scenarios. The setup is similar to a virtual machine cluster
that accesses the same virtual disk file, but a raw device mapping file replaces the virtual disk file.
The VMFS must be configured in shared access mode, to allow more than one virtual machine
to open the mapping file simultaneously.
Managing Raw Device Mappings
vmkfstools The vmkfstools utility can be used in the service console to do many of the same operations available in the management interface. Typical operations applicable to raw device mappings are the commands to create a mapping, to query mapping information such as the name and identification of the mapped device, and to import or export a virtual disk: The form of these commands is shown here:
vmkfstools -r ———————————>Create a Raw Device Mapping
vmkfstools -P———————————->Display VMFS File Block Details
vmkfstools -I———————————–>Clone a disk
vmkfstools -e ———————————–>Renaming a virtual machine disk
vmkfstools -q ———————————–>This option prints the name of the raw disk RDM. The option also prints other identification information, like the disk ID, for the raw disk.