Prepare RDMs for ActiveDR Demotion

ActiveDR

Audience
Public
Product
FlashArray
FlashArray > Purity//FA
Content Type
User Guides
Source Type
Documentation

When it comes to RDMs it is a bit more difficult to find what VMs are using RDMs and what volumes are in use as RDMs. The simplest option at scale is to use VMware PowerCLI.

First you need to identify the FlashArray volume that is used an RDM, or in the vSphere Client find the device. Eitherway retrieve the serial number of the volume.

In the FlashArray UI:

1) Go to the volume in the FlashArray

2) Copy the serial number

In the vSphere Client:

1) Go to a host that sees the RDM

2) Select the device

3) Copy the NAA

The next step is to use PowerCLI. If you do not have it installed, install it from the PowerShell Gallery:

1) Launch PowerShell (Core or Desktop)

2) Install VMware.PowerCLI

3) Verify installation

If you pulled the serial number from the FlashArray run the following code (supplying your vCenter address and credentials and the serial number):

connect-viserver -Server <vCenter address>

$serial = <serial number in quotes>

Get-vm | where-object {$_ |Get-HardDisk -DiskType "RawPhysical","RawVirtual" | where-object {$_.ExtensionData.Backing.LunUuid.substring(10).substring(0,32) -eq $serial}}

Example:

If you pulled the NAA from the vSphere Client, run this code:

connect-viserver -Server <vCenter address>

$naa = <NAA in quotes>

Get-vm | where-object {$_ |Get-HardDisk -DiskType "RawPhysical","RawVirtual" | where-object {("naa." + $_.ExtensionData.Backing.LunUuid.substring(10).substring(0,32)) -eq $naa}}

Example:

This will return any VM using that volume as an RDM.

Now go to that VM and either shut it down and unregister or remove the RDM from the VM. You do not need to do both.

Remove the RDM:

1) Edit VM settings

2) Remove the disk from the VM

3) Select Delete Files from Datastore and click OK.

Or...

Shutdown and unregister the VM:

1) Shut the VM down with Shut Down Guest OS

2) Right-click and choose Remove from Inventory

The next step is to detach the volume hosting the datastore. Click on a host, then Configure tab, and Storage Device panel. Select the device hosting the datastore and choose Detach. In newer release of vSphere, this will allow to detach from multiple hosts at once. In older releases you will need to repeat this process for each host that see the datastore.

1) Choose a host then Configure > Storage Devices.

2) Select the device and choose Detach

3) Select all hosts and choose Yes.

Repeat for all RDMs.