XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Possible for a script on one host to test fr VM runnig on another host?

    Scheduled Pinned Locked Moved Management
    7 Posts 3 Posters 140 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      archw
      last edited by

      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.

      tjkreidlT 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Hi,

        Why not using HA in a pool?

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          archw @olivierlambert
          last edited by

          @olivierlambert
          Trying to avoid doing the shared NFS/Iscsi thing.

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            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 😄

            A 1 Reply Last reply Reply Quote 0
            • tjkreidlT Offline
              tjkreidl Ambassador @archw
              last edited by tjkreidl

              @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-linux

              That said, HA is clearly a better option, provided you have a compatible SR available.

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                archw @tjkreidl
                last edited by

                @tjkreidl Thank you!!!

                1 Reply Last reply Reply Quote 0
                • A Offline
                  archw @olivierlambert
                  last edited by

                  @olivierlambert Thanks!

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post