node priority

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

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

Post Reply
Abhishek
Posts: 3
Joined: Thu Jan 28, 2021 9:46 am

Thu Feb 04, 2021 1:31 pm

Hi

How can we change the node priority using powershell ? does the node with highest priority will always be used as sync source ?
yaroslav (staff)
Staff
Posts: 2334
Joined: Mon Nov 18, 2019 11:11 am

Thu Feb 04, 2021 1:53 pm

If you are talking about Device Priority (i.e., one you see in Management Console when the device is expanded), you cannot change it with PowerShell.

Let me clarify where synchronization priority comes from and why you may (or may not) want to change it.
While replicating a StarWind disk, the device which is used as a source gets greater priority (e.g., First priority). Its copy, in turn, has lower priority (e.g., Second, Third, etc.).These numbers are important only after the synchronization connection fails and is subsequently restored. The device of higher priority is considered synchronized and may lead to data corruption if tuned wrong (with the values you get automatically things work just fine). If you change synchronization priorities, data flow during synchronization may cause data corruption someday. If I were you, I would not change the node synchronization priority. There is a way to do that (and I can share the steps with you in case you might really need it).
Devices with “strange” (neither first nor second) priority appear after you remove the replica on one site and create it again. Say, you have a device on node #1 replicated to node #2 (2-node HA cluster). If you remove the replica from node #1, where it had the First priority, and create the replica again, the device priority will be changed to Third. While you have the synchronization channel up, everything works fine. Once the sync channel is down, the device of higher priority (i.e., First in our case) is supposed to stay active, while the other one will stop accepting iSCSI sessions. This is where the heartbeat links come into play, too, as in absence of sync links they allow services to communicate with one another. After the connection is restored, synchronization starts from there.
The main thing you need to understand about the priorities is that one StarWind node is supposed to have priorities for all devices higher than the partner node:
1 - 2
3 - 4
2 - 3
1 - 2
The above example is totally fine to be used.
If you see anything similar to the below:
1 - 2
2 - 1
3 - 4
3 - 2
then you may want to change the device priority settings, which is done by editing HA device header files. Feel free to get back for additional instruction on how to perform that if needed.


Here is how you can change a StarWind HA device priority.
1) Make sure that you shut down StarWind VSAN services. Just go to Task Manager and disable everything related to StarWind.
2) Go to the device folder and open the corresponding *_HA.swdsk as a text file (say, with Notepad++, or Notepad). Your device name is vsan-02.
Find the section looking like that
<node id="2" name="iqn.2008-08.com.starwindsoftware:10.255.255.252-vsan-02" shut="false" active="true">
<storages>
<storage_ref id="2"/>
</storages>
<parameters>
<type>1</type>
<priority>1</priority> - OWNER NODE PARAMETER
<sync_status>1</sync_status>
</parameters>
</node>
<node id="3" name=" iqn.2008-08.com.starwindsoftware:<node name>-vsan-01" shut="false" active="true">
<storages>
<storage_ref id="3"/>
</storages>
<parameters>
<type>1</type>
<priority>0</priority> - PARTNER NODE PARAMETER
<sync_status>1</sync_status>
</parameters>
</node>
Change the <priority>1</priority> to <priority>0</priority> (i.e., the owner node parameter) and <priority>0</priority> to <priority>1</priority> (i.e., the partner node parameter). Save the file. Enable all the StarWind services which you have disabled during the preparation phase.
Now, go to the vsan-01 host (I think the partner node is called like that).
1) Make sure that you shut down StarWind VSAN services. Just go to the Task Manager and disable all services related to StarWind.
2) Go to the device folder and open the corresponding *_HA.swdsk as a text file (say, with Notepad++ or Notepad). Your device name is vsan-01.
Find the section which looks like that
<node id="2" name=" iqn.2008-08.com.starwindsoftware:<node name>-vsan-01" shut="false" active="true">
<storages>
<storage_ref id="2"/>
</storages>
<parameters>
<type>1</type>
<priority>0</priority> - OWNER NODE PARAMETER
<sync_status>1</sync_status>
</parameters>
</node>
<node id="3" name=" iqn.2008-08.com.starwindsoftware:10.255.255.252-vsan-02" shut="false" active="true">
<storages>
<storage_ref id="3"/>
</storages>
<parameters>
<type>1</type>
<priority>1</priority> - PARTNER NODE PARAMETER
<sync_status>1</sync_status>
</parameters>
</node>
Change the <priority>0</priority> to <priority>1</priority> (i.e., the owner node parameter) and <priority>1</priority> to <priority>0</priority> (i.e., the partner node parameter). Save the file. Enable all the StarWind services and go to SW Management console to verify that the changes were successfully applied.
Post Reply