Starwind vSAN Free vSphere ESXI Synchronizing stuck at 0%

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

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

vsan
Posts: 6
Joined: Mon Mar 06, 2023 3:28 pm

Mon Mar 06, 2023 3:57 pm

I was able to deploy the trial version and everything worked using gui and no cache.
Now trying to deploy free version with PowerShell and the CreateHA_2.ps1 script.

I have found that if $cacheMode="none" (or anything other than "wb") then sync fails and keeps printing "Synchronizing: 0%"
Management console > Node1 > Events shows:
Error Code: (25)
initial synchronization failed

If I set it back to $cacheMode="wb" (like the CreateHA_2.ps1 example shows) then everything works as expected.

Node1:
192.168.20.22 - mgmt
192.168.6.22 - iscsi
192.168.40.22 - sync

Node2:
192.168.20.23 - mgmt
192.168.6.23 - iscsi
192.168.40.23 - sync

Code: Select all

param($addr="192.168.20.22", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.20.23", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=4096,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="\mnt\vsan01-01",
	$imageName="iscsi-vsan01-vmw-01",
	$createImage=$true,
	$storageName="",
	$targetAlias="iscsi-vsan01-vmw-01",
	$autoSynch=$true,
	$poolName="",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=128,
	$syncInterface="#p2=192.168.40.23:3260" -f $addr2,
	$hbInterface="#p2=192.168.6.23:3260,192.168.20.23:3260" -f $addr2,
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="\mnt\vsan02-01",
	$imageName2="iscsi-vsan02-vmw-01",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="iscsi-vsan02-vmw-01",
	$autoSynch2=$true,
	$poolName2="",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=192.168.40.22:3260" -f $addr,
	$hbInterface2="#p1=192.168.6.22:3260,192.168.20.22:3260" -f $addr,
	$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()
}
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Mon Mar 06, 2023 10:31 pm

Just comment the cache fields out.
vsan
Posts: 6
Joined: Mon Mar 06, 2023 3:28 pm

Tue Mar 07, 2023 12:13 am

yaroslav (staff) wrote:Just comment the cache fields out.
Yaroslav, you are always so quick to reply and helpful. Thank you.
Simply commenting out "cacheMode" and "cacheSize" works.
vsan
Posts: 6
Joined: Mon Mar 06, 2023 3:28 pm

Tue Mar 07, 2023 12:38 am

yaroslav (staff) wrote:Just comment the cache fields out.
One other question -
I have 2x Truenas arrays (all 7.2krpm spinners in mirrors/raid10) each providing 1x 4TB thick iSCSI LUN to the VMware cluster.
Each Starwind vSAN node has 1x 16gb boot drive and 1x of the 4TB LUNs attached via RDM - no other disks or cache disks.
I plan to make a single 4TB HA image to share back to the VMware cluster.
I see the recommendation of "The size of L1 cache should be equal to the amount of the average working data set." https://knowledgebase.starwindsoftware. ... rinciples/

Is enabling write-back cache recommended? Is there a general recommendation for cache size? As this is just for lab right now, usage and workload change every day.

A note -
When I RDM a 4TB thick LUN from Synology to one of the vSAN nodes and try to format as XFS from the IP:9090 interface, it seems to "Overwrite existing data with zeroes" even when "Don't overwrite existing data" is selected - it takes many hours to format and I can see it writing ~1k-1.5k IOPS from the Synology UI. While there is no network traffic observed during this time, both Synology and VMware hosts support VAAI.
This activity is not observed when using RDM 4TB thick LUN from Truenas or when using 4TB vmware thick or thin provisioned disks (vmdk).
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Tue Mar 07, 2023 4:29 am

Greetings,

Glad it worked!

