Hello folks,
I know it has been discussed many times already, but I can't seem to create a HA device with the powershell module. I have looked at the script handful of times and I am pretty sure I am missing some detail. Maybe a fresh pair of eyes can see what I'm overlooking. One thing I noticed, the image gets created on the second node, but not the first one. All the attempts end up with error "200 Failed: operation cannot be completed." . And yes, Syncinterface and HBinterface are IP's for the partner nodes.
Import-Module StarWindX
try
{
Enable-SWXLog
$server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = "172.23.99.10"
$firstNode.ImagePath = "My computer\D\Cluster"
$firstNode.ImageName = "Wittness"
$firstNode.Size = 1024
$firstNode.CreateImage = $true
$firstNode.TargetAlias = "Wittness"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p2=10.10.12.13:3260,10.10.12.14:3260"
$firstNode.HBInterface = "#p2=10.10.11.11:3260,10.10.13.11:3260,172.23.99.11:3260"
$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 = 4096
$secondNode = new-Object Node
$secondNode.HostName = "172.23.99.11"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\D\Cluster"
$secondNode.ImageName = "Wittness"
$secondNode.Size = 1024
$secondNode.CreateImage = $true
$secondNode.TargetAlias = "Wittness"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=p2=10.10.12.10:3260,10.10.12.11:3260"
$secondNode.HBInterface = "#p1=10.10.11.10:3260,10.10.13.10:3260,172.23.99.10:3260"
$secondNode.SyncSessionCount = 1
$secondNode.ALUAOptimized = $true
$device = Add-HADevice -server $server -firstNode $firstNode -secondNode $secondNode -initMethod "Clear"
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()
}
The Latest Gartner® Magic Quadrant™Hyperconverged Infrastructure Software