[pve-devel] [PATCH container] apply pending changes in lxc poststop hook
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Nov 22 14:19:56 CET 2019
On 11/22/19 12:32 PM, Oguz Bektas wrote:
> hi,
>
> On Fri, Nov 22, 2019 at 09:18:34AM +0100, Thomas Lamprecht wrote:
>> On 11/21/19 5:48 PM, Oguz Bektas wrote:
>>> diff --git a/src/lxc-pve-poststop-hook b/src/lxc-pve-poststop-hook
>>> index 19d0b52..64fe54d 100755
>>> --- a/src/lxc-pve-poststop-hook
>>> +++ b/src/lxc-pve-poststop-hook
>>> @@ -38,6 +38,14 @@ PVE::LXC::Tools::lxc_hook('post-stop', 'lxc', sub {
>>> PVE::Network::veth_delete("veth${vmid}i$ind");
>>> }
>>>
>>> + my $config_updated = 0;
>>> + if ($conf->{pending}) {
>>> + PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storage_cfg);
>>
>> we may want to eval this statement, and just warn the errors it throws,
>> It may error but that should _not_ abort a reboot, config re-generation
>> can be done nonetheless, so just above would be enough to wrap:
>>
>> eval { PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storage_cfg) };
>> warn "$@" if $@;
>
> that shouldn't happen i think.
>
> vmconfig_apply_pending's default behaviour is not to die and just log the
> errors. so with an un-appliable pending change the task isn't aborted.
>
> is there a case where it actually aborts the reboot?
>
no idea, but better safe than sorry.
More information about the pve-devel
mailing list