Hi,
I'm looking to create a script that will create a backup of my current VM and stored them in a deduplication system. (I'm using BorgBackup with a remote repo for storing)
I've tried to use vzdump which create a .vma file that doesn't seem to work well with deduplication. To by-pass that, I've try to create a VM snapshot then convert the image snapshot to a qcow2 file which seems to be working great but I'm not sure if I'm doing it right.
Suppose I have a running VM with ID 100, then first I create a snapshot using the following command :
If the VM is using qcow2 format, I can use qemu-img info to see the snapshot.
I can also use qemu-img convert to create a new image from the snapshot.
If the VM is using LVM storage, I can also use qemu-img to convert the LVM to a .qcow2 file, but I need to activate the volume before.
After the conversion is done, I have a new image that I've been able to boot without problem for now. I can move backup with borg and I delete the snapshot using :
So my question is does it make sense to do that?
I'm looking to create a script that will create a backup of my current VM and stored them in a deduplication system. (I'm using BorgBackup with a remote repo for storing)
I've tried to use vzdump which create a .vma file that doesn't seem to work well with deduplication. To by-pass that, I've try to create a VM snapshot then convert the image snapshot to a qcow2 file which seems to be working great but I'm not sure if I'm doing it right.
Suppose I have a running VM with ID 100, then first I create a snapshot using the following command :
qm snapshot 100 qmsnap
If the VM is using qcow2 format, I can use qemu-img info to see the snapshot.
qemu-img info vm-100-disk-0.qcow2
I can also use qemu-img convert to create a new image from the snapshot.
qemu-img convert -O qcow2 -s qmsnap vm-100-disk-0.qcow2 vm-100-snap.qcow2
If the VM is using LVM storage, I can also use qemu-img to convert the LVM to a .qcow2 file, but I need to activate the volume before.
vgchange -ay
qemu-img convert -O qcow2 /dev/pve/snap_vm-100-disk-0_qmsnap vm-100-snap.qcow2
After the conversion is done, I have a new image that I've been able to boot without problem for now. I can move backup with borg and I delete the snapshot using :
qm delsnapshot 100 qmsnap
So my question is does it make sense to do that?
Last edited: