VMware Cloud Community
Ryzz
Enthusiast
Enthusiast

How to add rawPhysical RDM for MS Cluster + RDM VMDK for Second node

Hi All,

After a little help with some PowerCli code here please. Im working on a project where i need to XvMotion <100 Physical Mode RDM VM's to a new vCenter + SAN environment. I have all the luns already documented and mapped out for every VM already, and i have written a script to automate the removal of the rawPhysical RDM LUNS from VM's in a CSV. However im now looking to recreate the RDM configuration on the VM's once they are migrated over.

I know the first node of the cluster gets the NAA.123456 lun mapped as a RDM, and the second node of the cluster maps the VMDK file in the datastore instead of the NAA.123456, however i was wondering if anyone has written a script to do this? The RDM's need to be added to a specific SCSI controller with specific SCSI ID's, which i was planning on putting in a CSV file with the NAA for each lun.

Ive been playing with New-Harddisk cmdlet, however i cant seem to get it to add the RDM lun on the first node during testing.

I was assumuing from a flow point of view, the script would work like this:

1: New-Harddisk adding luns to primary node

2: Use "Get-VM VMGuestName |Get-HardDisk -DiskType rawPhysical" to get the vmdk location of the RDM disks

3: Use Step 2 output to add VMDK's to secondary node.

Just wondering if anyone has gone about this before, and if there is an easier way than what ive mentioned above?

Thanks

Ryan

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

To add the 1st disk you use the DeviceName parameter on the New-Harddisk cmdlet.

That parameter accepts the canonicalname of the LUN.

If you want to assign specific SCSI ids, you will have to use the ReconfigVM API method.

See for example Re: RDM Disk with Multiwriter


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Ryzz
Enthusiast
Enthusiast

Thanks LucD, I'll review it and see how I go.

Cheers!

Reply
0 Kudos