I've been tinkering around with Starwind's vSan solution and it works well. I've setup a 2 Node setup without quorum and it really works and I am very content with it.
To prevent a split-brain situation i would like to use the 2 Node setup with SMB quorum. But i just can't get it to work, The error that i get is: "200 The server is inaccessable."
I am assuming the error is about Starwind not being able to reach the samba share. If i set Failover to '0' and remove all smb related arguments, the virtual disk will be successfully created.
i am not 100% sure if i set the heartbeat interfaces correctly. Could anyone check my code? Any help would be appreciated. Thanks alot!
Tomorrow ill be at work again to get some logs out Starwind, let me know which files to check and ill check and upload it.
Code: Select all
This is how the server layout looks like:
Witness with SMB
Samba @ \\172.16.20.30\witness\
/ \
/ \
/ (vlan 100) \ (vlan 100)
/ \
= Node 1 = = Node 2 =
Mgnt nic (172.16.20.20) <-----vlan 100 ---> Mgnt nic (172.16.20.21)
hb nic (192.168.1.10) <-----direct link----> hb nic (192.168.1.11)
Sync nic (192.168.2.10) <-----direct link----> Sync nic (192.168.2.11)
*direct link is a link without a connection to a switch.
this is the following code that i use(CreateHASmbWitness.ps1):
Code: Select all
param($addr="172.16.20.20", $port=3261, $user="root", $password="starwind",
$addr2="172.16.20.21", $port2=$port, $user2=$user, $password2=$password,
#common
$initMethod="Clear",
$size=1024,
$sectorSize=512,
$failover=1,
$smbWitnessFilePath="\\172.16.20.30\witness\witness.dat",
$smbWitnessUsername="<user>",
$smbWitnessPassword="<secret pass>",
#primary node
$imagePath="\mnt\disk1",
$imageName="masterImg21",
$createImage=$true,
$storageName="",
$targetAlias="targetha21",
$autoSynch=$true,
$poolName="pool1",
$syncSessionCount=1,
$aluaOptimized=$true,
$cacheMode="wb",
$cacheSize=128,
$syncInterface="#p2=192.168.2.11:3260",
$hbInterface="#p2=172.16.20.21:3260,192.168.1.11:3260",
$createTarget=$true,
#secondary node
$imagePath2="\mnt\disk1",
$imageName2="partnerImg22",
$createImage2=$true,
$storageName2="",
$targetAlias2="partnerha22",
$autoSynch2=$true,
$poolName2="pool1",
$syncSessionCount2=1,
$aluaOptimized2=$false,
$cacheMode2=$cacheMode,
$cacheSize2=$cacheSize,
$syncInterface2="#p1=192.168.2.10:3260",
$hbInterface2="#p1=172.16.20.20:3260,192.168.1.10:3260",
$createTarget2=$true
)
Import-Module StarWindX
try
{
Enable-SWXLog -level SW_LOG_LEVEL_DEBUG -path "c:\Starwind.log"
$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.SmbWitnessFilePath = $smbWitnessFilePath
$firstNode.SmbWitnessUsername = $smbWitnessUsername
$firstNode.SmbWitnessPassword = $smbWitnessPassword
#
# 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.SmbWitnessFilePath = $smbWitnessFilePath
$secondNode.SmbWitnessUsername = $smbWitnessUsername
$secondNode.SmbWitnessPassword = $smbWitnessPassword
$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
Write-Host $_.Exception
}
finally
{
$server.Disconnect()
}