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

    Execute pre-freeze and post-thaw

    Scheduled Pinned Locked Moved Backup
    25 Posts 8 Posters 1.1k Views 7 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.
    • florentF Offline
      florent Vates 🪐 XO Team @jsajous26
      last edited by

      @jsajous26 we have something for this, web hooks : https://xen-orchestra.com/blog/xen-orchestra-5-75/
      doc : https://github.com/vatesfr/xen-orchestra/blob/master/%40xen-orchestra/xapi/docs/vm-sync-hook.md?ref=xen-orchestra.com

      1 Reply Last reply Reply Quote 0
      • J Offline
        jsajous26
        last edited by jsajous26

        I don't quite understand the use of webhooks.
        Do you have a more specific example?

        Veeam not use XOA for backup, use directly XCP-ng.

        florentF 1 Reply Last reply Reply Quote 0
        • florentF Offline
          florent Vates 🪐 XO Team @jsajous26
          last edited by

          @jsajous26 sorry I misread. I don't know how ti setup this while using veeam

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jsajous26 @florent
            last edited by jsajous26

            @florent

            Using webhooks, if I understand correctly, requires installing a Node.js server. This server would then call the commands to put Oracle into backup mode.

            This solution is cumbersome because it would require maintaining Node.js.

            Is there no way to directly use Guest Tools to call a script before and after snapshot, like with VMware or QEMU? If not, is this planned?

            florentF 1 Reply Last reply Reply Quote 0
            • florentF Offline
              florent Vates 🪐 XO Team @jsajous26
              last edited by

              @jsajous26 AFAIK this is not possible to call a script inside the VM through the guest tools. Maybe on veeam side there are other way to do this ( throug ssh / powershell) ?

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

                You can read key/values from the xenstore, and write some (from VM to outside), but you cannot write values "in live" from outside the VM to the inside.

                D 1 Reply Last reply Reply Quote 0
                • D Offline
                  dcskinner @olivierlambert
                  last edited by

                  @olivierlambert do the guest tools quiesce the filesystems before snapshotting?

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

                    Tools are aware of a snapshot so you don't have blocks in flight.

                    D TeddyAstieT 2 Replies Last reply Reply Quote 0
                    • D Offline
                      dcskinner @olivierlambert
                      last edited by

                      @olivierlambert So there is information coming from outside into the VM 🙂

                      Is there a particular reason not to implement freeze/thaw scripts in that case? The tools know there is a snap taking place and you said that you can write info from VM to outside, which would have to happen to tell the system that blocks have been committed and is ok to start. Seems like the communication is there, just need to implement the scripts.

                      Coming from VMware land, this is expected behavior of the guest tools.

                      I agree with OP, the webhooks looks janky, does not appear to be in the main docs, and the linked docs says it is unstable after 3 years.

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

                        No, it's not using the same mechanism. It's a PV call (if I remember, but I'm not sure). You cannot write a xenstore key in live to a VM (only on boot).

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

                          And beyond that, I'm not sure we actually want this behaviour from a security perspective. But it's another topic.

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            dcskinner @olivierlambert
                            last edited by

                            @olivierlambert ok, but it wouldn't have to. The guest tools always run the scripts (if they exist) when it sees a snap happening and then reports out the status the same way it says that the block commits are complete.

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

                              They aren't meant for that, I have no idea how difficult it would be to make the PV drivers to actually "do something" (what exactly? write a value in the xenstore?). Maybe @teddyastie could provide an opinion on that.

                              1 Reply Last reply Reply Quote 0
                              • TeddyAstieT Offline
                                TeddyAstie Vates 🪐 XCP-ng Team Xen Guru @olivierlambert
                                last edited by TeddyAstie

                                @dcskinner @olivierlambert

                                You can read key/values from the xenstore, and write some (from VM to outside), but you cannot write values "in live" from outside the VM to the inside.

                                It is, but XAPI doesn't provide a interface for it.

                                do the guest tools quiesce the filesystems before snapshotting?

                                Tools are aware of a snapshot so you don't have blocks in flight.

                                do the guest tools quiesce the filesystems before snapshotting?

                                Guests kernel are aware, as it is them that are performing a "suspend" on toolstack request (thus quiece filesystems); although "tools" can only observe that the system has been suspended after the fact by measuring side effects, and not orchestrate it.

                                It's because suspend/resume operation doesn't come from "guest tools" actually, but instead from the kernel drivers. So userland tools has no say on it.

                                1 Reply Last reply Reply Quote 1
                                • D Offline
                                  dinhngtu Vates 🪐 XCP-ng Team
                                  last edited by dinhngtu

                                  There used to be quiescent snapshot capabilities in older versions (mainly for Windows VSS support), but it has since been removed. I'd say @Team-XAPI-Network knows more about the reason.

                                  psafontP ForzaF 2 Replies Last reply Reply Quote 0
                                  • psafontP Offline
                                    psafont Vates 🪐 XAPI & Network Team @dinhngtu
                                    last edited by

                                    @dinhngtu It's possible to run hooks inside the control domain on different stages of VM lifecycle operations, but these need to be installed beforehand, see https://xapi-project.github.io/new-docs/xenopsd/design/hooks/index.html

                                    I think the vm-pre-suspend is the name of the hook the does this, but I can't confirm it. The docuementation is missing the hook, but it exists in the source code: https://github.com/xapi-project/xen-api/blob/master/ocaml/xenopsd/lib/xenops_hooks.ml#L37

                                    D 1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      dinhngtu Vates 🪐 XCP-ng Team @psafont
                                      last edited by dinhngtu

                                      @psafont Looks like these hooks are for suspend-resume rather than snapshot/backups? I couldn't find any mention of hook calls during the snapshot process

                                      psafontP 1 Reply Last reply Reply Quote 0
                                      • ForzaF Offline
                                        Forza @dinhngtu
                                        last edited by

                                        @dinhngtu said in Execute pre-freeze and post-thaw:

                                        There used to be quiescent snapshot capabilities in older versions (mainly for Windows VSS support), but it has since been removed. I'd say @Team-XAPI-Network knows more about the reason.

                                        We have vmware with ppdm backups and the vss part is actually causing some annoying issues such as quite long io stalls. But I do understand the reason for vss, especially for applications that aren't crash safe.

                                        1 Reply Last reply Reply Quote 0
                                        • psafontP Offline
                                          psafont Vates 🪐 XAPI & Network Team @dinhngtu
                                          last edited by

                                          @dinhngtu Xenopsd does not have a concept of snapshot. Because I understand that "freezing" the VM means suspending it, I think that the suspend hook will get triggered in any snapshot with memory

                                          D 1 Reply Last reply Reply Quote 0
                                          • D Offline
                                            dinhngtu Vates 🪐 XCP-ng Team @psafont
                                            last edited by

                                            @psafont Freezing/thawing doesn't actually suspend a VM, but it's just a part of the backup process, where I/O operations are quiesced to create a stable view of the on-disk data.

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