fix: add state volume pattern to parse_volname (#234)

PVE allocates a vm-<vmid>-state-<snapname> volume when a snapshot is taken
with "Include RAM" selected. parse_volname didn't recognise this pattern,
causing a crash during both setup and cleanup of the state volume.

Added state volume pattern — treated as raw images, same vmid extraction
as disk volumes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Kevin Adams 2026-06-07 14:19:14 -04:00
parent a47346161b
commit 80a78896bf
1 changed files with 6 additions and 0 deletions

View File

@ -415,6 +415,12 @@ sub parse_volname {
return ('images', $volname, $vmid, undef, undef, $isBase, 'raw'); return ('images', $volname, $vmid, undef, undef, $isBase, 'raw');
} }
# RAM snapshot state volume: vm-<vmid>-state-<snapname>
# PVE allocates one of these per snapshot when "Include RAM" is selected.
if ($volname =~ /^vm-(\d+)-state-.+$/) {
return ('images', $volname, $1, undef, undef, 0, 'raw');
}
die "unable to parse TrueNAS volume name '$volname'\n"; die "unable to parse TrueNAS volume name '$volname'\n";
} }