Now trying to deploy free version with PowerShell and the CreateHA_2.ps1 script.
I have found that if $cacheMode="none" (or anything other than "wb") then sync fails and keeps printing "Synchronizing: 0%"
Management console > Node1 > Events shows:
Error Code: (25)
initial synchronization failed
If I set it back to $cacheMode="wb" (like the CreateHA_2.ps1 example shows) then everything works as expected.
Node1:
192.168.20.22 - mgmt
192.168.6.22 - iscsi
192.168.40.22 - sync
Node2:
192.168.20.23 - mgmt
192.168.6.23 - iscsi
192.168.40.23 - sync
Code: Select all
param($addr="192.168.20.22", $port=3261, $user="root", $password="starwind",
$addr2="192.168.20.23", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=4096,
$sectorSize=512,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="\mnt\vsan01-01",
$imageName="iscsi-vsan01-vmw-01",
$createImage=$true,
$storageName="",
$targetAlias="iscsi-vsan01-vmw-01",
$autoSynch=$true,
$poolName="",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=128,
$syncInterface="#p2=192.168.40.23:3260" -f $addr2,
$hbInterface="#p2=192.168.6.23:3260,192.168.20.23:3260" -f $addr2,
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="\mnt\vsan02-01",
$imageName2="iscsi-vsan02-vmw-01",
$createImage2=$true,
$storageName2="",
$targetAlias2="iscsi-vsan02-vmw-01",
$autoSynch2=$true,
$poolName2="",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.40.22:3260" -f $addr,
$hbInterface2="#p1=192.168.6.22:3260,192.168.20.22:3260" -f $addr,
$createTarget2=$true,
$bmpFolderPath2=""
)
Import-Module StarWindX
try
{
Enable-SWXLog -level SW_LOG_LEVEL_DEBUG
$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.AutoSynch = $autoSynch
$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
#
# 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.AutoSynch = $autoSynch2
$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
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod $initMethod
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()
}