Write-back cache is associated with additional complexities. True, enabling it gives more performance, yet, it requires RAID card BBU and UPS to run smoothly. Furthermore, when terminated the full synchronization is inevitable (see more at https://knowledgebase.starwindsoftware. ... may-start/). See more about caching https://knowledgebase.starwindsoftware. ... rinciples/.
The general recommendation will be "make it neither too big nor too small". Typically, 1 GB per 1 TB is alright (make sure to adjust VM RAM accordingly: 8 GB + cache size). But, I normally try keeping it below 8 GB.

StarWind VSAN, in the current build, does not support VAAI CAW. Yet, I rarely see VAAI CAW commands to be the problem in VSAN's daily operation.
When I RDM a 4TB thick LUN from Synology to one of the vSAN nodes and try to format as XFS from the IP:9090 interface, it seems to "Overwrite existing data with zeroes" even when "Don't overwrite existing data" is selected - it takes many hours to format and I can see it writing ~1k-1.5k IOPS from the Synology UI. While there is no network traffic observed during this time, both Synology and VMware hosts support VAAI.
So, is this RDM connected to Synology? Try with thick provision eager zeroed drive, please.
This activity is not observed when using RDM 4TB thick LUN from Truenas or when using 4TB vmware thick or thin provisioned disks (vmdk).
If the storage array is the only thing that changes, I believe, there might be some odds on the storage side.
vsan
Posts: 6
Joined: Mon Mar 06, 2023 3:28 pm

Tue Mar 07, 2023 4:57 am

yaroslav (staff) wrote:Greetings,

Glad it worked!

Write-back cache is associated with additional complexities. True, enabling it gives more performance, yet, it requires RAID card BBU and UPS to run smoothly. Furthermore, when terminated the full synchronization is inevitable (see more at https://knowledgebase.starwindsoftware. ... may-start/). See more about caching https://knowledgebase.starwindsoftware. ... rinciples/.
The general recommendation will be "make it neither too big nor too small". Typically, 1 GB per 1 TB is alright (make sure to adjust VM RAM accordingly: 8 GB + cache size). But, I normally try keeping it below 8 GB.

StarWind VSAN, in the current build, does not support VAAI CAW. Yet, I rarely see VAAI CAW commands to be the problem in VSAN's daily operation.
When I RDM a 4TB thick LUN from Synology to one of the vSAN nodes and try to format as XFS from the IP:9090 interface, it seems to "Overwrite existing data with zeroes" even when "Don't overwrite existing data" is selected - it takes many hours to format and I can see it writing ~1k-1.5k IOPS from the Synology UI. While there is no network traffic observed during this time, both Synology and VMware hosts support VAAI.
So, is this RDM connected to Synology? Try with thick provision eager zeroed drive, please.
This activity is not observed when using RDM 4TB thick LUN from Truenas or when using 4TB vmware thick or thin provisioned disks (vmdk).
If the storage array is the only thing that changes, I believe, there might be some odds on the storage side.

Thanks yaroslav!
Now that I am looking closer, it seems that commenting out the lines allows the sync to finish, but even with "cacheMode" and "cacheSize" commented out on both nodes, I end up with imagefile1 with write-back enabled and 128mb cacheSize.

Code: Select all

param($addr="192.168.20.22", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.20.23", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
    	$size=1024,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="\mnt\vsan01-01",
	$imageName="iscsi-vsan01-vmw-01",
	$createImage=$true,
	$storageName="",
	$targetAlias="iscsi-vsan01-vmw-01",
	$autoSynch=$true,
	$poolName="",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	#$cacheMode="wb",
	#$cacheSize="128",
	$syncInterface="#p2=192.168.40.23:3260" -f $addr2,
	$hbInterface="#p2=192.168.6.23:3260,192.168.20.23:3260" -f $addr2,
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="\mnt\vsan02-01",
	$imageName2="iscsi-vsan02-vmw-01",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="iscsi-vsan02-vmw-01",
	$autoSynch2=$true,
	$poolName2="",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	#$cacheMode2=$cacheMode,
	#$cacheSize2=$cacheSize,
	$syncInterface2="#p1=192.168.40.22:3260" -f $addr,
	$hbInterface2="#p1=192.168.6.22:3260,192.168.20.22:3260" -f $addr,
	$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()
}
After running the script above, I check Starwind Management Console, I see 1GB imagefile1 with Mode=Write-Back and Size=128 MB
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Tue Mar 07, 2023 8:21 am

Happy it works now. Please note that small amount of Write Back cache will not improve performance, yet, brings the risk of full syn closer. Consider trying running systems with no cache.
vsan
Posts: 6
Joined: Mon Mar 06, 2023 3:28 pm

Tue Mar 07, 2023 6:53 pm

yaroslav (staff) wrote:Happy it works now. Please note that small amount of Write Back cache will not improve performance, yet, brings the risk of full syn closer. Consider trying running systems with no cache.
Thanks yaroslav, but you see in my most recent post, I found that commenting out the cache fields "worked" as in let the sync finish, but I still ended up with write-back enabled with cacheMode and cacheSize commented out.
I ran many tests last night and confirmed this is the case every time:
cacheMode=wb works every time
cacheMode=none never works
#cacheMode = completes build and sync processes but I still get image file with write-back enabled.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Wed Mar 08, 2023 11:58 am

cacheMode=none never works
I tried it in my lab and it actually worked. HA with no cache is created.
#cacheMode = completes build and sync processes but I still get image file with write-back enabled.
It also works (device with no cache is created). See my script below

Code: Select all

param($addr="192.168.13.193", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.13.194", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=12,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="My computer\C\",
	$imageName="masterImg23",
	$createImage=$true,
	$storageName="",
	$targetAlias="targetha23",
	$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:3260",
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="My computer\C\",
	$imageName2="partnerImg24",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="partnerha24",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.16.10.10:3260" -f $addr,
	$hbInterface2="#p1=172.16.20.10:3260",
	$createTarget2=$true,
	$bmpFolderPath2=""
	)
vsan
Posts: 6
Joined: Mon Mar 06, 2023 3:28 pm

Wed Mar 08, 2023 9:42 pm

yaroslav (staff) wrote:
cacheMode=none never works
I tried it in my lab and it actually worked. HA with no cache is created.
#cacheMode = completes build and sync processes but I still get image file with write-back enabled.
It also works (device with no cache is created). See my script below

Code: Select all

param($addr="192.168.13.193", $port=3261, $user="root", $password="starwind",
	$addr2="192.168.13.194", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=12,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="My computer\C\",
	$imageName="masterImg23",
	$createImage=$true,
	$storageName="",
	$targetAlias="targetha23",
	$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:3260",
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="My computer\C\",
	$imageName2="partnerImg24",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="partnerha24",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.16.10.10:3260" -f $addr,
	$hbInterface2="#p1=172.16.20.10:3260",
	$createTarget2=$true,
	$bmpFolderPath2=""
	)

I just copy/pasted yours, changed the IP addresses and imagePath, and ran it many times against fresh installs each time. Same results - commenting it out does not work, setting it to "none" does not work, setting it to "wb" works every time.

I am running this against the Linux ovf on vSphere, not Windows. I wonder if that is the difference?

Code: Select all

param($addr="192.168.20.22", $port=3261, $user="root", $password="starwind",
   $addr2="192.168.20.23", $port2=$port, $user2=$user, $password2=$password,
#common
   $initMethod="Clear",
   $size=12,
   $sectorSize=512,
   $failover=0,
   $bmpType=1,
   $bmpStrategy=0,
#primary node
   $imagePath="\mnt\vsan01-01",
   $imageName="masterImg23",
   $createImage=$true,
   $storageName="",
   $targetAlias="targetha23",
   $autoSynch=$true,
   $poolName="pool1",
   $syncSessionCount=1,
   $aluaOptimized=$true,
   #$cacheMode="wb",
   $cacheSize=128,
   $syncInterface="#p2=192.168.40.23:3260" -f $addr2,
   $hbInterface="#p2=192.168.6.23:3260",
   $createTarget=$true,
   $bmpFolderPath="",
#secondary node
   $imagePath2="\mnt\vsan02-01",
   $imageName2="partnerImg24",
   $createImage2=$true,
   $storageName2="",
   $targetAlias2="partnerha24",
   $autoSynch2=$true,
   $poolName2="pool1",
   $syncSessionCount2=1,
   $aluaOptimized2=$false,
   $cacheMode2=$cacheMode,
   $cacheSize2=$cacheSize,
   $syncInterface2="#p1=192.168.40.22:3260" -f $addr,
   $hbInterface2="#p1=192.168.6.22: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()
}
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Thu Mar 09, 2023 10:08 am

Hi,

That should not be an issue, yet I will run additional tests.
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Fri Mar 10, 2023 4:06 pm

I re-ran the test in my lab.

Code: Select all

#$cacheMode="wb",
$cacheSize=128,
creates a device with no cache

Code: Select all

$cacheMode="none",
$cacheSize=128,
creates device with no cache

Code: Select all

$cacheMode="wt",
$cacheSize=128,
creates device with Write-Through cache

To sum up, everything worked as expected. Can you log a call with support@starwind.com using 881928 and this thread as a reference?
Pavel B.
Posts: 2
Joined: Wed Apr 26, 2023 8:57 am

Wed Apr 26, 2023 9:06 am

Hello,

We have the same problem too.

When $cacheMode="wb" and $cacheSize=128 synchronizing is OK
When $cacheMode="none" and $cacheSize=0 synchronizing is Fail.

Code: Select all

param($addr="10.64.205.125", $port=3261, $user="root", $password="starwind",
	$addr2="10.64.205.135", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=12,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\stor",
	$imageName="masterImg21",
	$createImage=$true,
	$storageName="",
	$targetAlias="targetha21",
	$autoSynch=$true,
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="wb",
	$cacheSize=128,
	$syncInterface=$("#p2=10.64.205.136:3260" -f $addr2),
	$hbInterface=$("#p2=10.64.205.137:3260" -f $addr2),
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\stor",
	$imageName2="partnerImg22",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="partnerha22",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2=$("#p1=10.64.205.126:3260" -f $addr),
	$hbInterface2=$("#p1=10.64.205.127:3260" -f $addr),
	$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()
}
$cacheMode=wb.png
$cacheMode=wb.png (233.98 KiB) Viewed 2885 times

Code: Select all

param($addr="10.64.205.125", $port=3261, $user="root", $password="starwind",
	$addr2="10.64.205.135", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="Clear",
	$size=12,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="VSA Storage\mnt\stor",
	$imageName="masterImg21",
	$createImage=$true,
	$storageName="",
	$targetAlias="targetha21",
	$autoSynch=$true,
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface=$("#p2=10.64.205.136:3260" -f $addr2),
	$hbInterface=$("#p2=10.64.205.137:3260" -f $addr2),
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="VSA Storage\mnt\stor",
	$imageName2="partnerImg22",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="partnerha22",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2=$("#p1=10.64.205.126:3260" -f $addr),
	$hbInterface2=$("#p1=10.64.205.127:3260" -f $addr),
	$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()
}
$cacheMode=none.png
$cacheMode=none.png (236.24 KiB) Viewed 2885 times
Thank you!

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

Wed Apr 26, 2023 9:34 am

$initMethod="Clear", set to "SyncFromFirst"
Please see this thread for more details. https://forums.starwindsoftware.com/vie ... 3&start=15
Pavel B.
Posts: 2
Joined: Wed Apr 26, 2023 8:57 am

Wed Apr 26, 2023 9:57 am

Hello, Yaroslav!

Thank very much, you tip helped!

Regards,
Pavel
Post Reply