Page 1 of 1

How to force VSAN online via powershell?

Posted: Sat Mar 16, 2024 8:37 pm
by danswartz
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.

Re: How to force VSAN online via powershell?

Posted: Sat Mar 16, 2024 9:40 pm
by yaroslav (staff)
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/.

Re: How to force VSAN online via powershell?

Posted: Sat Mar 16, 2024 9:51 pm
by danswartz
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

Re: How to force VSAN online via powershell?

Posted: Sat Mar 16, 2024 10:00 pm
by yaroslav (staff)
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.

Re: How to force VSAN online via powershell?

Posted: Sat Mar 16, 2024 11:00 pm
by danswartz
Thanks! Hopefully won’t need this 😎

Re: How to force VSAN online via powershell?

Posted: Sun Mar 17, 2024 3:10 am
by yaroslav (staff)
Well, now you know a workaround :)