[pve-devel] [PATCH v2 container 1/3] mountpoint mount: activate PVE-managed volumes during preparation

Fiona Ebner f.ebner at proxmox.com
Fri Apr 12 13:08:12 CEST 2024


Otherwise it was not possible to hotplug a volume that was previously
deactivated and requires activation, e.g. an LVM LV that was detached
after shutting down the container couldn't be hotplugged anymore
later.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---

Changes in v2:
    * specify snapname when activating

 src/PVE/LXC.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 0dda696..9681d74 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1849,6 +1849,7 @@ sub __mountpoint_mount {
 
 	my $scfg = PVE::Storage::storage_config($storage_cfg, $storage);
 
+	PVE::Storage::activate_volumes($storage_cfg, [$volid], $snapname);
 	my $path = PVE::Storage::map_volume($storage_cfg, $volid, $snapname);
 
 	$path = PVE::Storage::path($storage_cfg, $volid, $snapname) if !defined($path);
-- 
2.39.2





More information about the pve-devel mailing list