Exception Error:
200 Synchronization cannot be started because the nodes are not ready! Try to syn
chronize the nodes manually.
Pending.
When I try this with exactly the same settings as below it works as desired. Here is my Powershell script:
Code: Select all
#Import-Module StarWindX
try
{
$server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.ImagePath = "My computer\E"
$firstNode.ImageName = "CSV1"
$firstNode.Size = 105
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "csv1"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=10.10.3.82:3260"
$firstNode.SyncInterface = "#p2=10.10.4.82:3260"
$firstNode.HBInterface = "#p2=10.10.1.82:3260"
$firstNode.HBInterface = "#p2=10.10.2.82:3260"
$firstNode.CacheSize = 64
$firstNode.CacheMode = "wb"
$firstNode.PoolName = "pool1"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
#
# device sector size. Possible values: 512 or 4096(May be incompatible with some clients!) bytes.
#
$firstNode.SectorSize = 512
#
# 'SerialID' should be between 16 and 31 symbols. If it not specified StarWind Service will generate it.
# Note: Second node always has the same serial ID. You do not need to specify it for second node
#
$firstNode.SerialID = ""
$secondNode = new-Object Node
$secondNode.HostName = "winstor2"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\E"
$secondNode.ImageName = "CSV1"
$secondNode.Size = 105
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "csv1"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=10.10.3.83:3260"
$secondNode.SyncInterface = "#p1=10.10.4.83:3260"
$secondNode.HBInterface = "#p1=10.10.1.83:3260"
$secondNode.HBInterface = "#p1=10.10.2.83:3260"
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
Start-Sleep -m 1000
$syncState = $device.GetPropertyValue("ha_synch_status")
while ($syncState -ne "1")
{
#
# Refresh device info
#
$device.Refresh()
$syncState = $device.GetPropertyValue("ha_synch_status")
$syncPercent = $device.GetPropertyValue("ha_synch_percent")
Start-Sleep -m 3000
Write-Host "Synchronizing: $($syncPercent)%" -foreground yellow
}
}
catch
{
Write-Host "Exception $($_.Exception.Message)" -foreground red
}
$server.Disconnect()