How to force VSAN online via powershell?

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

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

Post Reply
danswartz
Posts: 71
Joined: Fri May 03, 2019 7:21 pm

Sat Mar 16, 2024 8:37 pm

Sorry if this well-known, but my google-fu has failed me. I'm running 2-node native windows VSAN with free edition. A couple of weeks ago, I had a power failure or something and VSAN would not come back up. Looking at both hosts, there was some error about being unable to tell which node was more recent. Google for this, and I see multiple posts various places about how to force one node online, but they all refer to the GUI :(. I'd really appreciate a quick tip how to accomplish this in powershell, so I can write that down somewhere and not get stuck again :). It was late at night and everything was down, so I went the hard route and rebuilt the VSAN and restored the 10 or so VM guests from backups. Rather not have to do that again LOL.
yaroslav (staff)
Staff
Posts: 2359
Joined: Mon Nov 18, 2019 11:11 am

Sat Mar 16, 2024 9:40 pm

Hi,

You can run SyncHADevice.ps1. That will mark one of the HAs as synchronized.
Make sure StarWindService (or StarWindVSA) on the partner node is stopped until you confirm the data to be up-to-date.
P.S. If you have a Write Back cache, remove it as described here https://knowledgebase.starwindsoftware. ... -l1-cache/.
danswartz
Posts: 71
Joined: Fri May 03, 2019 7:21 pm

Sat Mar 16, 2024 9:51 pm

Hmmm, I seem to recall I tried that and it didn't work. I think I forgot to mention this, but one host's windows install got messed up (my fault) and windows would not boot. I foolishly rebooted the other node, and it refused to accept the sync PS command. thanks for the info, I'll make a note in case I shoot myself in the foot again lol
yaroslav (staff)
Staff
Posts: 2359
Joined: Mon Nov 18, 2019 11:11 am

Sat Mar 16, 2024 10:00 pm

There's still a way out of this situation
1. Stop StarWindService on the only host
2. go to the directories where StarWind *_HA.swdsk resides
3. for each *_HA.swdsk, locate
<node id="1" name="HAImage" shut="false" active="true" flags="0">
<storages>
<storage_ref id="1"/>
</storages>
<parameters>
...
<sync_status>0</sync_status>
Set it to 1.
This will set the device synchronized on the given node. BE CAREFUL TO DO IT ONLY FOR THE LOCAL DEVICE.
4. Start StarWindService.
5. See if the storage is there.
danswartz
Posts: 71
Joined: Fri May 03, 2019 7:21 pm

Sat Mar 16, 2024 11:00 pm

Thanks! Hopefully won’t need this 😎
yaroslav (staff)
Staff
Posts: 2359
Joined: Mon Nov 18, 2019 11:11 am

Sun Mar 17, 2024 3:10 am

Well, now you know a workaround :)
Post Reply