Reply to Message

View discussion in a popup

Replying to:
CODETL19
Enthusiast
Enthusiast

Adding RDM Disks to first VM New-HardDisk Incompatible device backing specified for device '0'

Hi,

When using the New-HardDisk cmdlet in an attempt to map an RDM disk to a VM, it fails with the below error:

- "Incompatible device backing specified for device '0'."

I have mapped a disk from an external IBM storage unit to he ESXI hosts. The disk shows on the ESXI hosts in the cluster.

Here is an example of my script:

[hashtable]$unassignedDisks = @{
    1Disk = "naa.600507681081001BA8000000000006FC";
    2Disk = "naa.600507681081001BA8000000000006F8";
    3Disk = "naa.600507681081001BA8000000000006F9";
    4Disk = "naa.600507681081001BA8000000000006FA";
    5Disk = "naa.600507681081001BA8000000000006FB"
}

$vm = Get-VM "VM1"

        $SCSIControllers = Get-ScsiController -VM $vm

        $SCSIController1 = $SCSIControllers | Where-Object {$_.ExtensionData.BusNumber -eq 1}

        $SCSIController2 = $SCSIControllers | Where-Object {$_.ExtensionData.BusNumber -eq 2}

        $SCSIController3 = $SCSIControllers | Where-Object {$_.ExtensionData.BusNumber -eq 3}

        Write-Host "Creating Disk and SCSI Controller 1"

New-HardDisk -VM $vm -DeviceName "/vmfs/devices/disks/$($UnassignedDisks.1disk)" -Datastore "MY_DATASTORE" -DiskType RawPhysical -Controller $SCSIController1

 

Not quite sure where I am going wrong here, all the parameters look to be correctly set, yet it always fails with the error listed above.

I have seen that this may be a bug with PowerCLI, is it still the case now?. Those posts were years old.
I also saw a reference to a lucd fix by using the add-hd function, but it still returns the same error regarding the incompatible device backing.

Here is my attempt to use add-hd

add-HD -VMName $vm -DSname "MY_DATASTORE" -Filename "/vmfs/devices/disks/$($UnassignedDisks.1disk)" -SCSIcntrl $SCSIController1
 

I would greatly appreciate some guidance here. Thanks!