--- Begin Message ---
It was lost in the lvm qcow2 patches
Signed-off-by: Alexandre Derumier <[email protected]>
---
src/PVE/Storage/LVMPlugin.pm | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 1c633a3..9716854 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -375,6 +375,17 @@ my sub free_lvm_volumes {
my $lvmpath = "/dev/$vg/del-$name";
print "zero-out data on image $name ($lvmpath)\n";
+ my $cmd_activate = ['/sbin/lvchange', '-aly', $lvmpath];
+ run_command(
+ $cmd_activate,
+ errmsg => "can't activate LV '$lvmpath' to zero-out its data",
+ );
+ $cmd_activate = ['/sbin/lvchange', '--refresh', $lvmpath];
+ run_command(
+ $cmd_activate,
+ errmsg => "can't refresh LV '$lvmpath' to zero-out its data",
+ );
+
$secure_delete_cmd->($lvmpath);
$class->cluster_lock_storage(
@@ -755,13 +766,6 @@ my sub alloc_snap_image {
my sub free_snap_image {
my ($class, $storeid, $scfg, $volname, $snap) = @_;
- #activate only the snapshot volume
- my $path = $class->path($scfg, $volname, $storeid, $snap);
- my $cmd = ['/sbin/lvchange', '-aly', $path];
- run_command($cmd, errmsg => "can't activate LV '$path' to zero-out its
data");
- $cmd = ['/sbin/lvchange', '--refresh', $path];
- run_command($cmd, errmsg => "can't refresh LV '$path' to zero-out its
data");
-
my $snap_volname = get_snap_name($class, $volname, $snap);
return free_lvm_volumes($class, $scfg, $storeid, [$snap_volname]);
}
@@ -777,11 +781,7 @@ sub free_image {
#activate volumes && snapshot volumes
my $path = $class->path($scfg, $volname, $storeid);
$path = "\@pve-$name" if $format && $format eq 'qcow2';
- my $cmd = ['/sbin/lvchange', '-aly', $path];
- run_command($cmd, errmsg => "can't activate LV '$path' to zero-out its
data");
- $cmd = ['/sbin/lvchange', '--refresh', $path];
- run_command($cmd, errmsg => "can't refresh LV '$path' to zero-out its
data");
-
+ $class->activate_volume($storeid, $scfg, $volname);
my $snapshots = $class->volume_snapshot_info($scfg, $storeid,
$volname);
for my $snapid (
sort { $snapshots->{$a}->{order} <=> $snapshots->{$b}->{order} }
--
2.47.3
--- End Message ---
_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel