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

    How to restore a VM from VHD files?

    Scheduled Pinned Locked Moved Backup
    18 Posts 5 Posters 1.5k Views 4 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.
    • G Offline
      glatour @Danp
      last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • G Offline
        glatour @Danp
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • G Offline
          glatour @Danp
          last edited by

          @Danp said in How to restore a VM from VHD files?:

          @glatour said in How to restore a VM from VHD files?:

          It seems like it’s not all VMs data that sits on the NFS shares, only the VHD disks with changing UUIDs. The VM configuration is somewhere else, on the hosts or on the XOA?

          Correct, the metadata is stored inside your XCP-ng pool. You can back it up using XOA. See the documentation for full details.

          how could I backup my VMs in another way to easily restore a VM if the XOA (and the backup tool) and the VMs metadata are unavailable?

          With XOA, you could simply deploy another instance, point it to your prior backups, and then restore any needed VMs.

          What happens if your XOA restore does not work or if your backups are corrupted? Is there any other way to do backups?

          How can you recover the VM metadata ir order to restore from a VHD file?

          Thanks!

          G 1 Reply Last reply Reply Quote 0
          • G Offline
            glatour @glatour
            last edited by

            @glatour

            I think I found a part of the answer, I was using only delta backups. I configured full backups and now I have .xva files that I can import. That will do, I just need to use ZFS sync to replicate those backups.

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

              However, it will only do full backup (XVAs are only fulls). But you can't think it's better than the incremental backup: the XVA can be corrupted on the backup storage. Also "X restore doesn't work" isn't a risk, because… there's an entire team behind it to make sure it will work. Even losing your XO won't affect your backups.

              If you fear about backup integrity, then use mirror backup or backup to multiple location, it's the best bet 🙂

              G 1 Reply Last reply Reply Quote 0
              • G Offline
                glatour @olivierlambert
                last edited by

                @olivierlambert

                I need to plan for the worst, how can I restore a VM with metedata and a VHD file? Is it possible?

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

                  Just use XO for it. I'm not sure to understand in which universe you won't be able to do that 🤔

                  G 1 Reply Last reply Reply Quote 1
                  • G Offline
                    glatour @olivierlambert
                    last edited by

                    @olivierlambert said in How to restore a VM from VHD files?:

                    Just use XO for it. I'm not sure to understand in which universe you won't be able to do that 🤔

                    I am asking because about 5 years ago the chain of incremental Veeam backups broke for about 40 VMs and the only thing that saved me was the ZFS replication of the VMs folders/data. After that event, I just like to plan for the worst...

                    OK so to resume, if I loose all my VMs, my XCP-ng hosts, my pools and the XOA, I can still recover if I have backups on my remotes by:

                    1- Spin up an XOA on a fresh XCP-ng
                    2- Restore the XO config from backups
                    3- Restore VMs from backups

                    Thank you.

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

                      That's 100% correct. Everything is self contained in the backup storage, and fresh XO on any fresh XCP-ng host will be able to restore all your backups.

                      Regarding an incremental chain, you can add the option to create a full every XX incremental run, to reduce the risk of a corrupted element in a very long chain of delta.

                      1 Reply Last reply Reply Quote 1
                      • S Offline
                        starmood
                        last edited by

                        Can I continue this topic?

                        I know I can restore the VM from backup, but just want to check if there is more easier way.

                        If one host down, and I want to restore(or say import) VM back to new host. Since VHD file is on shared storage, so it's still there and I think it's not that necessary to do a full restore from backup?
                        So can I get the individual VM configuration file (meta?) from somewhere instead of restoring the Meta backup for the whole pool?

                        So basically what I'd like to check is, if I can import/restore individual VM configure file with VHD file together, is that possible?

                        Thanks

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

                          If the storage is still working but you lose all your hosts in the pool, you can use metadata backup/restore to avoid restoring data which is already there.

                          For any other case, any fresh XOA will be able to reconnect to the backup repository and restore any VM of your choice on whatever host/storage of your choice.

                          G 1 Reply Last reply Reply Quote 0
                          • G Offline
                            glatour @olivierlambert
                            last edited by

                            @olivierlambert said in How to restore a VM from VHD files?:

                            "you can use metadata backup/restore to avoid restoring data which is already there."

                            How do you that? Is there a procedure?

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

                              See https://docs.xen-orchestra.com/metadata_backup

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                starmood @olivierlambert
                                last edited by

                                Thanks, so by my understanding, if we restore the meta, it will automatically map those <uuid>.vhd files to VM configuration, correct?
                                Then can we only restore specified VM meta? Or it's just all or nothing?

                                lawrencesystemsL 1 Reply Last reply Reply Quote 0
                                • lawrencesystemsL Offline
                                  lawrencesystems Ambassador @starmood
                                  last edited by

                                  @starmood For each VM backup run inside of Xen Orchestra it backs up not just the VHD but everything that is needed to restore that VM to any other XCP-ng host. So in a complete loss situation you can load a new XCP-ng Host, setup Xen Orchestra, point the new Xen Orchestra to those backups and restore any of the VM's with all their settings.

                                  The metadata backup of XCP-ng is just that, the metadata of the system and it's not granular. It's good to have because all the things like network setting and what VM's are on the hosts will be there, but the VM backups to me are the most important.

                                  I have a tutorial covering how the backups work, it's from a bit over a year ago and there are EVEN MORE features now and I will be doing a new video this year to cover that.

                                  https://youtu.be/weVoKm8kDb4?si=1z6IDqwnK1cxEGjm

                                  I also have a tutorial on how you can also automate the backup validation process
                                  https://youtu.be/A0HTRF3dhQE?si=gZLXQUqLJmDkIQs6

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