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

    info Xen Orchestra cli cmd

    Scheduled Pinned Locked Moved Xen Orchestra
    13 Posts 4 Posters 2.5k 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.
    • GheppyG Offline
      Gheppy
      last edited by Gheppy

      Hi,
      I didn't see it in the demon's help of xo-cli.
      I want to use xo-cli and by connecting on ssh to XOCE to disable it the certain task (continuous replication (CR) of an VM and after I finish the rest of my task to enable the task again.

      The scenario is as follows:
      I have a CR that syncs every 2 hours from another site over internet.
      Locally I want an certain disk of this VM (the CR vm) to be copied to be used in another VM.
      I did a bash script identifying the VM (the CR one) and HDD I wanted to copy but couldn't figure out how to turn off (disable) CR syncing on XOCE that handle the continuous replication sync.
      This copy takes 20 hours + even on 10Gb LAN, and during this time I will have at least 10 CR syncs that will fail and at the end (when the copy ents) will make a full one, which I do not want.

      I what to be able to deactivate and activate this button but over xo-cli

      e4d55e25-029c-4d3f-9c89-7a3d4ef8e219-image.png

      Thank you

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

        Hello,

        I'm not sure to understand the use case. Are you actually using the replicated disk on destination? (at least I suppose a copy of it, because if you just boot or use the replicated disk directly, this will change the blocks and corrupt it on next sync).

        If this is your use case, it's probably not the right way to do so (rsync would be probably better in that case).

        To answer about xo-cli, all commands can be displayed via xo-cli --list-commands. See https://xen-orchestra.com/docs/architecture.html#xo-cli-cli for more details.

        1 Reply Last reply Reply Quote 0
        • GheppyG Offline
          Gheppy
          last edited by Gheppy

          I use continuous replication on a production VM.
          This is done over internet, it is slow.
          Local I have this copy of VM, but I want to make a copy of copy.
          And if continuous replication is enabled when I made a copy, I get a continuous replication brake chain if it starts when copying is in progress, as you said.
          On the xo-cli --list-commands I couldn't find a way to disable this continuous replication and when I finish to enable again.

          For now I disable the sync on web gui manually , start the copy and then enable again.
          And now wat I want is to automate this process because it happens periodically.
          And all I missing is the right command line to disable and enable this continuous replication task on XOCE

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

            So the use case is making a copy of the CR VM? (so you have a backup of the backup?)

            1 Reply Last reply Reply Quote 0
            • GheppyG Offline
              Gheppy
              last edited by

              Yes but in an automatic way not by hand

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

                Why not replicating twice to 2 different SR directly in the backup job?

                1 Reply Last reply Reply Quote 0
                • GheppyG Offline
                  Gheppy
                  last edited by Gheppy

                  I don't think we're on the same page.

                  The scenario is like this:
                  The real VM is in another site and has two disks (system and database).
                  I have a copy of it, with the help of CR, on my site.
                  From the copy on my site I want to use only one disk (database).
                  The idea I started from is to make a copy on the whole VM and then use only disk 2.
                  Only for this copy I need 20 hours + and CR is done every 2 hours.
                  All I want now is to disable CR job when I make the copy to not break the CR.
                  And after I finish the copy to enable the CR job.

                  For now, as I said, I'm taking the following steps:

                  • I disable the CR job
                  • start copying
                  • enable the CR job
                    Everything manual and CR job does not break.

                  All i want is to find a way through xo-cli to be able to temporarily disable this CR job.

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

                    What do you mean with:

                    From the copy on my site I want to use only one disk (database).

                    What do you mean by "use only one disk"? What "use"? Make another copy but just of this DB disk?

                    The term "use" is very unclear to me, what do you want to do with it?

                    1 Reply Last reply Reply Quote 0
                    • GheppyG Offline
                      Gheppy
                      last edited by Gheppy

                      I hope this is more clear.
                      I use ssh copy because is more faster that VM copy over XOCE.
                      Over ssh copy I get 200 Mbps and over XOCE I get max 65 Mbps.
                      All VM discks are VHD over EXT SR.

                      0c477c76-4512-42ce-9aa2-033e45876353-image.png

                      1 Reply Last reply Reply Quote 0
                      • GheppyG Offline
                        Gheppy
                        last edited by

                        So there is no way to send a deactivation or activation request to xo-cli?

                        fohdeeshaF 1 Reply Last reply Reply Quote 0
                        • fohdeeshaF Offline
                          fohdeesha Vates 🪐 Pro Support Team @Gheppy
                          last edited by

                          @Gheppy I'm not sure if xo-cli supports job interactions, @olivierlambert may have to inquire with the xo-cli dev @julien-f . For your niche use case, you could solve it in the meantime by running your XO instance from your house (or wherever this CR destination and DB test server are). Then, you can set the CR job to replicate to two remotes, your main CR destination, and then your test pool you've been manually copying to. Since these are now both local to XOA, it won't use up extra internet bandwidth, XOA will still only be pulling one stream from the production server out on the internet, then once it's inside your network on XO, it duplicates and writes to both local CR destinations

                          julien-fJ 1 Reply Last reply Reply Quote 1
                          • julien-fJ Offline
                            julien-f Vates 🪐 Co-Founder XO Team @fohdeesha
                            last edited by

                            @Gheppy

                            1. use backupNg.getAllJobs to list the all the jobs and find the id of the job you want to manage
                            2. use schedule.getAll to list all schedules and find the ones which reference your job via the jobId property
                            3. schedule.set id=<schedule id> enabled=json:false
                            4. schedule.set id=<schedule id> enabled=json:true
                            1 Reply Last reply Reply Quote 1
                            • GheppyG Offline
                              Gheppy
                              last edited by

                              Thanks for the guidance, that's all I need.
                              It's all working now.

                              Thank you

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