How to Map an Raw Device Mapping (RDM) to a Pure Storage Volume using PowerCLI
When running operations against an RDM, you may need to know the backing volume. Unfortunately with RDM’s there is no easy way to identify this without doing a manual comparison between vCenter Server & the Array. This post will explain how to map an RDM to a Pure Volume to extract the Name and Serial number of the backing volume.
Pre-Requsites
Install PowerCLI & Pure Storage Module
1Install-Module VMware.PowerCLI
2Install-Module -Name PureStorage.FlashArray.VMware
Get RDM Information
1Connect-VIServer vc.lab.local
2Get-VM VM01|Get-HardDisk|FL
Here we can see this VM has two hard disks, Hard Disk 1 is on VMFS and Hard Disk 2 is my RDM.
Let us now use the PureStorage Module to get the Array Volume Information.
1$arrayendpoint = "sn1-x70-f05-27.puretec.purestorage.com"
2$pureuser = "vasauser"
3$purepass = ConvertTo-SecureString "Osmium76!" -AsPlainText -Force
4$purecred = New-Object System.Management.Automation.PSCredential -ArgumentList ($pureuser, $purepass)
5$array = New-PfaConnection -endpoint $arrayendpoint -credentials $purecred -defaultArray -ignoreCertificateError
6$RDM = Get-VM VM01|Get-HardDisk|Where-Object {$_.Name -like "Hard Disk 2"}
7Get-PfaRdmVol -rdm $RDM -Flasharray $array
We can now see both the volume name and the volume serial number of the array disk backing the vvol.
Conclusion
You can use PureCLI, the GUI or other API’s to pull this information, but this is the easiest method I have found to map an RDM to a Pure Volume.
comments powered by DisqusSee Also
- Using PowerCLI to Deploy the Pure Storage VMware Appliance
- Using Pure1 Meta for Intelligent Datastore Selection and VM Provisioning
- Using PowerCLI to Provision your Pure Storage Infrastructure
- Using the VMware Event Broker Appliance to Automatically Expand a Pure Storage FlashArray Datastore
- Updating the vCenter Server Appliance (VCSA) with PowerCLI - Revisited