Hyper-V VSAN Sync 0%

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

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

Post Reply
Jan1987
Posts: 13
Joined: Wed Nov 22, 2023 2:12 pm

Wed Nov 22, 2023 2:19 pm

Hello

I have just installed 2 Hyper-V nodes. I have created and configured the CVM on each node according to the guide.

Connection between them works and also host to CVM works.

I have used the following script:

Code: Select all

param($addr="192.168.10.51", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.10.52", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=1024,
	$sectorSize=512,
	$failover=0,
	#$bmpType=1,
	#$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\disk1",
	$imageName="Quorum",
	$createImage=$true,
	$storageName="",
	$targetAlias="JGRSRVHVC01",
	$autoSynch=$true,
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2=10.10.2.52:3260",
	$hbInterface="#p2=10.10.1.52:3260",
	$createTarget=$true,
	#$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\disk1",
	$imageName2="Quorum",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="JGRSRVHVC01",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=10.10.2.51:3260",
	$hbInterface2="#p1=10.10.1.51: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.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.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.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.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()
}
Powersehll has now been telling me for hours that the synchronization is at 0%. via the management console I see the created targets and HA images with the status "not synced".

I have been trying to get the whole thing to work for a full day now, have recreated the CVM 3 times and both hosts once. Sorry if I seem a bit annoyed but I did everything according to the guide, the fact that the free version has no GUI doesn't make things any better. I actually wanted to use the product for my HomeLAB.

what I have already tried:
comment out bmp entries in the script

greetings
Jan
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Wed Nov 22, 2023 3:19 pm

Try running the script with $initMethod="syncfromfirst" as described here https://forums.starwindsoftware.com/vie ... rst#p35005.
Jan1987
Posts: 13
Joined: Wed Nov 22, 2023 2:12 pm

Wed Nov 22, 2023 9:34 pm

great, thank you very much, it has now worked.

One more question:
is it normal that the syn takes a long time (hours). is it actually just an empty file at the beginning?
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Wed Nov 22, 2023 10:27 pm

Hi,

Thanks for your update! I am glad to read it worked.
It is syncing the zeroes (empty device)
You can cancel synchronization and create 1 GB volume. Once synchronization is over. Please expand it.
Jan1987
Posts: 13
Joined: Wed Nov 22, 2023 2:12 pm

Thu Nov 23, 2023 2:15 pm

Hi,

all right thanks

works very well so far.

I just realized that my 10gbit is too slow for my RAID5.

If I write directly to the RAID I get 2400MB/s read and 1200MB/s write (all flash).

With CVM it is only 960MB/s read and 1000MB/s write. This has nothing to do with the previous problem and I hope that I can still ask questions here:
can i assign additional iSCSI and sync adapters to the VM so that this can improve something? as far as i know the Gen2 VM network adapter has only 10gbit.

greetings
Jan
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Thu Nov 23, 2023 3:44 pm

I think adding more iSCSI sessions can be a key.
By the way, may I wonder how you measure the performance, and whether you measured underlying file system performance?
Please note that we do not recommend any sort of teaming. Maybe, assigning more iSCSI sessions to StarWind HA devices in iSCSI Initiator settings will help.
Jan1987
Posts: 13
Joined: Wed Nov 22, 2023 2:12 pm

Thu Nov 23, 2023 4:46 pm

I have created 2 volumes on the HPE raid controller on the RAID5. one I have attached directly to the CVM as in the guide the other directly on the host and then run Crystaldiskmark.

I did not specify an HA partner for the CVM test.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Thu Nov 23, 2023 9:03 pm

So, you measured the performance of a RAID inside CVM vs. the underlying storage, am I reading it right?
Speaking of the software, I'd suggest using diskspeed or FIO. See more at https://www.starwindsoftware.com/best-p ... practices/
Post Reply