Auto Start VM when a crash occurs

I am currently running HAOS in a VM on Scale.

I suspect I’m running out of memory somewhere between my VM and the apps I have installed on Scale and the first thing to fail is the VM.

I was looking into the script found here in order to auto start the VM back up when it shuts down of its own accord/crashes because of a lack of memory. Normally this would be something I would just automate within HA but for obvious reasons I cannot.

Would that script work? If not, what solution would you propose? Thanks.

I had the same issue - the easiest solution was to add more RAM to the machine. It completely eliminated the issues I had