From c63f405d9ff984c4a4f4fb2bc3dafa81f8534c8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 20 Apr 2016 12:30:42 +0200 Subject: [PATCH] don't keep old existing config when restoring this breaks the expected ranking of configuration options and does not make much sense in any case. --- src/PVE/LXC/Create.pm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm index 6c2c735..6c47ceb 100644 --- a/src/PVE/LXC/Create.pm +++ b/src/PVE/LXC/Create.pm @@ -201,24 +201,10 @@ sub create_rootfs { # destroy old container volume PVE::LXC::destroy_lxc_container($storage_cfg, $vmid, $old_conf); - - # do not copy all settings to restored container - foreach my $opt (qw(rootfs digest snapshots arch ostype unprivileged parent)) { - delete $old_conf->{$opt}; - } - foreach my $opt (keys %$old_conf) { - delete $old_conf->{$opt} if $opt =~ m/^mp\d+$/; - } - - PVE::LXC::Config->update_pct_config($vmid, $conf, 0, $old_conf); - - PVE::LXC::Config->write_config($vmid, $conf); - - } else { - - PVE::LXC::Config->write_config($vmid, $conf); } + PVE::LXC::Config->write_config($vmid, $conf); + eval { my $rootdir = PVE::LXC::mount_all($vmid, $storage_cfg, $conf); restore_and_configure($vmid, $archive, $rootdir, $conf, $password, -- 2.39.5