Unable to create 2 node vSAN with SMB quorum

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
Chinny
Posts: 5
Joined: Thu Feb 10, 2022 5:31 pm

Thu Feb 10, 2022 6:09 pm

Hi all,

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()
}

*edited, code wasn't correct.
Last edited by Chinny on Fri Feb 11, 2022 9:05 am, edited 1 time in total.
Chinny
Posts: 5
Joined: Thu Feb 10, 2022 5:31 pm

Fri Feb 11, 2022 9:02 am

When i analyze the logs on the starwind appliance, i see the following:
This is the logs from 172.16.20.20(node1)

Code: Select all

tail -f /var/StarWind/StarWindVSA/logs/StarWindVSA-20220211-094534.log

2/11 9:48:58.467474 2f conf: TelnetListener::listenConnections: Accepted control connection from 172.16.20.24:50300.
2/11 9:48:58.487339 3b FileBrowser: *** CFileBrowser::parsePath: Could not create image : provided path has invalid extension!
2/11 9:48:58.487363 3b Srv: *** iScsiServer::list: Error parsing path: VSA Storage\mnt\
2/11 9:49:00.165534 3b HA: SscPort_ControlRequest: Received request to create SMB witness
2/11 9:49:00.165574 3b HA: SscPort_ControlRequest: SMB file path to create '\\172.16.20.24\witness-test\witness.dat'
2/11 9:49:00.169070 40 HA: *** SmbWitnessImp::connect: WNetAddConnection2A(\\172.16.20.24\witness-test) failed, error code 0x4c6!
2/11 9:49:00.169092 40 HA: *** SmbWitnessImp::synchronousCreate: connect() failed, error code 0x4cd!
2/11 9:49:00.227198 3b conf: ControlConnection::processConnection: Control connection closed.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Fri Feb 11, 2022 9:27 am

Greetings,

Thanks for your question. The SMB witness is not available for StarWind VSAN for vSphere and is to be introduced in builds to come. Stay tuned.
Chinny
Posts: 5
Joined: Thu Feb 10, 2022 5:31 pm

Fri Feb 11, 2022 9:45 am

yaroslav (staff) wrote:Greetings,

Thanks for your question. The SMB witness is not available for StarWind VSAN for vSphere and is to be introduced in builds to come. Stay tuned.
Thanks for your reply, i wish i knew this earlier. Is there a way to get notified when this functionality is implemented for vSphere? Thank you again.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Fri Feb 11, 2022 9:25 pm

Greetings,

Yes, you can check the release notes from time to time OR log a call with Support by reaching out to us at support@starwind.com.
Chinny
Posts: 5
Joined: Thu Feb 10, 2022 5:31 pm

Mon Feb 14, 2022 9:28 am

yaroslav (staff) wrote:Greetings,

Thanks for your question. The SMB witness is not available for StarWind VSAN for vSphere and is to be introduced in builds to come. Stay tuned.
Before i start spending more time on this. How about 'CreateHAPartnerWitness.ps1' does this script work for Starwind vSAN on vSphere? Thank you.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Mon Feb 14, 2022 3:40 pm

Greetings,

SMB witness is not available for VSAN for vSphere for now. Using script does not make it.
SMB witness is only the VSAN for Hyper-V feature for now.
Chinny
Posts: 5
Joined: Thu Feb 10, 2022 5:31 pm

Tue Feb 15, 2022 9:04 am

yaroslav (staff) wrote:Greetings,

SMB witness is not available for VSAN for vSphere for now. Using script does not make it.
SMB witness is only the VSAN for Hyper-V feature for now.
No, thats for 'CreateHASmbWitness.ps1'. This script utilizes the SMB share as a witness server. I know this functionality is not implemented yet and does not work in vSphere.

To be clear, I am asking about using the Starwind appliance as a witness node without any vSAN data. Which would be this script: 'CreateHAPartnerWitness.ps1'. Does this one work under vSphere?
If this script doesn't work as a partner witness under vSphere, then i assume this functionality does not work for the paid version as well under vSphere.
Thank you for your replies.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Tue Feb 15, 2022 12:40 pm

Sorry for such a misunderstanding. Node majority works for VSAN for vSphere.
Post Reply