From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8314B73A02 for ; Wed, 7 Jul 2021 10:45:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6F9F92CCA7 for ; Wed, 7 Jul 2021 10:44:41 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id C07302CC9B for ; Wed, 7 Jul 2021 10:44:39 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6FEC840CE9 for ; Wed, 7 Jul 2021 10:44:33 +0200 (CEST) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Wed, 7 Jul 2021 10:44:19 +0200 Message-Id: <20210707084419.2264646-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.353 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager] pve6to7: add check for 'lxc.cgroup.' keys in container config X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2021 08:45:11 -0000 The check is rather straight forward - and might help users who passthrough devices to their containers. Reported in our community forum: https://forum.proxmox.com/threads/pve-7-0-lxc-intel-quick-sync-passtrough-not-working-anymore.92025/ Signed-off-by: Stoiko Ivanov --- Tested quickly by pasting the lxc.cgroup.devices keys from the thread into a container config. PVE/CLI/pve6to7.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/PVE/CLI/pve6to7.pm b/PVE/CLI/pve6to7.pm index 629d6935..a4a0bc67 100644 --- a/PVE/CLI/pve6to7.pm +++ b/PVE/CLI/pve6to7.pm @@ -995,6 +995,30 @@ sub check_containers_cgroup_compat { } }; +sub check_lxc_conf_keys { + my $kernel_cli = PVE::Tools::file_get_contents('/proc/cmdline'); + if ($kernel_cli =~ /systemd.unified_cgroup_hierarchy=0/){ + log_skip("System explicitly configured for legacy hybrid cgroup hierarchy."); + return; + } + + log_info("Checking container configs for deprecated lxc.cgroup entries"); + + my $affected_ct = []; + my $cts = PVE::LXC::config_list(); + for my $vmid (sort { $a <=> $b } keys %$cts) { + my $lxc_raw_conf = PVE::LXC::Config->load_config($vmid)->{lxc}; + push @$affected_ct, "CT $vmid" if (grep (@$_[0] =~ /^lxc\.cgroup\./, @$lxc_raw_conf)); + } + if (scalar($affected_ct->@*) > 0) { + log_warn("Config of the following containers contains 'lxc.cgroup' keys, which will be ". + "ignored in a unified cgroupv2 system:\n" . + join(", ", $affected_ct->@*)); + } else { + log_pass("No legacy 'lxc.cgroup' keys found."); + } +} + sub check_misc { print_header("MISCELLANEOUS CHECKS"); my $ssh_config = eval { PVE::Tools::file_get_contents('/root/.ssh/config') }; @@ -1090,6 +1114,7 @@ sub check_misc { check_custom_pool_roles(); check_description_lengths(); check_storage_content(); + check_lxc_conf_keys(); } __PACKAGE__->register_method ({ -- 2.30.2