Good morning,
I' have corrected and remove all unnecessary in the file. Over parameters I have restore original script from Sample dir (see below).
But invalid channel format [2] persist.
node 1: $imagePath="/mnt/sdb1/vm-volume0" - sdb1 is correct on this node (app vsan on VM Proxmox) "[b" on the script are my refused but not in the script executed
node 2: $imagePath2="/mnt/vdb1/vm-volume0" - vdb1 is correct on this node (app vsan over VM HPE VM Essentials) "[b" on the script are my refused but not in the script executed
all ping test are OK, the nodes are linked and its see viceversa on the VM (and i use the guide without problem) now I need to create LUN and iSCSI - data link and sync link directly connected no switch.
$initMethod="NotSynchronize" - now.
Code: Select all
param(
$addr="172.22.22.37", $port=3261, $user="root", $password="starwind",
$addr2="172.22.22.38", $port2=3261, $user2=$user, $password2=$password,
#common
$initMethod="NotSynchronize",
$size=500720,
$sectorSize=512,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
$maxUnmap=128,
#primary node
$imagePath="/mnt/sdb1/vm-volume0",
$imageName="havolume01",
$createImage=$true,
$storageName="",
$targetAlias="starwind-vsan01",
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=0,
$syncInterface="172.31.31.38:3260", # IP Partner Sincronizzazione (Nodo 2)
$hbInterface="172.21.21.38:3260,172.31.31.38:3260", # IP Partner Dati/Heartbeat (Nodo 2) con porta
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="/mnt/vdb1/vm-volume0",
$imageName2="havolume01",
$createImage2=$true,
$storageName2="",
$targetAlias2="starwind-vsan01",
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="172.31.31.37:3260", # IP Partner Sincronizzazione (Nodo 1)
$hbInterface2="172.21.21.37, 172.31.31.37:3260", # IP Partner Dati/Heartbeat (Nodo 1) con porta
$createTarget2=$true,
$bmpFolderPath2=""
)
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer -host $addr -port $port -user $user -password $password
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = $addr
$firstNode.HostPort = $port
$firstNode.Login = $user
$firstNode.Password = $password
$firstNode.ImagePath = $imagePath
$firstNode.ImageName = $imageName
$firstNode.Size = $size
$firstNode.CreateImage = $createImage
$firstNode.StorageName = $storageName
$firstNode.TargetAlias = $targetAlias
$firstNode.SyncInterface = $syncInterface
$firstNode.HBInterface = $hbInterface
$firstNode.PoolName = $poolName
$firstNode.SyncSessionCount = $syncSessionCount
$firstNode.ALUAOptimized = $aluaOptimized
$firstNode.CacheMode = $cacheMode
$firstNode.CacheSize = $cacheSize
$firstNode.FailoverStrategy = $failover
$firstNode.CreateTarget = $createTarget
$firstNode.BitmapStoreType = $bmpType
$firstNode.BitmapStrategy = $bmpStrategy
$firstNode.BitmapFolderPath = $bmpFolderPath
$firstNode.MaxUnmap = $maxUnmap
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = $sectorSize
$secondNode = new-Object Node
$secondNode.HostName = $addr2
$secondNode.HostPort = $port2
$secondNode.Login = $user2
$secondNode.Password = $password2
$secondNode.ImagePath = $imagePath2
$secondNode.ImageName = $imageName2
$secondNode.CreateImage = $createImage2
$secondNode.StorageName = $storageName2
$secondNode.TargetAlias = $targetAlias2
$secondNode.SyncInterface = $syncInterface2
$secondNode.HBInterface = $hbInterface2
$secondNode.SyncSessionCount = $syncSessionCount2
$secondNode.ALUAOptimized = $aluaOptimized2
$secondNode.CacheMode = $cacheMode2
$secondNode.CacheSize = $cacheSize2
$secondNode.FailoverStrategy = $failover
$secondNode.CreateTarget = $createTarget2
$secondNode.BitmapFolderPath = $bmpFolderPath2
$secondNode.MaxUnmap = $maxUnmap
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
if(!$device) { return }
while ($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
{
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
Start-Sleep -m 2000
$device.Refresh()
}
}
catch
{
Write-Host $_ -foreground red
}
finally
{
$server.Disconnect()
}