]> git.proxmox.com Git - pve-container.git/blobdiff - src/lxc-pve-poststop-hook
Move volume activation to vm_start
[pve-container.git] / src / lxc-pve-poststop-hook
index 2683ae2d1361fc011038a58d064f57e14c7a1176..0fdd49ea4482a749083f99ca4ba801142c40a98a 100755 (executable)
@@ -75,6 +75,12 @@ PVE::LXC::Tools::lxc_hook('post-stop', 'lxc', sub {
        open(my $fh, '>', "/var/lib/lxc/$vmid/reboot")
            or die "failed to create reboot trigger file: $!\n";
        close($fh);
+
+       # activate all volumes of the container in case pending changes added
+       # a not yet activated volume
+       my $vollist = PVE::LXC::Config->get_vm_volumes($conf);
+       PVE::Storage::activate_volumes($storage_cfg, $vollist);
+
        # cause lxc to stop instead of rebooting
        exit(1);
     }