VMware Cloud Community
saitoz
Contributor
Contributor
Jump to solution

Replicated LUNs and RDMs

Hello there,

we have 2 nodes and 2 storages in same location. storage 1 is replicated to storage 2. initially on storage 1 we have created 4 LUNs and added them as RDMs to 2 nodes. if first storage goes off or disconnected, we need to add replicated 2 LUNs to 2 nodes from storage 2. if system works on storage 1 then LUN numbers 100 and 101, if on storage 2 then LUN numbers 110 and 111. we need to make this using powerCLI.

Any help would be greatly appreciated.

LUCD, I have read your amazing solutions/answers, would you please help me? Thank you.

0 Kudos
25 Replies
LucD
Leadership
Leadership
Jump to solution

Is there anything in the vpxd logs on the vCenter.

Sometimes you more info about the error in there.


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

0 Kudos
saitoz
Contributor
Contributor
Jump to solution

no way. when I try the following script it gives same error:

$esxName = "esxhostXX"
$luns = Get-VMHost -Name $esxName | Get-ScsiLun -LunType disk
$lun1 = $luns | where {$_.LunID -eq 200}

$DeviceName=$lun1.ConsoleDeviceName
$vm1 = Get-VM -Name "NodeA"
$vm2 = Get-VM -Name "NodeB
$hd1 = New-HardDisk -VM $vm1 -DeviceName $DeviceName -DiskType RawVirtual
$ctrl1 = New-ScsiController -HardDisk  $hd1 -BusSharingMode Virtual -Type VirtualLsiLogicSAS
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.DeviceChange += New-Object VMware.Vim.VirtualDeviceConfigSpec
$spec.deviceChange[0].device += $ctrl1.ExtensionData
$spec.deviceChange[0].device.Key = -101
$spec.deviceChange[0].operation = "add"
$spec.DeviceChange += New-Object VMware.Vim.VirtualDeviceConfigSpec
$spec.deviceChange[1].device += $hd1.ExtensionData
$spec.deviceChange[1].device.Key = -102
$spec.deviceChange[1].device.ControllerKey = -101
$spec.deviceChange[1].operation = "add"
$vm2.ExtensionData.ReconfigVM($spec)

it adds scsi controller and RDM to nodeA but not to NodeB, the error is same:

Incompatible device backing specified for device '1'.

+ $vm2.ExtensionData.ReconfigVM <<<< ($spec)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

0 Kudos
LucD
Leadership
Leadership
Jump to solution

With "no way" you mean there is nothing in the vpxd logs on the vCenter ?


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

0 Kudos
saitoz
Contributor
Contributor
Jump to solution

I undertood the problem. there are 5 vmhosts in cluster. NodeA was working vmhost2 and NodeB was working on vmhost3.

so, if I migrate nodeB to vmhost2, I dont ger error.

or if I change -BusSharingMode "Virtual" to "Physical" then again I dont get the error. Smiley Happy

it's about if you focus on an error more than enough you may lose some easy things Smiley Happy

Thank you very much. I really appreciate.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Indeed, for cross-Esxi sharing you need physical.

Glad you found the solution


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

saitoz
Contributor
Contributor
Jump to solution

I couldn't do without your help. thank you very much.

0 Kudos