-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --restore-root
option to specify target for misc vm files
#214
base: master
Are you sure you want to change the base?
Conversation
hi, |
For our use case, we are re-generating the libvirt XML from scratch. But if you think that makes sense i can implement it :) |
Provide a flag to specify where misc files (NVRAM vars, loader, etc) restored from the backup should be placed.
e9d9755
to
c193b8f
Compare
Just picked up a bug with this implementation in testing - the arg is not present on backup, so the makedirs check caused taking a backup to fail. While testing I also observed that the current implementation of adjust_config sets relative paths for the qcow2 images. This doesn't matter for our use case but doesn't seem like correct behaviour - would you like me to fix that too? |
what about remote restore? as far as i had a quick look the implementation wouldnt
not sure, i havent had any user complain about this. |
I've not implemented makedirs for the remote restore, no. I'll take a look
Will do |
I did some testing and i was unable to get it to work |
what exactly? Can you provide a concrete example? in my tests:
results in the xml file:
and like the documentation states, the UEFI and pflash files (if defined) are currently allways restored to the original pathes (if not existant). Becauase usually these pathes in on the hypervisor (especially for UEFI, which might be updated by OS updates). The UEFI files are usually part of system packages, shared amongst multiple virtual machines. For nvram or UEFI vars files, it makes sense to provide at least an option to relocate them during restore. It may make sense to implement it this way:
|
The XML gets generated with the relative path from where the restore was run. Libvirt does not update the XML on import
(Additionally, this testing also revealed another issue with this PR, that the exported XML may contain |
yes, documentation and all examples work with absolute pathes. |
I should clarify our motivation for these changes - in our use case, we do not (typically) use OVMF files distributed by the system package manager - we bundle the loader and template blobs into a VM template and store them alongside the VM. That way we can manage their lifecycle on a per-VM basis. The proposed approach would almost work for us, except for 4. Of course we could always implement our own process to back these files up seperately but I would ask what the point of virtnbdbackup backing them up in the first place is if it doesn't also provide a mechanism to restore them. There's also the question of how kernel/initrd files should be treated, if present. It seems weird to treat them too differently. We don't use this method of OS loading currently but I expect we will in the future.
Re-reading the thread I realise i misunderstood your suggestion. I will have a think and get back to you |
because usually you only lose a virtual machine, not the complete hypervisor. |
Apologies for my radio silence on this. As an alternative approach, do you think it would make sense to simply add arguments for |
Provide a flag to specify where misc files (NVRAM vars, loader, etc) restored from the backup should be placed.