[pve-devel] [PATCH v4 pve-storage 1/5] qcow2: add external snapshot support

DERUMIER, Alexandre alexandre.derumier at groupe-cyllene.com
Thu Apr 3 06:27:59 CEST 2025


> >
> > > <this extends the storage API, so it should actually do that..
> > > and
> > > probably $backing should not be an arbitrary path, but something
> > > that
> > > is resolved locally?
> 
> I'll send the $snapname as param instead

>>see my comments on the qemu-server side, I think it would be even
>>better if we could just get rid of extending alloc_image like this,
>>and instead always go via volume_snapshot..

> 
> > > is this because it will automatically take the size from the
> > > backing
> > > image?
> 
> Yes, it take size from the backing.  (and refuse if you specify size
> param at the same time than backing file)

>>we pass a size and a backing file in qemu-server, so I guess that is
>>wrong there? ;)



About this part,  for the lvm plugin,  both size && backing is used.
size is used for allocate lvm device (but not in qcow2 format part,
where backing is ued).


Alloc_image is used by qemu-server to allocate the lvm volume, without
doing the volume rename part from volume_snapshot. (Because it must be
done in qemu-server to be able to rename online the volume).


so if you want to use volume_snapshot  from qemu-server, we need an
option to tell him to not rename because it's already done.
(previously, I was using it, and that why I was using  (if -e
volume_...), to continue if the volume was already renamed by qemu-
server.





> 


> This is more by security, I'm still unsure of the behaviour if you
> have
> multiple disks, and that snapshot is dying in the middle. (1 disk
> rename, the other not renamed). 

>>I am not sure what we gain by this other than papering over issues.
>>
>>for multi-disks what we'd need to do is:
>>- loop over volumes
>>-- take a snapshot of volume
>>-- as part of error handling directly in taking a snapshot, undo all
>>steps done until the point of error
>>- if an error occurs, loop over all already correctly snapshotted
>>volumes
>>-- undo snapshot of each such volume

ok, got it! I'll look to it for next patch version





More information about the pve-devel mailing list