virt-backup icon indicating copy to clipboard operation
virt-backup copied to clipboard

Help: Do I run this as a user ?

Open g0lgs opened this issue 1 year ago • 3 comments

I am trying to test this to see if it suits my purpose.

However the docs DO NOT seem to tell me if this should be run as root (which appears to be the case on my Ubuntu 22.04)

or as a user - for me I just get errors accessing files and other issues (some of which required me to edit the XML to get the VM working again as the source image path got changed from .gcow2 to a timestamp).

g0lgs avatar Feb 27 '24 16:02 g0lgs

For some reason that I don't understand even running as root the backup failed (I think due to lack of disk space on thehost) and I ended up with the VM paused and I had trouble getting it to resume.

I now see that the disk settings for my VM have been changed to:

image

Which I don't understand.

<disk type="file" device="disk">
  <driver name="qemu" type="qcow2"/>
  <source file="/var/lib/libvirt/images/ubuntu22.04.1709111179"/>
  <backingStore type="file">
    <format type="qcow2"/>
    <source file="/var/lib/libvirt/images/ubuntu22.04.qcow2"/>
    <backingStore/>
  </backingStore>
  <target dev="vda" bus="virtio"/>
  <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</disk>

virt-manger does not show any snapshots so what is 'ubuntu22.04.1709111179' ?

g0lgs avatar Feb 28 '24 10:02 g0lgs

Sorry for the delay.

Try to run virt-backup clean to cleanup the failed backup, and merge the snapshot with your main image. I don't think that virt-manager lists external snapshots.

If it doesn't work, you can use virsh blockcommit to merge everything under a single image: https://libvirt.org/kbase/merging_disk_image_chains.html#consolidating-an-entire-disk-image-chain-into-a-single-image

About the root question: you indeed need to have access to the images in libvirt, and also have enough permissions on libvirt API to trigger a snapshot and a blockcommit. It does not have to be root, but can be the libvirt user, though I didn't test it.

aruhier avatar Mar 29 '24 12:03 aruhier

I used a different backup script in the end

g0lgs avatar Apr 03 '24 17:04 g0lgs