[pve-devel] [PATCH pve-storage 08/10] qcow2: add external snapshot support

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Jul 8 16:18:06 CEST 2025


> DERUMIER, Alexandre <alexandre.derumier at groupe-cyllene.com> hat am 08.07.2025 15:42 CEST geschrieben:
> 
>  
> >>okay, that means we instead need to become more strict with 'snapext'
> >>storages and restrict the volnames there.. maybe to (vm-|base-)-XXX-
> >>*.fmt?
> 
> $plugin->parse_volname($volname)  don't have $scfg param currently,
> 
> Do you want to extend it ? (and do change in every plugin)

ah, I forgot about that.. I guess what we could do instead would be
to restrict parsing to (vm|base)-XXX- in general there, which would
break people who have manually created such volumes and manually
assigned them to VMs. we can detect and warn about that in the
upgrade script, and let them move the disk (or manually rename)
before the upgrade..

we'd run into a similar issue with another planned change anyway,
I'll double check that there are no complications arising from that,
but you can assume for now that it's fine to restrict the volname
like that going forward.

> or can I call 
> 
> my ($storeid, $volname) = parse_volume_id($volid);
> my $scfg = storage_config($cfg, $storeid);
> 
> in the Plugin::parse_namedir ?

no, that is bad ;)

> 
> 
> sub parse_name_dir {
>     my $name = shift;
> 
>     if ($scfg->{'external-snapshots'} && $name =~ m/^((vm|base)-(\d+)-
> \S+\.(raw|qcow2|vmdk|subvol))$/) {
>         return ($1, $4, $2 eq 'base'); # (name, format, isBase)
>     } elsif ($name =~ m!^((base-)?[^/\s]+\.(raw|qcow2|vmdk|subvol))$!)
> {
>         return ($1, $3, $2); # (name, format, isBase)
>     }
> 
>     die "unable to parse volume filename '$name'\n";
> }




More information about the pve-devel mailing list