From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id A46371FF0A7 for ; Mon, 17 Aug 2026 14:29:52 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 62EBD23DBB; Mon, 17 Aug 2026 14:29:50 +0200 (CEST) Message-ID: <1a0890cd-f5f7-450f-8408-25618aecb061@proxmox.com> Date: Mon, 17 Aug 2026 14:29:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: applied: [PATCH v2 qemu-server] cloud-init: commit: activate volume early enough to fix regression with qcow2 on LVM From: Fiona Ebner To: pve-devel@lists.proxmox.com References: <20260817103032.73185-1-f.ebner@proxmox.com> Content-Language: en-US In-Reply-To: <20260817103032.73185-1-f.ebner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1786969765419 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.233 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NPEUTJFRER6DIHU3GOH4IQWOVEG2M4L6 X-Message-ID-Hash: NPEUTJFRER6DIHU3GOH4IQWOVEG2M4L6 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 17.08.26 um 12:30 PM schrieb Fiona Ebner: > Since pve-storage commit 05032c5 ("fix #7811: storage: lvm: reject > allocation on format and volume name mismatch") and its follow-ups, > cloud-init disks are named with a '.qcow2' extension on LVM storages > with snapshot-as-volume-chain enabled. > > This causes a regression, because volume_size_info() fails and returns > undef when the qcow2 volume is not active. When the size cannot be > determined, commit_cloudinit_disk() function assumes that the disk > does not yet exist and tries to allocate new disk with the same name, > which fails. > > # qm start 100 > failed to stat '/dev/lvm/vm-100-cloudinit.qcow2' > Rounding up size to full physical extent 8.00 MiB > lvcreate 'lvm/vm-100-cloudinit.qcow2' error: Logical Volume > "vm-100-cloudinit.qcow2" already exists in volume group "lvm" > > Fix the issue by activating the volume early enough. > > Note that activate_volumes() also activates the storage, which fixes > another bug, since nothing ensured that the storage was active before. > For a VM with just the cloud-init disk on the 'nfs' storage: > > # umount /mnt/pve/nfs && qm start 100 > failed to stat '/mnt/pve/nfs/images/100/vm-100-cloudinit.raw' > disk image '/mnt/pve/nfs/images/100/vm-100-cloudinit.raw' already exists > > Once there is a proper existence check function in the storage layer, > that can be used instead. For vdisk_list(), not all plugin > implementations filter early for $vollist, so there can be overhead > and some plugins even might fail when there are issues with unrelated > volumes. Even if using an eval block, if the cloud-init volume already > exists, but vdisk_list() fails, it would be detected as the volume not > existing and then allocation would fail. The current approach with > activation avoids that an issue with a different volume blocks VM > start. > > Signed-off-by: Fiona Ebner Applied, with Dominik's feedback incorporated, thank you very much for the review! [1/1] cloud-init: commit: activate volume early enough to fix regression with qcow2 on LVM commit f0c2cc3bee10daadd153cbfae8e92d5678032a6a