AddHaPartner error

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

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

Post Reply
linkusnet
Posts: 1
Joined: Thu Sep 30, 2021 8:51 pm

Tue Oct 05, 2021 6:51 pm

I'm upgrading the server pair. Both OLD servers are up 100% functional. 800GB on 6 HAImages. It's setup as a the Windows Server 2016 2 node Cluster called Host60 and Host61. I'm taking OLD-Host61 down so I need to RemoveHAPartner on the HA disks then be able to AddHAPartner to bring back the redundancy on the NEW-Host61 then do the same on Host60.

The steps:
1. Create NEW Host61
2. Run RemoveHAPartner on OLD-Host60 that points to the HAImages on OLD-Host61
3. Run AddHAPartner on OLD-Host60 that creates the HAImages on the NEW-Host61 then wait for sync - THIS IS WHERE I'm HAVING AN ISSUE
4. Once that's complete start on OLD-Host60 by creating NEW-Host60
5. Run RemoveHAPartner on NEW-Host61 that points to OLD-HOST60
6. Run AddHAPartner on NEW-Host61 to create the HAs on the NEW-Host60 then wait for sync
7. DONE!

So I created a test HATest2 disk using
CreateHA_2 -imageName "HATest2"

Here is the CreateHA_2 code

Code: Select all

param($addr="172.18.8.60", $port=3261, $user="root", $password="starwind",
	$addr2="172.18.8.61", $port2=$port, $user2=$user, $password2=$password,
#common
#must include 
#ImageName
	$initMethod="Clear",
	$size=12,
	$sectorSize=512,
	$failover=0,
#primary node
	$imagePath="D:\VSAN",
	$imageName="",
	$createImage=$true,
	$storageName="",
	$targetAlias="{0}-target" -f $imageName,
	$autoSynch=$true,
	$poolName="pool1",
	$syncSessionCount=1,
	$aluaOptimized=$true,
	$cacheMode="wb",
	$cacheSize=128,
	$syncInterface="#p2={0}:3260" -f $addr2,
	$hbInterface="#p2=172.18.9.61:3260",
	$createTarget=$true,
#secondary node
	$imagePath2=$imagePath,
	$imageName2=$imageName,
	$createImage2=$true,
	$storageName2="",
	$targetAlias2="{0}-partner" -f $imageName,
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$false,
	$cacheMode2=$cacheMode,
	$cacheSize2=$cacheSize,
	$syncInterface2="#p1={0}:3260" -f $addr,
	$hbInterface2="#p1=172.18.9.60:3260",
	$createTarget2=$true
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog

	$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
    
	#
	# 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
        
	$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()
}
Then I did a
RemoveHAPartner.ps1 -deviceName "HAImage9" -partnerTargetName "iqn.2008-08.com.starwindsoftware:host61-hatest2-partner"

When I try to AddHAPartner to test adding the HAImage9 back:

Code: Select all

Request to  HOST60.VOICE.INT ( 172.18.8.60 ) : 3261
-
control 0x0000020619BAD380 -AddPartner:"" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoftware:host61-hatest2-partner" -Priority:"#p1=1" -nodeType:"#p1=1" -PartnerIP:"#p1=172.18.8.61:sync:3260:1" -AuthChapType:"#p1=none" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p1=0b" -AuthMChapSecret:"#p1=0b" -Replicator:"#p1=0"
-
200 Failed: invalid partner info..
Here is the AddHAPartner code

Code: Select all

param($addr="172.18.8.60", $port=3261, $user="root", $password="starwind", 
	$addr2="172.18.8.61", $port2=$port, $user2=$user, $password2=$password,
#secondary node
#MUST INCLUDE 
#	deviceName
#	imageName2
#imagename2 PartTest - should be the same as the original Image.
#deviceName imagefile3 - is originally determined by StarWind
	$deviceName="HAImage9",
	$imagePath2="D:\VSAN",
	$imageName2="HATest2",
	$createImage2=$true,
	$targetAlias2="{0}-partner" -f $imageName2,
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$syncInterface2="#p1={0}:3260" -f $addr,
	$hbInterface2="#p1=172.18.9.60:3260",
	$selfSyncInterface="#p2={0}:3260" -f $addr2,
	$selfHbInterface=""
	)
	
Import-Module StarWindX

try
{
	Enable-SWXLog -level SW_LOG_LEVEL_DEBUG

	$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
	}

	$node = new-Object Node
	$node.HostName = $addr2
	$node.HostPort = $port2
	$node.Login = $user2
	$node.Password = $password2
	$node.ImagePath = $imagePath2
	$node.ImageName = $imageName2
	$node.CreateImage = $createImage2
	$node.TargetAlias = $targetAlias2
	$node.SyncInterface = $syncInterface2
	$node.HBInterface = $hbInterface2
	$node.AutoSynch = $autoSynch2
	$node.SyncSessionCount = $syncSessionCount2
	$node.ALUAOptimized = $aluaOptimized2
	$node.PoolName = $poolName2

	Add-HAPartner $device $node $selfSyncInterface $selfHbInterface
}
catch
{
	Write-Host $_ -foreground red 
}
finally
{
	$server.Disconnect()
}
Here is enumDevicesTargets on OLD-Host60 (I removed the 6 working disks from this for brevity)

Code: Select all

Name        : iqn.2008-08.com.starwindsoftware:host60.voice.int-hatest2-target
Id          : 0x000002063B9CDBC0
Alias       : HATest2-target
IsClustered : True
Devices     : System.__ComObject
Permissions : System.__ComObject
type        :

Name                    : HAImage9
DeviceType              : HA Image
DeviceId                : 0x0000020619BAD380
File                    : D:\VSAN\HATest2_HA.swdsk
TargetName              : iqn.2008-08.com.starwindsoftware:host60.voice.int-hatest2-target
TargetId                : 0x000002063B9CDBC0
Size                    : 12582912
CacheMode               : wb
CacheSize               : 128
CacheBlockExpiryPeriod  : 5000
Exists                  : True
DeviceLUN               : 0
IsSnapshotsSupported    : False
Snapshots               :
SectorSize              : 512
State                   : 0
Partners                : System.__ComObject
SynchronizationChannels :
HeartbeatChannels       :
SyncStatus              : 1
SyncPercent             : 100
IsWaitingAutosync       : False
SyncTrafficShare        : 50
NodeType                : 1
FailoverStrategy        : 0
MaintenanceMode         : 0

Been at it for 2 days and now I'm under a time crunch.

THANKS!
Tim
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Sat Oct 09, 2021 2:02 pm

Hi,

Thank you for your question. Make sure to use the right IP addresses for this task (i.e., when referring to host1 it is necessary to specify host2 IPs). Also, please make sure that your severs meet StarWind VSAN System requirements https://www.starwindsoftware.com/system-requirements.
Let me know if playing around with the IP addresses helps.
Post Reply