Help for error invalid channel format [2]
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="Clear",
$size=500720,
$sectorSize=512,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
[Uint32][ValidateRange(0, 4294967294)]
$maxUnmap=128,
#primary node
$imagePath="/mnt/[b]sdb1[/b]/vm-volume0", #IT'S RIGHT! see secondary node
$imageName="HAVolume01",
[bool][ValidateSet($false, $true)]
$createImage=$true,
$storageName="",
$targetAlias="target-vsan01",
$poolName="",
$syncSessionCount=1,
[bool][ValidateSet($false, $true)]
$aluaOptimized=$true,
$cacheMode="wt",
$cacheSize=1024,
$syncInterface="172.31.31.38:3260", # IP Partner Sincronizzazione (Nodo 2)
$hbInterface="172.21.21.38", # IP Partner Dati/Heartbeat (Nodo 2)
[bool][ValidateSet($false, $true)]
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="/mnt/[b]vdb1[/b]/vm-volume0", #IT'S RIGHT! see primary node
$imageName2="HAVolume01",
[bool][ValidateSet($false, $true)]
$createImage2=$true,
$storageName2="",
$targetAlias2="target-vsan01",
$poolName2="",
$syncSessionCount2=1,
[bool][ValidateSet($false, $true)]
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="172.31.31.37:3260", # IP Partner Sincronizzazione (Nodo 1)
$hbInterface2="172.21.21.37", # IP Partner Dati/Heartbeat (Nodo 1)
[bool][ValidateSet($false, $true)]
$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
$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
Write-Host "Creazione del dispositivo HA in corso..." -ForegroundColor Cyan
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
if(!$device) { return }
# Controllo basato sulla proprieta stringa di StarWind Linux (1 = Sincronizzato)
while ($device.GetPropertyValue("ha_synch_status") -ne "1")
{
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
Start-Sleep -Seconds 5
$device.Refresh()
}
Write-Host "Sincronizzazione completata con successo!" -ForegroundColor Green
}
catch
{
Write-Host $_ -foreground red
}
finally
{
if ($server -and $server.Connected)
{
$server.Disconnect()
}
}
What's wrong?