Hi,
I am looking for support, I have been trying to setup 2 node Starwind vSan using the Free license via Powershell but seems to be running into multiple errors. I have tried to follow the guide provided but seems to be getting multiple errors. i.e.
Target name and Alias are empty
Error 200 Invalid Partner node info
I would really appreciate if anyone can help me with this. I have provided my amended script below:-
param($addr="192.168.80.55", $port=3261, $user="root", $password="starwind",
$addr2="192.168.80.56", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1200,
$sectorSize=512,
$failover=0,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="My computer\D\starwind",
$imageName="masterImg21",
$createImage=$true,
$storageName="",
$targetAlias="targetha21",
$autoSynch=$true,
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="wb",
$cacheSize=128,
$syncInterface="#p2=172.16.10.20:3260" -f $addr2,
$hbInterface="#p2=172.16.20.20,192.168.80.56:3260" -f $addr2,
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="My computer\D\starwind",
$imageName2="partnerImg22",
$createImage2= $true,
$storageName2="",
$targetAlias2="partnerha22",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$true,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=172.16.10.10:3260" -f $addr,
$hbInterface2="#p1=172.16.20.10:3260,192.168.80.55:3260" -f $addr2,
$createTarget2=$true,
$bmpFolderPath2=""
)
Import-Module StarWindX
try
{
Enable-SWXLog -level SW_LOG_LEVEL_DEBUG
$server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind
$server.Connect()
$firstNode = new-Object Node
$firstNode.HostName = "localhost"
$firstNode.HostPort = "3261"
$firstNode.Login = "root"
$firstNode.Password = "starwind"
$firstNode.ImagePath = "My computer\D\starwind"
$firstNode.ImageName = "masterImg21"
$firstNode.Size = 2048
$firstNode.CreateImage = $true
$firstNode.StorageName = ""
$firstNode.TargetAlias = "targetha21"
$firstNode.AutoSynch = $true
$firstNode.SyncInterface = "#p1=172.16.10.10:3260" -f $addr
$firstNode.HBInterface = "#p2=172.16.20.20,192.168.80.56:3260" -f $addr2
$firstNode.PoolName = "pool1"
$firstNode.SyncSessionCount = 1
$firstNode.ALUAOptimized = $true
$firstNode.CacheMode = "wb"
$firstNode.CacheSize = "128"
$firstNode.FailoverStrategy = $failover
$firstNode.CreateTarget = $true
$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 = 4096
$secondNode = new-Object Node
$secondNode.HostName = "172.16.10.20"
$secondNode.HostPort = "3261"
$secondNode.Login = "root"
$secondNode.Password = "starwind"
$secondNode.ImagePath = "My computer\D\starwind"
$secondNode.ImageName = "partnerImg22"
$secondNode.CreateImage = "$true
$secondNode.StorageName = ""
$secondNode.TargetAlias = "Partnerha22"
$secondNode.AutoSynch = $true
$secondNode.SyncInterface = "#p1=172.16.10.10:3260",
$secondNode.HBInterface = "#p1=172.16.20.10:3260,192.168.80.55:3260" -f $addr2
$secondNode.SyncSessionCount = 1
$secondNode.ALUAOptimized = $true
$secondNode.CacheMode = "none"
$secondNode.CacheSize = ""
$secondNode.FailoverStrategy = $failover
$secondNode.CreateTarget = $true
$secondNode.BitmapFolderPath = $bmpFolderPath2
$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