[pve-devel] [PATCH 5/5] DRBD: Implement snapshots.

Philipp Marek philipp.marek at linbit.com
Thu Oct 15 16:35:52 CEST 2015


> >  * There's no implementation for volume_snapshot_rollback() yet.
> >    Is there a way to change the volume name on rollback?
> >    The problem is that DRBDmanage (as of now) won't allow to _replace_
> >    the current contents with the ones from the snapshot --
> >    but perhaps we want to implement that at some time.
> 
> You just need to make sure your plugin return the correct path.

Well, the logic currently is that "activating" a snapshot creates another 
COW volume (another thin LVM snapshot), and puts that one in a new 
resource.

As the data in DRBDmanage is addressed by *resource name*, that means I'd 
need to tell the ProxMox layer above that code that the *volume* name has 
changed - which is not possible, I guess.


So, I can see a few alternatives:

a) We change DRBDmanage to allow restoring into the "same" resource again
b) We change the ProxMox driver to address data not via
        "volume name" == "resource name",
   but instead write the volume name as a separate attribute into 
   a resource, search for the right resource every time we're about to do
   something, and, for this function, have to (atomically!) remove the 
   attribute from the old resource and set it in the new resource
c) ProxMox allows us to fetch a newly generated volume name that we can
   take for the new resource, and that we can return for it to be used
   from now on


First of all - are there other alternatives that I didn't see?

Second - from the ones above, I'd prefer c over a over b.

b is bad because of the multiple transaction that have to be done more or 
less atomically; a is hard to get right, because that means swapping LVs on 
multiple hosts in an atomic fashion; c sounds as the easiest way to me.
(Most probably because I don't know about fallout for ProxMox ... ;)


So, which direction should we go?

Let's discuss that here; thanks for participating!


More information about the pve-devel mailing list