Hello,
I am trying to setup two node HA using Starwind vSAN free with CVM deployment but currently facing issue.
Here is my setup:
Two Physical Windows Servers with 2x1SSDs (RAID 1) and 4x8HDDs (RAID 10).
Both Servers are connected to each other using two ethernet cables.
1 - External switch iSCSI (172.16.10.1/24) Host01 is 10.1 and Host02 is 10.2
2 - External switch Sync (172.16.20.1/24) Host01 is 20.1 and Host02 is 20.2
The servers are also connected to a managed switch for Management IP on 172.31.0.1/24 network
Host01 is 172.31.0.110
Host02 is 172.31.0.126
Note : I can ping all the provided IPs from both hosts.
I have imported CVM provided by Starwind to both the hosts and completed the initial setup. I added the RAID10 storage from both hosts as a HardDrive to both VMs. I than created Storage Pools and Volumes, but now I want to create a LUN which I cannot do it from webGUI because I am using free version.
I installed Starwind Management Console on both Hosts and I am trying to run the following Powershell Script, however I keep getting an error.
```
param($addr="172.31.0.110", $port=3261, $user="root", $password="starwind",
$addr2="172.31.0.126", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="NotSynchronize",
$size=13631488,
$sectorSize=4096,
$failover=1,
$bmpType=1,
$bmpStrategy=0,
#primary node
$imagePath="/mnt/sdb1/vmStorage",
$imageName="device1",
$createImage=$true,
$storageName="",
$targetAlias="target1",
$poolName="",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="none",
$cacheSize=0,
$syncInterface="#p2=172.16.20.2:3260",
$hbInterface="#p2=172.16.10.2:3260",
$createTarget=$true,
$bmpFolderPath="",
#secondary node
$imagePath2="/mnt/sdb1/vmStorage",
$imageName2="device1",
$createImage2=$true,
$storageName2="",
$targetAlias2="target1",
$poolName2="",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p2=172.16.20.1:3260",
$hbInterface2="#p2=172.16.10.1:3260",
$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.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.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()
}
```
Output:
```
Request to HOST01 ( 172.31.0.110 ) : 3261
-
control ImageFile -CreateImage:"/mnt/sdb1/vmStorage\device1.img" -Size:"13631488" -Flat:"True" -DeferredInit:"True" -Password:"starwind"
-
200 Failed: operation cannot be completed..
```
Can you please help me how can I fix this? Whatever I am doing is correct setup or not?
I ultimately want to run a Failover Cluster with 2 Node HA, so if Host01 goes down VMs should still run on Host02 because the data is mirrors between the hosts.
Appreciate your help.
Thank You
The Latest Gartner® Magic Quadrant™Hyperconverged Infrastructure Software