Possible for a script on one host to test fr VM runnig on another host?
-
Is it possible for a script on one host to check if a VM is running on another host?
Id like to have a cron task that runs every few minutes on host A to see if a VM is running on host B. If its not, I want it to start a VM on A, if it is I want it to either carry on or to shut down the VM on host A.
Trying to get around running Opensense and don't have multiple WAN IP addresses for HA.
-
Hi,
Why not using HA in a pool?
-
@olivierlambert
Trying to avoid doing the shared NFS/Iscsi thing. -
Then it's an entire DIY situation. It's tricky: you need to check many cases where one could think the destination VM is down but just lose the connection to it and having a split brain scenario. Of course, everything is possible with a script, but you might have a lot more difficulties to tackle the overall behavior. At least, you'll learn how hard HA is
-
@archw Just write a shell script and use rsh to securely run the script to query that host for the status of that VM. You make need to add the accessing hosts to /etc/hosts.allow (might be hosts_allow, I can't recall offhand).
See for example: https://linuxconfig.org/hosts-allow-format-and-example-on-linuxThat said, HA is clearly a better option, provided you have a compatible SR available.
-
@tjkreidl Thank you!!!
-
@olivierlambert Thanks!