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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id EF2BE70E8D for ; Wed, 9 Jun 2021 13:54:50 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DCAAD2391F for ; Wed, 9 Jun 2021 13:54:20 +0200 (CEST) Received: from kvmformation3.odiso.net (globalOdiso.M6Lille.odiso.net [89.248.211.242]) by firstgate.proxmox.com (Proxmox) with ESMTP id CB2F6238D2 for ; Wed, 9 Jun 2021 13:54:18 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 8337BD192F; Wed, 9 Jun 2021 13:54:18 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Wed, 9 Jun 2021 13:54:10 +0200 Message-Id: <20210609115417.3326775-1-aderumier@odiso.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.975 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% HEADER_FROM_DIFFERENT_DOMAINS 0.248 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods KHOP_HELO_FCRDNS 0.398 Relay HELO differs from its IP's reverse DNS NO_DNS_FOR_FROM 0.001 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemu.pm, cloudinit.pm, qm.pm, qemuserver.pm] Subject: [pve-devel] [PATCH v3 qemu-server 0/7] cloudinit pending behaviour change 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, 09 Jun 2021 11:54:51 -0000 Hi, This is an attempt to cleanup current behaviour of cloudinit online changes. Currently, we setup cloudinit options as pending, until we generate the config drive. This is not 100% true, because some option like vm name, nic mac address can be changed, without going to pending, so user can't known if it need to regenerated it. Also custom config can be done with snippets file, without any pending state. Also, some can are very difficult to handle, if you hotplug a nic but it's failing,so pending, then you defined an ipconfig, and then you revert hotplug. (This will be really usefull with ipam implementation, where ipconfig pending state is really needed, as we need to follow the pending state of the netX interface) So, instead of setting cloudinit values in pending, this patch serie extract the current config from the cloudinit drive and compare it to vm config (pending config). (Currently the vm config is simply copied inside the iso at generation, but we could implemented configdrive format parsers) A new specific cloudinit config api is added too, merging ipaddrX && netX mac in same field, and displaying the diff between current and generated config. (we could implemented read config from custom snippet too later) Changelog V1: - use [special:cloudinit] instead [CLOUDINIT] for section - delete config section on drive removal - config api: move code to new PVE::QemuServer::Cloudinit::get_pending_config - config api: add "qm cloudinit pending" cli - add update api to regenerate drive with 1 api call - add cloudinit hotplug option Changelog v2: - fix trailing whitespace in first patch - revert previous "cloudinit" check in snapshot name (":" character is already forbidden) Changelog v3: - extract the current conf from cloudinit drive instead write the special cloudinit section Alexandre Derumier (7): cloudinit: add vm config to cloudinit drive cloudinit: generate cloudinit drive on offline plug cloudinit: make cloudnit options fastplug api2: add cloudinit config api cloudinit : add extract_cloudinit_config api2: add cloudinit_update add cloudinit hotplug PVE/API2/Qemu.pm | 118 ++++++++++++++++++++++++++++++++++ PVE/CLI/qm.pm | 2 + PVE/QemuServer.pm | 81 ++++++++++++++--------- PVE/QemuServer/Cloudinit.pm | 125 ++++++++++++++++++++++++++++++++++++ 4 files changed, 296 insertions(+), 30 deletions(-) -- 2.20.1