VMware Cloud Community
Aiders
VMware Employee
VMware Employee
Jump to solution

Creating an RDM using PowerShell - Help needed

Hello Folks,

I am in the process of creating a script for recovering MSCS Clusters with RDMs and need to be able to script the creation of RDMs. Having searched through the communitiy I have seen some good examples of code that I have used as a refference but I am still having difficulty and was hoping sombody could help me clarify the what is wrong with my code. I think it is almost there and suspect I am just making a silly mistake....

When I run the code I get the error " Incompatible device backing specified for device '0' "

Any input welcome

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you try to add the RDM with PowerCLI cmdlets ?

Something like this

Get-VM RdmTest01 | New-HardDisk -DiskType "rawPhysical" -DeviceName "/vmfs/devices/disks/vmhba3:1:1:0"

For the script you attached, I think you forgot to set the CapacityInKb property.

See for the complete script.


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

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

Did you try to add the RDM with PowerCLI cmdlets ?

Something like this

Get-VM RdmTest01 | New-HardDisk -DiskType "rawPhysical" -DeviceName "/vmfs/devices/disks/vmhba3:1:1:0"

For the script you attached, I think you forgot to set the CapacityInKb property.

See for the complete script.


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

0 Kudos
Aiders
VMware Employee
VMware Employee
Jump to solution

Yes I think you are correct. I continued to persevere (pull my hair out) and ended up adding .CapacityInKb property. In addition, having monited the hostd.log I also added the VMware.Vim.VirtualDeviceConnectInfo object. I haven't yet verified which of these changes resolved the issue.

I have seen the PowerCLI cmdlet, however as far as I can tell is does not give me all the functionality I need. Since the VMs I am working with are MSCS Clusters I want to be very specific about which SCSI Controller I wish to use.

Thanks for the input....

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You're correct concerning the New-Harddisk cmdlet, it apprently doesn't allow to specify the SCSI controller (see also the other thread I pointed to).

Perhaps a hint to the PowerCLI team to add this feature Smiley Wink


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

0 Kudos
Aiders
VMware Employee
VMware Employee
Jump to solution

Appropriate hint has been sent this morning Smiley Happy

0 Kudos
admin
Immortal
Immortal
Jump to solution

Where did you send it? I missed it.

Edit: Scratch that -- I just figured out who you are Smiley Happy

0 Kudos