X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2Flxc-pve-prestart-hook;h=ee4f7e2e5a717ec1e1a1df4c2d539045ac7c89b1;hb=5a98fd2b573e96e1af37402211ba2a07abb489ca;hp=229af8eddc95247fade145d16c8431e2fc431679;hpb=f5fe1125a91a343c32378e36b490cc73c9c825f2;p=pve-container.git diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook index 229af8e..ee4f7e2 100755 --- a/src/lxc-pve-prestart-hook +++ b/src/lxc-pve-prestart-hook @@ -30,11 +30,18 @@ PVE::LXC::Tools::lxc_hook('pre-start', 'lxc', sub { return undef if ! -f PVE::LXC::Config->config_file($vmid); my $conf = PVE::LXC::Config->load_config($vmid); + my $storage_cfg = PVE::Storage::config(); + + # apply pending changes if present + if ($conf->{pending}) { + PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storage_cfg); + $conf = PVE::LXC::Config->load_config($vmid); # just to be sure + } + if (!$skiplock && !PVE::LXC::Config->has_lock($conf, 'mounted')) { PVE::LXC::Config->check_lock($conf); } - my $storage_cfg = PVE::Storage::config(); my $vollist = PVE::LXC::Config->get_vm_volumes($conf); my $loopdevlist = PVE::LXC::Config->get_vm_volumes($conf, 'rootfs');