* [PATCH qemu-server] api: create disks: use correct volume name for cloudinit on a snapshot-as-volume-chain storage
@ 2026-08-07 11:59 Fiona Ebner
2026-08-07 12:13 ` Max R. Carrara
0 siblings, 1 reply; 3+ messages in thread
From: Fiona Ebner @ 2026-08-07 11:59 UTC (permalink / raw)
To: pve-devel
The pve-storage commit 05032c5 ("fix #7811: storage: lvm: reject
allocation on format and volume name mismatch") exposed an issue with
handling the name of the cloudinit name on an LVM storage with
snapshot-as-volume-chain. The guest layer passes a fixed name for the
cloudinit drive, but this does not match what the storage layer needs,
because it was missing the .qcow2 extension. Fix the issue by catching
that case.
This is a stop-gap fix. In the long run, constructing the name should
not be done in the guest layer, rather the storage plugin should be
queried for a valid name first.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/API2/Qemu.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 39c725d0..3320313c 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -495,6 +495,9 @@ my sub create_disks : prototype($$$$$$$$$$$) {
if ($scfg->{path}) {
$fmt = $disk->{format} // "qcow2";
$name .= ".$fmt";
+ } elsif ($scfg->{'snapshot-as-volume-chain'}) {
+ $fmt = $disk->{format} // "qcow2";
+ $name .= ".$fmt" if $fmt eq 'qcow2';
} else {
$fmt = $disk->{format} // "raw";
}
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH qemu-server] api: create disks: use correct volume name for cloudinit on a snapshot-as-volume-chain storage
2026-08-07 11:59 [PATCH qemu-server] api: create disks: use correct volume name for cloudinit on a snapshot-as-volume-chain storage Fiona Ebner
@ 2026-08-07 12:13 ` Max R. Carrara
2026-08-07 12:17 ` Fiona Ebner
0 siblings, 1 reply; 3+ messages in thread
From: Max R. Carrara @ 2026-08-07 12:13 UTC (permalink / raw)
To: Fiona Ebner, pve-devel
On Fri Aug 7, 2026 at 1:59 PM CEST, Fiona Ebner wrote:
> The pve-storage commit 05032c5 ("fix #7811: storage: lvm: reject
> allocation on format and volume name mismatch") exposed an issue with
> handling the name of the cloudinit name on an LVM storage with
> snapshot-as-volume-chain. The guest layer passes a fixed name for the
> cloudinit drive, but this does not match what the storage layer needs,
> because it was missing the .qcow2 extension. Fix the issue by catching
> that case.
>
> This is a stop-gap fix. In the long run, constructing the name should
> not be done in the guest layer, rather the storage plugin should be
> queried for a valid name first.
>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
Just gave this a spin and can confirm that it works as expected.
Before applying this patch, the LVM storage w/ SaVC enabled refused the
cloudinit drive ('does not match requested format "qcow2"') -- with the
patch applied, the cloudinit drive can be added again without issues.
Unless there's something I have missed, this LGTM. Nice job!
Consider:
Tested-by: Max R. Carrara <m.carrara@proxmox.com>
> src/PVE/API2/Qemu.pm | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
> index 39c725d0..3320313c 100644
> --- a/src/PVE/API2/Qemu.pm
> +++ b/src/PVE/API2/Qemu.pm
> @@ -495,6 +495,9 @@ my sub create_disks : prototype($$$$$$$$$$$) {
> if ($scfg->{path}) {
> $fmt = $disk->{format} // "qcow2";
> $name .= ".$fmt";
> + } elsif ($scfg->{'snapshot-as-volume-chain'}) {
> + $fmt = $disk->{format} // "qcow2";
> + $name .= ".$fmt" if $fmt eq 'qcow2';
> } else {
> $fmt = $disk->{format} // "raw";
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH qemu-server] api: create disks: use correct volume name for cloudinit on a snapshot-as-volume-chain storage
2026-08-07 12:13 ` Max R. Carrara
@ 2026-08-07 12:17 ` Fiona Ebner
0 siblings, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-08-07 12:17 UTC (permalink / raw)
To: Max R. Carrara, pve-devel
Am 07.08.26 um 2:13 PM schrieb Max R. Carrara:
> On Fri Aug 7, 2026 at 1:59 PM CEST, Fiona Ebner wrote:
>> The pve-storage commit 05032c5 ("fix #7811: storage: lvm: reject
>> allocation on format and volume name mismatch") exposed an issue with
>> handling the name of the cloudinit name on an LVM storage with
>> snapshot-as-volume-chain. The guest layer passes a fixed name for the
>> cloudinit drive, but this does not match what the storage layer needs,
>> because it was missing the .qcow2 extension. Fix the issue by catching
>> that case.
>>
>> This is a stop-gap fix. In the long run, constructing the name should
>> not be done in the guest layer, rather the storage plugin should be
>> queried for a valid name first.
>>
>> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
>> ---
>
> Just gave this a spin and can confirm that it works as expected.
>
> Before applying this patch, the LVM storage w/ SaVC enabled refused the
> cloudinit drive ('does not match requested format "qcow2"') -- with the
> patch applied, the cloudinit drive can be added again without issues.
>
> Unless there's something I have missed, this LGTM. Nice job!
>
> Consider:
>
> Tested-by: Max R. Carrara <m.carrara@proxmox.com>
Thanks for testing! Applied as
[1/1] api: create disks: use correct volume name for cloudinit on a
snapshot-as-volume-chain storage
commit: f869fe838e08499778197ab660516b5e84efad9f
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-07 12:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 11:59 [PATCH qemu-server] api: create disks: use correct volume name for cloudinit on a snapshot-as-volume-chain storage Fiona Ebner
2026-08-07 12:13 ` Max R. Carrara
2026-08-07 12:17 ` Fiona Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox