How to restore a VM from VHD files?
-
Hi,
This is my first post; I am migrating away from the VMware world to XCP-ng and XOA. My setup consisted of 12 ESXi hosts, 2 NFS VM stores (TrueNAS + SSD) and 2 NFS backup stores (TrueNAS + HDD) running about 150 VMs. My VMs where backed up to a NAS using Veeam and I was using TrueNAS integrated ZFS sync to replicate VMs to another NAS. That way, if I had a problem recovering a VM with Veeam, I always had the replicated VM data that I could copy over, I just had to register the VM and start it. This setup was simple and rock solid for years.
I am trialing XCP-ng and XOA and I am trying to break and fix things. 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?
I am using the integrated backup tool which is nice. My question is : 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?
Any suggestion would be appreciated!
Thank you.
-
@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.
-
This post is deleted! -
This post is deleted! -
This post is deleted! -
@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!
-
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.
-
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
-
I need to plan for the worst, how can I restore a VM with metedata and a VHD file? Is it possible?
-
Just use XO for it. I'm not sure to understand in which universe you won't be able to do that
-
@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 backupsThank you.
-
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.
-
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
-
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.
-
@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?
-
-
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? -
@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