Using Raw Device Mapping

Though Raw Device Mapping (RDM) disks are added to a VM, we will cover this topic here as we are discussing storage-related topics here. A RDM is a pointer mapping file, which is kept in a VMFS datastore that acts as a proxy for a raw physical storage device. By using RDM, a virtual machine can directly access the raw physical device. Typically, we use RDM disks when we need to access raw disks—for example, configuring an OS cluster inside a guest OS, configuring database clusters, and so on. To add a device as a RDM disk to a VM, let's first get a list of devices available to a host. We do this using a list of SCSI devices available per host using the Get-SCSILun cmdlet:

PS C:\> Get-ScsiLun -VmHost ESXi1.lab.com | Select ...

Get Mastering PowerCLI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.