[pve-devel] [PATCH qemu-server] fix cloning of cloudinit disks in raw format on file level storages

Mira Limbeck m.limbeck at proxmox.com
Tue Dec 1 15:53:01 CET 2020


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 at 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






More information about the pve-devel mailing list