public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] fix cloning of cloudinit disks in raw format on file level storages
@ 2020-12-01 14:53 Mira Limbeck
  2020-12-02 11:27 ` Mira Limbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Mira Limbeck @ 2020-12-01 14:53 UTC (permalink / raw)
  To: pve-devel

We only added the format extension when it was not 'raw'. But on file level
storages we always require it. To fix this, always add the format
extension if the storage provides the 'path' property.
This is the same logic we use in create_disks for cloudinit disks.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
 PVE/QemuServer.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 4989938..73dcb05 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6945,7 +6945,10 @@ sub clone_disk {
 	my $size = undef;
 	if (drive_is_cloudinit($drive)) {
 	    $name = "vm-$newvmid-cloudinit";
-	    $name .= ".$dst_format" if $dst_format ne 'raw';
+	    my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
+	    if ($scfg->{path}) {
+		$name .= ".$dst_format";
+	    }
 	    $snapname = undef;
 	    $size = PVE::QemuServer::Cloudinit::CLOUDINIT_DISK_SIZE;
 	} elsif ($drivename eq 'efidisk0') {
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] fix cloning of cloudinit disks in raw format on file level storages
  2020-12-01 14:53 [pve-devel] [PATCH qemu-server] fix cloning of cloudinit disks in raw format on file level storages Mira Limbeck
@ 2020-12-02 11:27 ` Mira Limbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Mira Limbeck @ 2020-12-02 11:27 UTC (permalink / raw)
  To: pve-devel

Only fixes the clone_disk case, not the restore from backup one. Will 
send a v2 with both fixes.

On 12/1/20 3:53 PM, Mira Limbeck wrote:
> We only added the format extension when it was not 'raw'. But on file level
> storages we always require it. To fix this, always add the format
> extension if the storage provides the 'path' property.
> This is the same logic we use in create_disks for cloudinit disks.
>
> Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
> ---
>   PVE/QemuServer.pm | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 4989938..73dcb05 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -6945,7 +6945,10 @@ sub clone_disk {
>   	my $size = undef;
>   	if (drive_is_cloudinit($drive)) {
>   	    $name = "vm-$newvmid-cloudinit";
> -	    $name .= ".$dst_format" if $dst_format ne 'raw';
> +	    my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
> +	    if ($scfg->{path}) {
> +		$name .= ".$dst_format";
> +	    }
>   	    $snapname = undef;
>   	    $size = PVE::QemuServer::Cloudinit::CLOUDINIT_DISK_SIZE;
>   	} elsif ($drivename eq 'efidisk0') {




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-02 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 14:53 [pve-devel] [PATCH qemu-server] fix cloning of cloudinit disks in raw format on file level storages Mira Limbeck
2020-12-02 11:27 ` Mira Limbeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal