"CreateHA_2.ps1" results in "invalid partner info"

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

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

Post Reply
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Wed Aug 14, 2024 7:47 pm

Hello,

I attempting to deploy a two-node shared storage setup, and am running up against a wall with the PowerShell script, "CreateHA_2.ps1"

Getting some details out of the way:
- StarWind Virtual SAN (VSAN) v8.0.0 (Build 15469), Free license
StarWindX.dll properties:
- Version: 1.0.0.664
- Timestamp: 2024-02-07
- Size: 5,965,928 bytes


Network info:

Node1:
Management: 172.17.6.31
Data: 172.21.200.101
Replication: 172.21.220.1

Node2:
Management: 172.17.6.32
Data: 172.21.200.102
Replication: 172.21.220.2


Full output:

Code: Select all

Request to  172.17.6.31 ( 172.17.6.31 ) : 3261
-
control HAImage -CreateHeader:"Headers\masterImg21\masterImg21_HA.swdsk" -pathDirHeaderBackup:"mnt/sdb1/shared" -file
:"imagefile13" -size:"1024" -Priority:"#p0=0;#p1=1" -nodeType:"#p0=1;#p1=1" -PartnerTargetName:"#p1=iqn.2008-08.com.s
tarwindsoftware:172.17.6.32-partnerha22" -PartnerIP:"#p1=172.21.220.2:sync:3260:1,172.17.6.32:heartbeat:3260:1,172.21
.200.102:heartbeat:3260:1" -IsAutoSynchEnabled:"0" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:
"#p1=0b" -AuthMChapSecret:"#p1=0b" -AuthChapType:"#p1=none" -Offset:"0" -CacheMode:"wb" -CacheSizeMB:"128" -Replicato
r:"#p0=0" -WitnessType:"0" -AluaAccessState:"#p0=0;#p1=0"
-
200 Failed: invalid partner info.. 
Full contents of PowerShell script:

Code: Select all

param($addr="172.17.6.31", $port=3261, $user="root", $password="starwind",
	$addr2="172.17.6.32", $port2=$port, $user2=$user, $password2=$password, 
#common
	$initMethod="SyncFromFirst", # Clear
	$size=1024,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="mnt/sdb1/shared",
	$imageName="masterImg21",
	$createImage=$true,
	$storageName="",
	$targetAlias="targetha21",
	$poolName="", # pool1
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="wb",
	$cacheSize=128,
	$syncInterface="#p2=172.21.220.2:3260", # -f $addr2,
	$hbInterface="#p2=172.21.200.102:3260,172.17.6.32:3260", # -f $addr2,
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="/mnt/sdb1/shared",
	$imageName2="partnerImg22",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="partnerha22",
	$poolName2="",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.21.220.1:3260", # -f $addr,
	$hbInterface2="#p1=172.21.200.101:3260,172.17.6.31: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.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()
}

I've scoured the forums, and tried every suggestion I could find. Am I doing something wrong? Or is there a known issue with the version I am using?

Thanks!

Cheers,
Seamus
yaroslav (staff)
Staff
Posts: 3424
Joined: Mon Nov 18, 2019 11:11 am

Wed Aug 14, 2024 8:09 pm

Check this viewtopic.php?f=5&t=6852&p=37208&hilit=HINT8#p37208
You can just take the script part I posted and type your IPs and paths.
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Wed Aug 14, 2024 8:24 pm

Thank you for the prompt reply!

Unfortunately, I still have the same results:

Code: Select all

Request to  172.17.6.31 ( 172.17.6.31 ) : 3261
-
control HAImage -CreateHeader:"Headers\test2\test2_HA.swdsk" -pathDirHeaderBackup:"/mnt/sdb1/shared" -file:"imagefile
14" -size:"1024" -Priority:"#p0=0;#p1=1" -nodeType:"#p0=1;#p1=1" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoft
ware:172.17.6.32-test2" -PartnerIP:"#p1=172.21.220.2:sync:3260:1,172.17.6.32:heartbeat:3260:1,172.21.200.102:heartbea
t:3260:1" -IsAutoSynchEnabled:"0" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p1=0b" -AuthMCh
apSecret:"#p1=0b" -AuthChapType:"#p1=none" -Offset:"0" -CacheMode:"none" -CacheSizeMB:"0" -serial:"35FFEAA5E6649182" 
-eui64:"35FFEAA5E6649182" -revision:"0001" -product:"STARWIND" -vendor:"STARWIND" -Replicator:"#p0=0" -WitnessType:"0
" -AluaAccessState:"#p0=0;#p1=1"
-
200 Failed: invalid partner info.. 
To confirm, here is what you said to go with, modified with my IP and path info:

Code: Select all

param($addr="172.17.6.31", $port=3261, $user="root", $password="starwind",
	$addr2="172.17.6.32", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="NotSynchronize",
	$size=1024,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="/mnt/sdb1/shared",
	$imageName="test2",
	$createImage=$true,
	$storageName="",
	$targetAlias="test2",
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2=172.21.220.2:3260",
	$hbInterface="#p2=172.17.6.32:3260,172.21.200.102:3260",
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="/mnt/sdb1/shared",
	$imageName2="test2",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="test2",
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.21.220.1:3260",
	$hbInterface2="#p1=172.17.6.31:3260,172.21.200.101:3260",
	$createTarget2=$true,
	$bmpFolderPath2=""
	)
I noticed that the aluaOptimized and aluaOptimized2 are set differently in your example (and thusly in my above code block). I then tried it again with both set to true, with the same results.
yaroslav (staff)
Staff
Posts: 3424
Joined: Mon Nov 18, 2019 11:11 am

Wed Aug 14, 2024 9:04 pm

Please check the following.
1. Does the script create an image on any of the nodes /mnt/sdb1/shared?
2. Did you create the volume already? In other words, does /mnt/sdb1/shared exist?
3. Make sure to clean up mnt/sdb1/shared and /opt/starwind/starwind-virtual-san/drive-c/starwind/headers after each unsuccessful script run.
4. Dry run with one heartbeat link.
5. try without #p1= and #p2=
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Wed Aug 14, 2024 9:27 pm

Yes, the volume were successfully created before attempting this, and show up correctly in the web UI.

Yes, on the first node (172.17.6.31), the following were created:
/mnt/sdb1/shared/test2.img
/mnt/sdb1/shared/test2.swdsk.bak
/opt/starwind/starwind-virtual-san/drive_c/starwind/headers/test2/test2.swdsk

I have been deleting them between each attempt.

I tried both suggestions:
- without #p1= and #p2= parameters, and it results in an "Invalid channel format [2]" error
- single heartbeat results in the same "invalid partner info" error

I should add that comms are confirmed working between the corresponding interfaces of each node (confirmed pings between corresponding management, data, and replication interfaces of each node).
yaroslav (staff)
Staff
Posts: 3424
Joined: Mon Nov 18, 2019 11:11 am

Thu Aug 15, 2024 8:53 am

Hi,

The parameter section seems to be correct. Can I please get a whole script?
Thanks!
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Thu Aug 15, 2024 12:46 pm

Here you go:

Code: Select all

param($addr="172.17.6.31", $port=3261, $user="root", $password="starwind",
	$addr2="172.17.6.32", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="NotSynchronize",
	$size=1024,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="/mnt/sdb1/shared",
	$imageName="test2",
	$createImage=$true,
	$storageName="",
	$targetAlias="test2",
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2=172.21.220.2:3260",
	$hbInterface="#p2=172.17.6.32:3260", #,172.21.200.102:3260
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="/mnt/sdb1/shared",
	$imageName2="test2",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="test2",
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.21.220.1:3260",
	$hbInterface2="#p1=172.17.6.31:3260", #,172.21.200.101: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()
}
yaroslav (staff)
Staff
Posts: 3424
Joined: Mon Nov 18, 2019 11:11 am

Thu Aug 15, 2024 1:20 pm

Hi,

Thanks! Do the following changes
1. uncoment bitmap parameters
2. revert to the previous values with 2x heartbeat interfaces
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Thu Aug 15, 2024 2:02 pm

Thank you.

That seems to have made some progress. I had the bitmap parameters commented out from seeing multiple replies from you in other, similar threads, suggesting that.

However, it's not quite there:

Code: Select all

PS C:\WINDOWS\system32> D:\PersistentData\Users\TechSupport\Desktop\CreateHA_2.ps1
Request to  172.17.6.31 ( 172.17.6.31 ) : 3261
-
control 0x0000000003514B80 -InitSynchronize:"" -SynchronizationType:"4"
-
101 Failed: operation cannot be completed.. 
I then removed everything, and tried again, this time with $initMethod="SyncFromFirst"
That resulted in:

Code: Select all

PS C:\WINDOWS\system32> D:\PersistentData\Users\TechSupport\Desktop\CreateHA_2.ps1
Request to  172.17.6.31 ( 172.17.6.31 ) : 3261
-
control 0x0000000003B93600 -InitSynchronize:"" -SynchronizationType:"1" -SynchronizerTargetName:"iqn.2008-08.com.
starwindsoftware:172.17.6.31-test2"
-
101 Failed: operation cannot be completed.. 
I tried a manual sync using "SyncHaDevice.ps1":

Code: Select all

param($addr="172.17.6.31", $port=3261, $user="root", $password="starwind", $deviceName="test2")

Import-Module StarWindX

try
{
	Enable-SWXLog

	$server = New-SWServer $addr $port $user $password

	$server.Connect()

	$device = Get-Device $server -name $deviceName
	if( !$device )
	{
		Write-Host "Device not found" -foreground red
		return
	}

	if($device.SyncStatus -ne [SwHaSyncStatus]::SW_HA_SYNC_STATUS_SYNC)
	{
		Write-Host "Synchronize device $($device.name)" -foreground yellow
		$device.Synchronize([SwHaSyncType]::SW_HA_SYNC_FULL, "")
		#$device.MarkAsSynchronized()
	}
	else
	{
		Write-Host "Device $($device.name) is synchronized" -foreground yellow
	}
}
catch
{
	Write-Host $_ -foreground red
}
finally
{
	$server.Disconnect()
}
That results in: "Device not found"
I then tried again $deviceName="test2_HA" (saw files with that name, so figured I'd try it) - same results.


I see the LUNs in the web UI, but there are the following alerts (visible on both nodes' UI):

Code: Select all

LUN	test2	The replication partner is not synchronised	StarWind-BDC
LUN	test2	Failed to receive a heartbeat from the replication partner 'StarWind-PDC'	StarWind-BDC
LUN	test2	The replication partner is not synchronised	StarWind-PDC
Node name to IP mapping:
StarWind-PDC = 172.17.6.31
StarWind-BDC = 172.17.6.32

I again confirmed that all three interfaces of each node can ping the respective interface on the other node, so the networking appears to be okay.
yaroslav (staff)
Staff
Posts: 3424
Joined: Mon Nov 18, 2019 11:11 am

Thu Aug 15, 2024 2:28 pm

That seems to have made some progress. I had the bitmap parameters commented out from seeing multiple replies from you in other, similar threads, suggesting that.
There's a catch. If commented, they require to be commented on everywhere, but the script you used had them only on the parameter section uncommented.
In the script I published here earlier, I did not need to comment on them, so I left them.

Is there any firewall in between the StarWind VSAN VM and the management console?
If you wee those in the Management Console, there might already be a conflict in the CFG and the file on the underlying store.
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Thu Aug 15, 2024 2:43 pm

Thank you.

By management console, I assume you mean the computer from which I'm running the PowerShell scripts?
That workstation is on a different network than the StarWind VMs, but there is an explicit "permit all" rule from that network to the 172.17.x.x network - no traffic restrictions.

> might already be a conflict in the CFG and the file on the underlying store
Could you please point me to the configuration location?

Also, what would be the correct device name to use for $devicename= in SyncHaDevice.ps1?
The web UI shows "test2" under LUNs, but SyncHaDevice reports "Device not found" when using that name.
yaroslav (staff)
Staff
Posts: 3424
Joined: Mon Nov 18, 2019 11:11 am

Thu Aug 15, 2024 3:00 pm

For $devicename= , try HAdevice* label from /opt/starwind/starwind-virtual-san/drive_c/starwind/StarWind.cfg. If you need to delete target and device lines from the *.cfg, pelase stop starwind-virtual-san first.

I am attaching my script down below. try setting a different targetAlias and imageName. It looks like the entry was created yet sync did not start. Make sure the IPs are static and MTU for sync inside and outside VM set to 1500.
Attachments
(edit)yk-CreateHA_2.zip
(1.54 KiB) Downloaded 1228 times
Seamus
Posts: 7
Joined: Wed Aug 14, 2024 7:22 pm

Thu Aug 15, 2024 3:25 pm

After stopping the service, cleaning up the many lingering <device ... /> entries in the config file, restarting the service, and then running CreateHA_2 again, it looks like it worked! The web UI showed that it was synching, and then shows the LUN as Online / High Availability.

I'll soon proceed with attaching to the LUN via ESXi's iSCSI HBA, but based on what I am seeing now, I expect that will go well. I've done that process before many times.

Thank you again!

For reference, here are the contents of my copy of "CreateHA_2.ps1":

Code: Select all

param($addr="172.17.6.31", $port=3261, $user="root", $password="starwind",
	$addr2="172.17.6.32", $port2=$port, $user2=$user, $password2=$password,
#common
	$initMethod="SyncFromFirst",
	$size=1024,
	$sectorSize=512,
	$failover=0,
	$bmpType=1,
	$bmpStrategy=0,
#primary node
	$imagePath="/mnt/sdb1/shared",
	$imageName="test3",
	$createImage=$true,
	$storageName="",
	$targetAlias="test3",
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="none",
	$cacheSize=0,
	$syncInterface="#p2=172.21.220.2:3260",
	$hbInterface="#p2=172.17.6.32:3260,172.21.200.102:3260",
	$createTarget=$true,
	$bmpFolderPath="",
#secondary node
	$imagePath2="/mnt/sdb1/shared",
	$imageName2="test3",
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="test3",
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1=172.21.220.1:3260",
	$hbInterface2="#p1=172.17.6.31:3260,172.21.200.101: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.BitmapStoreType = $bmpType
	$secondNode.BitmapStrategy = $bmpStrategy
	$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: 3424
Joined: Mon Nov 18, 2019 11:11 am

Thu Aug 15, 2024 3:42 pm

Hi,

I am glad to read it working :)
Always happy to help.
Post Reply