Restore VM that is child of template VM (Ceph RBD)

kwinz

Active Member
Apr 18, 2020
40
16
28
36
Hi!

I have a hyperconverged Proxmox (PVE) cluster with Ceph. My VM's hard disks are backed by Ceph RBD.
And I am making backups to Proxmox Backup (PBS) server.

The VMs share a lot of common data. So I first created a template VM (vm 102) and then cloned this template to create the individual VMs.

If I look at the ceph storage, I can see that the VM's disks actually are children of the common template's disk. Shared data is not duplicated and it saves me a lot of storage space:
Code:
root@pve2:~# rbd children cephpool1/base-102-disk-0@__base__
cephpool1/vm-104-disk-0
cephpool1/vm-105-disk-0
cephpool1/vm-106-disk-0
cephpool1/vm-107-disk-0
cephpool1/vm-108-disk-0

My question is now: If I restore a VM from the PBS, will this break the child relationship with the template's disk?
Anything that I can do, or should be aware of?
 
My question is now: If I restore a VM from the PBS, will this break the child relationship with the template's disk?
Yes. The restore will happen to a new disk image that knows nothing about the child relationship.
You can also restore it to a different type of storage where the parent-child functionality isn't given or a different node that doesn't have the parent image.
 
Yes. The restore will happen to a new disk image that knows nothing about the child relationship.
You can also restore it to a different type of storage where the parent-child functionality isn't given or a different node that doesn't have the parent image.
I actually WANT to maintain the parent-child functionality to keep the space savings.

I guess that is just not implemented in PVE right now?

If you would implement this on restore you would have to first clone the PVE VM template again
Then overwrite the child with the differences from the backup.

See also https://docs.ceph.com/en/latest/dev/rbd-layering/

I think a similar feature would also benefit the restore of VMs cloned from templates on ZFS.
 
Last edited:
I actually WANT to maintain the parent-child functionality to keep the space savings.
I do get that, but it is not possible. You cannot create a new disk image from scratch (which we need to do on restore) and maintain that relationship. Similar as to an rbd import. That too won't be able to retain the parent-child relationship.

The situation for ZFS is the same.

Creating it works well. But restoring a full image from an external source and rebuilding that relationship won't work.
 
I do get that, but it is not possible.

Creating it works well. But restoring a full image from an external source and rebuilding that relationship won't work.

Technically I don't see why it wouldn't work like I suggested. On restore recreate the template image (or just its disk) from scratch from backup if it doesn't exist yet. Clone the VM again. This recreates the parent-child relationship. And then selectively overwrite the blocks that have changed with the data from the backup.
 
While technically possible, I don't see us implementing something like that in the foreseeable future. It would need to handle the relationship between the different backups and do the restore in the correct order. Additionally, it would need to do a differential restore for the child VMs.

Feel free to open an enhancement request in our bugtracker, but don't get your hopes up too high. On the other hand, patches are welcome :)
 
  • Like
Reactions: kwinz

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!