OpenNebula / addon-image-backup

OpenNebula backup script for QCOW2 datastores
8 stars 3 forks source link

can I backup XML VM config with images #7

Closed richman1000000 closed 4 years ago

richman1000000 commented 4 years ago

I was trying out this script. But I didn't find in folder a configuration for VM. since image name fe7650fe35b110b23d86ab3f6df0cc93, I cannot find easily configuration for VM to be able to restore it. In my case, particular important is MAC address and DISK driver config.

feldsam commented 4 years ago

You should backup deployments files too, which contains XML

richman1000000 commented 4 years ago

Yes there is XML file, but it is not viable for correct recovery of whole VM On the screenshot you can see that image "ea4722a11908324c37e5b6c21e53f367" is not contained in config file. image

feldsam commented 4 years ago

you are wrong, /media/datastores/..../disk.n are only symlinks to real file (snapshot or original image). So you should check system DS with ls -la cmd to see where symlinks are pointing.

richman1000000 commented 4 years ago

yes, I did that. But I want to backup whole VM. images+config. So I can recover them individually if required. Or recover them on separate Opennebula instance

richman1000000 commented 4 years ago

is it possible to export template instead of XML file? image

feldsam commented 4 years ago

hello, no need, if you backup deployment files, all is in backup. In you backup location you should have both datastores; images and system type. In images ds are persistent images and in system type are deployment files including symlinks to images ds. check by ls -la /path/to/backup/datastores/105/53/

feldsam commented 4 years ago

it is just like opennebula storage driver do it, so you can just copy back images and deployment files and you are done.

richman1000000 commented 4 years ago

No, I want to backup VMs in case of Opennebula Upgrade. I had a problem updating Opennebula last time. With VMware I'm able to restore VM on newer version. but on opennebula this is not viable..

feldsam commented 4 years ago

I don't see any problem. Before an upgrade, you do a backup of DB and conf files. You can use this script to backup VM disks and deployment files including snapshots.

This backup script can be used to restore the whole cloud in conjunction with DB and Conf files backup. It also helps when your storage system fails. You can mount new and copy back all contents.

According to your messages, it looks like you don't understand well how OpenNebula store files on disk.

richman1000000 commented 4 years ago

I've never upgraded Opennebula successfully on prod. Only on test environment. On prod after a year of use, I had to reinstall it when attempted to upgrade. Database is new and I stuck with bunch of files where XML is not pointing to disks that belong to corresponding VM.

Everything had to be restored manually. This is what I'm trying to avoid in the future.

feldsam commented 4 years ago

hmm, this is the discussion suitable for the forum and not issue on GitHub. This script backups images + deployment files including symlinks, so it can be restored without OpenNebula just by copy to the hypervisor and issuing virsh create /path/to/deployment.xml

Sounds strange, I performed several upgrades on production from version 5.4.x to 5.10.x. In upgrade procedure is everything, there is that you should backup DB, how you can restore it, and so on...

I am closing this issue. If you need more help, create a new topic on forum.opennebula.io