ways of Decommissioning and adding a server on HA

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

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

Post Reply
descalona
Posts: 11
Joined: Mon Jan 14, 2019 8:06 pm

Tue Oct 10, 2023 2:38 pm

Hello all,

I have 2 servers hosting a 25TB image using starwind vsan free. I followed a guide on creating a small ha device using Create-HA_2.ps1 and extended it using ExtendDevice.ps1 scripts and I was successful. Now, I need to decom the old server and replace it with the new one without disconnecting to the image so that it still continue to run. (running a vcenter on the 25TB image) How to properly do it? I tried using Add-HAPartner.ps1 script to add the new server and sync it from the second node but I am getting a "Mandatory parameters are missed" error. Can someone able to help me with this? Herer is my Add-HAPartner.ps1 script. Thanks!

Code: Select all

param($addr="10.0.0.202", $port=3261, $user="root", $password="starwind", $deviceName="HAImage2",
	$addr2="10.0.0.205", $port2=$port, $user2=$user, $password2=$password,
#secondary node
	$imagePath2="My computer\F\iscsi",
	$imageName2="partnerImg-hatest2-2",
	$createImage2=$true,
	$targetAlias2="hatest2-3",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$syncInterface2="#p1={0}:3260" -f $addr,
    $hbInterface2="#p1=10.200.1.112:3260",
	$bmpType=1,
	$bmpStrategy=0,
	$bmpFolderPath="",
    $selfSyncInterface="#p2={0}:3260" -f $addr2,
    $selfHbInterface="#p2=10.200.1.114:3260"
	)
	
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
	$node.BitmapStoreType = $bmpType
	$node.BitmapStrategy = $bmpStrategy
	$node.BitmapFolderPath = $bmpFolderPath

    Add-HAPartner $device $node $selfSyncInterface $selfHbInterface
}
catch
{
	Write-Host $_ -foreground red 
}
finally
{
	$server.Disconnect()
}
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Tue Oct 10, 2023 11:24 pm

Hi,

please add synchronization interfaces to your script.
descalona
Posts: 11
Joined: Mon Jan 14, 2019 8:06 pm

Wed Oct 11, 2023 12:23 pm

Hello Yaroslav,

How to add that to my script? Is it this one? It is already in the script. Please see the code.

$syncInterface2="#p1={0}:3260" -f $addr,
$hbInterface2="#p1=10.200.1.112:3260",


$node.SyncInterface = $syncInterface2
$node.HBInterface = $hbInterface2
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Wed Oct 11, 2023 1:05 pm

Hi,

Please modify this parameter.
$syncInterface2="#p1={0}:3260" -f $addr,
descalona
Posts: 11
Joined: Mon Jan 14, 2019 8:06 pm

Sun Oct 15, 2023 1:35 am

Hello yaroslav,

modify the parameter to what? I am a little confused. Thanks!
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Sun Oct 15, 2023 1:58 am

Can you please type in the IP addresses of synchronization interfaces in the same way you did it for hbinterface? Say, 172.16.20.10 is an IP address for node 1 and 172.16.20.20 is an IP address for node 2.
Type
$syncInterface2="#p1=172.16.20.10:3260" -f $addr,
$hbInterface2="#p1=10.200.1.112:3260",

$selfSyncInterface="#p2=172.16.20.20:3260" -f $addr2,
$selfHbInterface="#p2=10.200.1.114:3260"
Hope, it makes more sense now :)
Also, please make sure that synchronization and heartbeat interfaces reside on different NICs. In other words, please make sure the network redundancy requirements are met. See more at
https://www.starwindsoftware.com/best-p ... practices/ and https://www.starwindsoftware.com/system-requirements
descalona
Posts: 11
Joined: Mon Jan 14, 2019 8:06 pm

Wed Oct 25, 2023 2:29 pm

Hello,

Sorry to re-open this. But I am still having a problem. I am trying to add another partner to my already 2 node HAImage. But, I am still getting an error. Is there a way you can take a look? Thanks

Code: Select all

PS C:\Windows\system32> param($addr="10.200.1.112", $port=3261, $user="root", $password="starwind", $deviceName="HAImage2",
	$addr2="10.200.1.114", $port2=$port, $user2=$user, $password2=$password,
#secondary node
	$imagePath2="My computer\f\iscsi",
	$imageName2="partnerImg-hatest2-2",
	$createImage2=$true,
	$targetAlias2="hatest2-2",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$syncInterface2="#p1=10.200.1.112:3260" -f $addr,
    $hbInterface2="#p1=10.0.0.202:3260",
	$bmpType=1,
	$bmpStrategy=0,
	$bmpFolderPath="",
    $selfSyncInterface="#p2=10.200.1.114:3260" -f $addr2,
    $selfHbInterface="#p2=10.0.0.205:3260"
	)
	
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
	$node.BitmapStoreType = $bmpType
	$node.BitmapStrategy = $bmpStrategy
	$node.BitmapFolderPath = $bmpFolderPath

    Add-HAPartner $device $node $selfSyncInterface $selfHbInterface
}
catch
{
	Write-Host $_ -foreground red 
}
finally
{
	$server.Disconnect()
}

Mandatory parameters are missed
descalona
Posts: 11
Joined: Mon Jan 14, 2019 8:06 pm

Wed Oct 25, 2023 2:47 pm

Still getting "Mandatory parameters are missed"
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Wed Oct 25, 2023 9:23 pm

Hi,

can you try commenting everything in the script that relates to the bitmap type?
descalona
Posts: 11
Joined: Mon Jan 14, 2019 8:06 pm

Fri Nov 03, 2023 5:47 pm

Sorry for the late reply.

I just found out from this forum that there is still no way to create a third replica from the existing 2 replica img. That is what I am trying to accomplish. Thank you so much for everything!
yaroslav (staff)
Staff
Posts: 2361
Joined: Mon Nov 18, 2019 11:11 am

Sat Nov 04, 2023 6:28 am

You can reach out to support@stawind.com to help you out with the solution.
Please use this thread and 1051024 as your references.
Post Reply