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

    programmatically connect SR (NFS)

    Scheduled Pinned Locked Moved Solved REST API
    5 Posts 3 Posters 245 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.
    • C Offline
      crembz
      last edited by crembz

      I'm somewhat new to xcpng and am trying to figure out a way to connect an NFS SR (or several) once an NFS server comes online.

      Use Case:

      Following a power outage there is a race condition between xcpng and my NAS. Typically the xcpng hosts start first.
      The SR does not connect to the NAS as it is unavailable at that time
      Any VMs hosted on the NFS server fail to start
      SR remains disconnected even once the NAS is up

      Currently I need to manually reconnect the SR and start the VMs

      I'm trying to understand how I can have the NAS make an API call to XO to reconnect the SRs and trigger the VMs to boot.

      Using the xo-cli I'm able to issue

      xo-cli sr.connectAllPbds id={SRUID}
      

      but I'm not sure how to automate this on XO or call it via an API call from the NAS.

      Can anyone help guide me here?

      Cheers

      1 Reply Last reply Reply Quote 0
      • DanpD Offline
        Danp Pro Support Team
        last edited by

        The details are here -- https://xcp-ng.org/forum/post/70075

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

          Hi,

          @ronan-a made a script to do that automatically on boot. Can you repost the link please @ronan-a ? (sorry I always forgot where it is)

          1 Reply Last reply Reply Quote 0
          • DanpD Offline
            Danp Pro Support Team
            last edited by

            The details are here -- https://xcp-ng.org/forum/post/70075

            C 1 Reply Last reply Reply Quote 2
            • C Offline
              crembz @Danp
              last edited by

              @Danp That worked a treat thanks for the link!

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

                Perfect, excellent news 🙂 Enjoy XCP-ng!

                1 Reply Last reply Reply Quote 1
                • olivierlambertO olivierlambert marked this topic as a question on
                • olivierlambertO olivierlambert has marked this topic as solved on
                • First post
                  Last post