Backup of linked clones

AndrevdG

Active Member
May 25, 2014
1
0
41
I am still a complete noob when it comes to using ProxMox. Only been trying it out for a week or so now and although I can figure out a lot of things by searching on the forums / wiki / google, there is one thing (so far) that I have not been able to grasp. Which is backup of linked clones...

1. I make a basic vm, shut it down, turn it into a template.
2. I make a backup of this template. This backup is static, cause the template itself should not change
3. I make a linked clone. The hard drive of this linked clone should only contain the differences made from the template
4. I make a backup of the linked clone. This contains (in my tests so far) the complete image. Template + changes since the vm first ran..

I would like to (and it would make sense to me) be able to backup the linked clone only for what it has changed from the template. Let's say I have 10 vms running of the same template, then there is no need to backup the template data over and over. All I need is the template (1x) and the changes of the vms (10x).

<edit>
To clarify, I made a linked clone, checked the disk volume (500MB or so), made a backup and restored the backup to a new VM. This new VM had a 40GB harddrive so it seems it contains all data of the template + changes. Also the backup was 5+GB (I would expect 500 or so MB)
</edit>

Is there a way to do this, or do I miss something obvious?
 
Last edited:
Is there a way to backup/restore linked-clones 'as it is' without a full image?
 
Ok, thanks for your feedback, Dietmar!

Is it possible to just scp an 'online' 'linked-clone' image + config file to another location as backup?

scp /var/lib/vz/images/100/base-100-disk-1.qcow2 192.168.1.1:/var/lib/vz/images/100/
scp /etc/pve/qemu-server/100.conf 192.168.1.1:/etc/pve/qemu-server/
 
I would not do that - this can result in inconsistent qcow2 file on the target.

Would it be safe if it is 'offline' ? Reason is I only have a 128Gb SSD and there is not enough space when I restore from full vzdump backup :(
 
Last edited:
You can do it low level if you use ZFS storage. You can do full backups, incremental backups and, best of all, the backup-ed live VM does not change during the copying of the backup (as you copy the snapshot). Of course, it is not ideal because you don't stop/free+sync the VM, but much better than copying qcow2 files with a live VM.
 
I have tried to rsync or scp an 'offline' VM image and conf file to another location as backup and then tried to restore the VM from that backup. VM seems to work fine after the restore.

Will do this for now until a better way to do incremental/differential 'online' backup for linked-clones other than the vzdump 'full' online backup.

The problem with the existing vzdump backup is a 'linked-clone' will turn into a 'full-clone' after restoration :(
 
Hi@all,
is there some other way now after a couple of years to do backups of linked clones?

What I have tried is pve-zsync (because of the use of zfs). But it is telling me "no valid zfs dataset" because base and vm is written in vmid.conf.

Any idea how to make automatic backups of linked clones, without having full backups, and of course with the possiblity to just restore the linked clone?

Regards
Andy
 
Clones are only for ephemeral use and not for long term use. After some time, your performance will be bad as time will go. It is ok to use clones/linked clones for VM where you have a very small write operations.
 
Well this will be the case, the systems will have extreme small wirte operations. But even with just little write operations, a backup plan is needed.
 
Clones are only for ephemeral use and not for long term use. After some time, your performance will be bad as time will go. It is ok to use clones/linked clones for VM where you have a very small write operations.

that depends a lot on the underlying storage, and is in no way true in general.
 
as dietmar already said, you cannot backup linked clones separately with vzdump (vzdump always backs up the full disks as seen by the guest). depending on the storage, you possibly can do some kind of incremental backup to only transfer deltas, but that is outside of PVE's supported backup mechanism and you need to take care of consistency and restoring yourself.
 
So is it not planned to implement a "more intelligent" backup feature of linked clones to PVE?

So the way I could go withouth having full size backups would be:
Code:
zfs send -R rpool/data/base-555-disk-1@__base__ | ssh "node-to" zfs recv rpool/data/base-555-disk-1
zfs snapshot rpool/data/vm-800-disk-1@__send__
zfs send -Rv -i rpool/data/base-555-disk-1@__base__ rpool/data/vm-800-disk-1@__send__ | ssh "node-to" zfs recv rpool/data/vm-800-disk-1
 
as dietmar already said, you cannot backup linked clones separately with vzdump (vzdump always backs up the full disks as seen by the guest). depending on the storage, you possibly can do some kind of incremental backup to only transfer deltas, but that is outside of PVE's supported backup mechanism and you need to take care of consistency and restoring yourself.

You are writing about vzdump, but I asked about pve-zsync? Is there a way to automate the backup of linked clones with pve-zsync?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!