Add node to cluster using Powershell

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

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

Post Reply
AlexH
Posts: 5
Joined: Mon Jul 06, 2020 9:43 am

Tue Jul 07, 2020 1:31 pm

Hello, the last 2 weeks I tested Starwind VSan Free and it works perfectly. We'll probably be rolling this out in a remote office as a 2-node cluster. But maybe we'll need to expand to a 3-node cluster if the hardware can't handle the load. It's been asked in the past, but is it already possible to add a node to an existing cluster using Powershell yet? It's been on the roadmap since 2016/2017 looking at older posts. I could only find the Add-HAPartner.ps1 script but I don't think this is for adding a 3rd node to a 2-node cluster.
yaroslav (staff)
Staff
Posts: 2277
Joined: Mon Nov 18, 2019 11:11 am

Wed Jul 08, 2020 2:40 pm

Hi Alex,

Welcome to StarWind Forum!
AddHaPartner can be fit to this task. You need to use interfaces of the 1st and 3rd nodes; interfaces for the 2nd node (the one that has already been added) the module retrieves automatically.
AlexH
Posts: 5
Joined: Mon Jul 06, 2020 9:43 am

Thu Jul 09, 2020 2:45 pm

Hi Yaroslav. Thanks for the info, now the script makes sense! I'll test the expansion this weekend.
yaroslav (staff)
Staff
Posts: 2277
Joined: Mon Nov 18, 2019 11:11 am

Thu Jul 09, 2020 3:14 pm

Please keep me posted. Let me know if you have any other questions.
AlexH
Posts: 5
Joined: Mon Jul 06, 2020 9:43 am

Fri Jul 10, 2020 2:56 pm

yaroslav (staff) wrote:Hi Alex,

Welcome to StarWind Forum!
AddHaPartner can be fit to this task. You need to use interfaces of the 1st and 3rd nodes; interfaces for the 2nd node (the one that has already been added) the module retrieves automatically.
I'm looking at the script now, but how will it know the interfaces for the 2nd node? Starwinds advice is in 2 and 3 clusters to use direct connections. The connection from node 2 and 3 will be on other interfaces therefore. It seems to me that I would need to specify also the hb and sync channels for node 2 to be used by node 3. Or do I miss something?
yaroslav (staff)
Staff
Posts: 2277
Joined: Mon Nov 18, 2019 11:11 am

Fri Jul 10, 2020 3:03 pm

It retrieves interfaces of 2nd node from the device info. In other words, StarWind Service should retrieve them automatically.
AlexH
Posts: 5
Joined: Mon Jul 06, 2020 9:43 am

Mon Jul 13, 2020 6:53 am

yaroslav (staff) wrote:It retrieves interfaces of 2nd node from the device info. In other words, StarWind Service should retrieve them automatically.
I've played with it but I don't see how this can work. The script starts as follows:

Code: Select all

param($addr="192.168.0.1", $port=3261, $user="root", $password="starwind", $deviceName="HAImage1",
	$addr2="192.168.0.2", $port2=$port, $user2=$user, $password2=$password,
#secondary node
	$imagePath2="My computer\C\starwind",
	$imageName2="partnerImg22",
	$createImage2=$true,
	$targetAlias2="partnerha22",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2="none",
	$cacheSize2=0,
	$syncInterface2="#p1={0}:3260" -f $addr,
	$hbInterface2="#p1={0}:3260" -f $addr,
	$selfSyncInterface="#p1={0}:3260" -f $addr2,
	$selfHbInterface="#p1={0}:3260" -f $addr2
	)
This is using the management IP's also for Sync and HB. Also it named p1= in both the interfaces for the existing node ad for the new node. When creating a new 3-node cluster you use p1=, p2= and p3=. I modified the script with the correct hb and sync interfaces but I keep getting invalid partner information.

As recommended by Starwind I use direct connections between all nodes. The current setup has only 1 sync and 1 hb between node 1 and 2.

Mangement IP's
Node-1: 192.168.2.91 (already in cluster)
Node-1: 192.168.2.92 (already in cluster)
Node-1: 192.168.2.93 (new node to be added)

Sync between node 1 and 2: 172.16.10.10 and 172.16.10.20 (already in place and working)
Sync between node 2 and 3: 172.16.11.20 and 172.16.11.30
Sync between node 1 and 3: 172.16.12.10 and 172.16.12.30

HB between node 1 and 2: 172.16.20.10 and 172.16.20.20 (already in place and working)
HB between node 2 and 3: 172.16.21.20 and 172.16.21.30
HB between node 1 and 3: 172.16.22.10 and 172.16.22.30


I would assume I need to change the script as follows:

Code: Select all

param($addr="192.168.2.91", $port=3261, $user="root", $password="starwind", $deviceName="HAImage1",
	$addr2="192.168.2.93", $port2=$port, $user2=$user, $password2=$password,
#secondary node
	$imagePath2="My computer\C\starwind",
	$imageName2="partnerImg22",
	$createImage2=$true,
	$targetAlias2="partnerha22",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2="none",
	$cacheSize2=0,
	$syncInterface2="#p1=172.16.12.10:3260;#p2=172.16.11.20:3260",
	$hbInterface2="#p1=172.16.22.10:3260;#p2=172.16.21.20:3260",
	$selfSyncInterface="#p2=172.16.10.20:3260;#p3=172.16.12.30:3260",
	$selfHbInterface="#p2=172.16.20.20:3260;#p3=172.16.22.30:3260"
	)
But nowhere I need to specify for node-2 which interfaces thát node needs to use. It seems this script is not suitable for this kind of task, or am I missing something?

Running the above results in: 200 Failed: invalid partner info..

Where do I go wrong?
yaroslav (staff)
Staff
Posts: 2277
Joined: Mon Nov 18, 2019 11:11 am

Wed Jul 15, 2020 9:15 am

Hi,

The last script you provided us with should be the right one.
But nowhere I need to specify for node-2 which interfaces thát node needs to use.
You do not need to specify node 2 anywhere. Just node 1 p1= and node 2 p2=
Try this one. I used the unique names.

Code: Select all

aram($addr="192.168.2.91", $port=3261, $user="root", $password="starwind", $deviceName="HAImage2",
   $addr2="192.168.2.93", $port2=$port, $user2=$user, $password2=$password,
#secondary node
   $imagePath2="My computer\C\starwind",
   $imageName2="partnerImg23",
   $createImage2=$true,
   $targetAlias2="partnerha23",
   $autoSynch2=$true,
   $poolName2="pool1",
   $syncSessionCount2=1,
   $aluaOptimized2=$true,
   $cacheMode2="none",
   $cacheSize2=0,
   $syncInterface2="#p1=172.16.12.10:3260" -f $addr,
   $hbInterface2="#p1=172.16.22.10:3260" -f $addr,
   $selfSyncInterface="#p1=172.16.12.30:3260" -f $addr2,
   $selfHbInterface="#p1=72.16.22.30:3260" -f $addr2
   )
So, what was wrong with your script?
Node interfaces were mixed: you used interfaces of 2nd node.
p3= is not a variable, i believe.
Use commas to separate IPs (e.g., p2=172.16.12.10:3260,172.16.12.30:3260")

Please consider using the default $imageName2= and $targetAlias2=" values. Please note that you are missing the other part where the variables are enlisted.

Let me know if the script I provided you with works.
AlexH
Posts: 5
Joined: Mon Jul 06, 2020 9:43 am

Wed Jul 15, 2020 1:47 pm

Thanks for your answers. Unfortunately it didn't work. I get the following error:

Code: Select all

Request to  TEST-NODE1 ( 192.168.2.91 ) : 3261
-
control 0x000002783EFFF540 -AddPartner:"" -PartnerTargetName:"#p1=iqn.2008-08.com.starwindsoftware:192.168.2.93-partnerha23" -Priority:"#p1=2" -nodeType:"#p1=1" -P
artnerIP:"#p1=172.16.12.30:sync:3260:1,72.16.22.30:heartbeat:3260:1" -AuthChapType:"#p1=none" -AuthChapLogin:"#p1=0b" -AuthChapPassword:"#p1=0b" -AuthMChapName:"#p
1=0b" -AuthMChapSecret:"#p1=0b" -Replicator:"#p1=0"
-
200 Failed: operation cannot be completed..
Any other idea?
yaroslav (staff)
Staff
Posts: 2277
Joined: Mon Nov 18, 2019 11:11 am

Wed Jul 15, 2020 1:55 pm

Code: Select all

Param($addr="192.168.2.91", $port=3261, $user="root", $password="starwind", $deviceName="HAImage2",
   $addr2="192.168.2.93", $port2=$port, $user2=$user, $password2=$password,
#secondary node
   $imagePath2="My computer\C\starwind",
   $imageName2="partnerImg22",
   $createImage2=$true,
   $targetAlias2="partnerha22",
   $autoSynch2=$true,
   $poolName2="pool1",
   $syncSessionCount2=1,
   $aluaOptimized2=$true,
   $cacheMode2="none",
   $cacheSize2=0,
   $syncInterface2="#p1=172.16.12.10:3260" -f $addr,
   $hbInterface2="#p1=172.16.22.10:3260" -f $addr,
   $selfSyncInterface="#p1=172.16.12.30:3260" -f $addr2,
   $selfHbInterface="#p1=72.16.22.30:3260" -f $addr2
   )
Try using the default values for $imageName2= and $targetAlias2=" values.

Let me know if that helps.
Post Reply