Page 1 of 1

RAID Failure - Rebuilding Node

Posted: Sun Sep 26, 2021 12:49 pm
by bg_IT
Morning all,

I provide support for a small call center and back in 2017/2018 configured a 2 Node StarWind VSAN (Free) on a couple servers then setup them up to be HyperConverged Hyper-V. After some initial issues the system has run flawlessly. This past week the unthinkable happened. A RAID drive failed and during rebuild the second drive failed. To StarWinds credit we were only down about 10 minutes while VMs cam back up on the other node (Thank you for this great product!). That being said I'm in the unfortunate position of rebuilding the server.

I did have a little luck in that I was able to gather the StarWind.cfg, Datastore_HA.swdsk, Datastore.swdsk, and a copy of the VSAN version we using from the old server before destroying the virtual disk and rebuilding (bare metal).

Finally my question. Would it be easier to setup the new node using those files or to setup a new node and use the AddHaPartner powershell script to add it to the VSAN. Can you give a brief overview of what the recommended steps would be?

Thank you

Re: RAID Failure - Rebuilding Node

Posted: Sun Sep 26, 2021 9:45 pm
by yaroslav (staff)
Hi,

Thanks for kind words!
Remove the replicas to the faulty server by running RemoveHAPartner from the HEALTHY server. Then, once the rebuild of the faulty array us done, run AddHaPartner from the HEALTHY server.

Re: RAID Failure - Rebuilding Node

Posted: Sun Sep 26, 2021 11:33 pm
by bg_IT
Thank you Yaroslav,

It looks like I'm missing the AddHaPartner.ps script in the version I'm running. I could download a newer version and get the script, would that cause any problems?

Thanks again

Re: RAID Failure - Rebuilding Node

Posted: Mon Sep 27, 2021 3:01 am
by yaroslav (staff)
Hi,

I would recommend updating both hosts and their Management Console (just in case). But first, fix the replication. Do the update, once your system is solid again.
Let me know if you need the script alone.

Re: RAID Failure - Rebuilding Node

Posted: Mon Sep 27, 2021 11:34 am
by bg_IT
Thank you,

If you could provide a copy of the powershell script that would be great.

Re: RAID Failure - Rebuilding Node

Posted: Mon Sep 27, 2021 12:43 pm
by yaroslav (staff)

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,
	$syncInterface2="#p1={0}:3260" -f $addr,
    $hbInterface2="",
    $selfSyncInterface="#p1={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()
}
See this script

Re: RAID Failure - Rebuilding Node

Posted: Mon Sep 27, 2021 4:11 pm
by bg_IT
Just checking to see if I'm on track here?

.CFG files from failed server

Code: Select all

<device file="My Computer\X\witness\witness.swdsk" node="-1" name="imagefile1"/>
    <device name="HAImage1" OwnTargetName="iqn.2008-08.com.starwindsoftware:node1-witness" file="My Computer\X\witness\witness_HA.swdsk" serialId="574A5713E3DCBE32" asyncmode="yes" readonly="no" highavailability="yes" buffering="no" header="65536" reservation="no" CacheMode="wb" CacheSizeMB="128" CacheBlockExpiryPeriodMS="5000" AluaNodeGroupStates="0,0" Storage="imagefile1"/>
    <device file="My Computer\X\DataStore\DataStore.swdsk" node="-1" name="imagefile2"/>
    <device name="HAImage2" OwnTargetName="iqn.2008-08.com.starwindsoftware:node1-datastore" file="My Computer\X\DataStore\DataStore_HA.swdsk" serialId="69484FA902A4BCB9" asyncmode="yes" readonly="no" highavailability="yes" buffering="no" header="65536" reservation="no" CacheMode="wb" CacheSizeMB="16384" CacheBlockExpiryPeriodMS="5000" AluaNodeGroupStates="0,0" Storage="imagefile2"/>
What I think the variable should be for HAImage1 (witness)

Code: Select all

param($addr="192.168.100.107", $port=3261, $user="root", $password="starwind", $deviceName="HAImage1",
	$addr2="192.168.100.110", $port2=$port, $user2=$user, $password2=$password,
#secondary node
	$imagePath2="My Computer\X\witness",
	$imageName2="HAImage1",
	$createImage2=$true,
	$targetAlias2="witness",
	$autoSynch2=$true,
	$poolName2="pool1",
	$syncSessionCount2=1,
	$aluaOptimized2=$true,
	$cacheMode2="wb",
	$cacheSize2=128,
	$syncInterface2="#p1=172.20.10.1:3260" -f $addr,
    $hbInterface2="#p1=172.20.30.1:3260" -f $addr,
    $selfSyncInterface="#p1=172.20.10.2:3260" -f $addr2,
    $selfHbInterface="#p1=172.20.30.2:3260" -f $addr2
	)
