]> git.proxmox.com Git - qemu-server.git/commitdiff
api: fix ova live import by using correct format for source image master
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 20 Jan 2025 15:57:05 +0000 (16:57 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Jan 2025 17:49:41 +0000 (18:49 +0100)
Commit c8ed1ac2 ("api: create disks: live import: use format from
storage layer") broke live import from an OVA containing a disk,
because a combined format like 'ova+vmdk' was used for the live-import
disk mapping, leading to failure:

> invalid format 'ova+vmdk' for 'scsi0' mapping

There was also an informational message about the confusion earlier:

> file_size_info: '/mnt/pve/dir/images/135/vm-135-disk-0.vmdk': \
> falling back to 'raw' from unknown format 'ova+vmdk

Fixes: c8ed1ac2 ("api: create disks: live import: use format from storage layer")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/API2/Qemu.pm

index 45fe6ea6fc53081613cf8aefa3f2a39e8fbbda93..295260e7c6178836c649dc60dd009f1ed3f2a740 100644 (file)
@@ -29,7 +29,7 @@ use PVE::QemuConfig;
 use PVE::QemuServer;
 use PVE::QemuServer::Cloudinit;
 use PVE::QemuServer::CPUConfig;
-use PVE::QemuServer::Drive qw(checked_parse_volname);
+use PVE::QemuServer::Drive qw(checked_volume_format checked_parse_volname);
 use PVE::QemuServer::Helpers;
 use PVE::QemuServer::ImportDisk;
 use PVE::QemuServer::Monitor qw(mon_cmd);
@@ -450,6 +450,7 @@ my sub create_disks : prototype($$$$$$$$$$$) {
                        print "finished extracting to $extracted_volid\n";
                        push @$vollist, $extracted_volid;
                        $source = $extracted_volid;
+                       $source_format = checked_volume_format($storecfg, $source);
 
                        my (undef, undef, undef, $parent)
                            = PVE::Storage::volume_size_info($storecfg, $source);