Thanks you

Re: RAID Failure - Rebuilding Node

Posted: Tue Sep 28, 2021 8:16 am
by yaroslav (staff)
Yes,

Please run the script per device from the Healthy Server. Otherwise, you will destroy the healthy side.

Re: RAID Failure - Rebuilding Node

Posted: Tue Sep 28, 2021 2:54 pm
by bg_IT
Hi Yaroslav,

I'm receiving the error "A positional parameter cannot be found that accepts the argument 'Node'" when I run AddHaPertner. Is this because the version I'm running predates the AddHaPartner script (it wasn't included in the powershell folder).

Thank you

Re: RAID Failure - Rebuilding Node

Posted: Tue Sep 28, 2021 4:10 pm
by yaroslav (staff)
Yes, please update the software. Please be aware of the downtime and HA device acquiring the "NOT SYNCHRONIZED" status on the active side. Could you see if there is SyncHaDevice.ps1 in D:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell?
Alternatively, in order to avoid downtime, you can update only Integrated Component Library while running the installer (Make sure to tick this only option!!!).

Re: RAID Failure - Rebuilding Node

Posted: Tue Sep 28, 2021 4:28 pm
by bg_IT
Thank you,

I was wondering if updating only the Integrated Component Library would work. That's great, I'll go that route and update software after.

Re: RAID Failure - Rebuilding Node

Posted: Tue Sep 28, 2021 4:56 pm
by bg_IT
Is there a place I could download different versions of VSAN? I worry that going straight to the latest version might not be a good idea, even if it's just for the Libraries.

Re: RAID Failure - Rebuilding Node

Posted: Tue Sep 28, 2021 7:40 pm
by yaroslav (staff)
Installing just libraries does not affect the service.
You can jump to the latest available one.

Re: RAID Failure - Rebuilding Node

Posted: Mon Sep 28, 2026 6:37 pm
by harryo
Hi,
I am currently running StarWind VSAN 8.0 build 12658 and I am recovering a failed HA partner. I am following the recovery procedure discussed in this thread.

My situation is:
- CONTROLLER1 is healthy and contains the only good copy of the HA image.
- CONTROLLER2 lost its replica image.
- I removed the failed HA partner from CONTROLLER1.
- I cleaned the stale HA device/target objects from CONTROLLER2.
- I am now trying to recreate the partner using AddHaPartner.ps1 from the healthy node.

The original StarWindX/PowerShell components from build 12658 do not appear to have a working Add-HAPartner implementation, so I installed a newer Integrated Component Library / StarWindX package.

With the newer library, the first run of AddHaPartner.ps1 fails with:
control HAImage -GetDefaults:"" -deviceSectorSizeBytes:"512"
101 Failed: operation cannot be completed

If I run the script a second time, it gets past that step and reaches the actual AddPartner request, but then fails with:
200 Failed: operation cannot be completed

I did not change the sector size between the first and second run.
My current versions are:
StarWindService.exe:
8.0.0 Build 12658 (original 2-node cluster version around 2018-2019)

StarWindX.dll:
1.0.0.10623 (current from the tmplink mail download)

My understanding is that build 12658 is old enough that the original StarWindX version predates the working AddHAPartner recovery workflow.

I would therefore like to obtain the historical StarWindX / Integrated Component Library version from around 2020–2021 that was used with the AddHaPartner recovery procedure, preferably the version associated with the recovery guidance in the thread above.

It would be much appreciated if you can help me with either:
1. the appropriate historical StarWindX / Integrated Component Library installer/package that supports a working Add-HAPartner command and is suitable for use with my older VSAN service during recovery, or
2. the exact StarWindX/VSAN build combination you recommend for rebuilding the failed partner before upgrading the full VSAN installation?

I would prefer to restore HA replication first before upgrading the StarWind VSAN service, because CONTROLLER1 currently contains my only healthy replica.

Thanks

Re: RAID Failure - Rebuilding Node

Posted: Mon Sep 28, 2026 6:46 pm
by yaroslav (staff)
Welcome to StarWind Forum. It's always impressive to see a build that old.
First, you will need to remove the HA partner. Then, you can add the HA partner.
Ideally, it will update VSAN to the latest build and use the latest StarWindX.