Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 19:03 schrieb Filip Schauer:
> On 18/11/2024 18:53, Thomas Lamprecht wrote:
>> diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm 
>> index 4af58ed..ed6fcea 100644 --- a/src/PVE/GuestImport/OVF.pm +++ 
>> b/src/PVE/GuestImport/OVF.pm @@ -191,6 +191,7 @@ sub parse_ovf { # 
>> 'ovf' is the default namespace so it will prepended to each xml 
>> element my $xpc = XML::LibXML::XPathContext->new($dom); 
>> $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1'); + 
>> $xpc->registerNs('vmw', 'http://www.vmware.com/schema/ovf'); 
>> $xpc->registerNs('rasd', 
>> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData');
>>  
>> $xpc->registerNs('vssd', 
>> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');
> 
> This fixes the XPath error, but the "name" text box in the import dialog
> is empty. When giving it a name and clicking "Import" a VM is
> immediately created but it has no disks.
> 

I now got the GNS3 and CentOS images you linked too to work, needed a few
improvements, but seem all not _that_ quirky. I applied them on top of
Dominik's series:

https://git.proxmox.com/?p=pve-storage.git;a=shortlog;h=811aa863cb66c1f49e6e4bd725c94626ed5082b5


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 19:03 schrieb Filip Schauer:
> On 18/11/2024 18:53, Thomas Lamprecht wrote:
>> diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm 
>> index 4af58ed..ed6fcea 100644 --- a/src/PVE/GuestImport/OVF.pm +++ 
>> b/src/PVE/GuestImport/OVF.pm @@ -191,6 +191,7 @@ sub parse_ovf { # 
>> 'ovf' is the default namespace so it will prepended to each xml 
>> element my $xpc = XML::LibXML::XPathContext->new($dom); 
>> $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1'); + 
>> $xpc->registerNs('vmw', 'http://www.vmware.com/schema/ovf'); 
>> $xpc->registerNs('rasd', 
>> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData');
>>  
>> $xpc->registerNs('vssd', 
>> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');
> 
> This fixes the XPath error, but the "name" text box in the import dialog
> is empty. When giving it a name and clicking "Import" a VM is
> immediately created but it has no disks.

And FWIW, pveproxy does indeed log the following for GNS3:

pvedaemon[2813654]: warning: unable to parse the VM name in this OVF manifest, 
generating a default value
pvedaemon[2813654]: invalid host resource /disk/vmdisk1, skipping
pvedaemon[2813654]: invalid host resource /disk/vmdisk2, skipping


@Dominik, should we use the RPCEnv log_warn (or on info level) so that those
make it also into the task log? I mean, they should not really expose anything
hidden/secret, the OVA file is user provided after all and if anybody can use
it for an import they also should be able to see odd quirks?


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 19:03 schrieb Filip Schauer:
> On 18/11/2024 18:53, Thomas Lamprecht wrote:
>> diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm 
>> index 4af58ed..ed6fcea 100644 --- a/src/PVE/GuestImport/OVF.pm +++ 
>> b/src/PVE/GuestImport/OVF.pm @@ -191,6 +191,7 @@ sub parse_ovf { # 
>> 'ovf' is the default namespace so it will prepended to each xml 
>> element my $xpc = XML::LibXML::XPathContext->new($dom); 
>> $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1'); + 
>> $xpc->registerNs('vmw', 'http://www.vmware.com/schema/ovf'); 
>> $xpc->registerNs('rasd', 
>> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData');
>>  
>> $xpc->registerNs('vssd', 
>> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');
> 
> This fixes the XPath error, but the "name" text box in the import dialog
> is empty. When giving it a name and clicking "Import" a VM is
> immediately created but it has no disks.

That is another issue though. Some other detections, like the two vNICs for GNS3
does work, so I guess here we just will need to add a few quirks for common
and/or popular OVA.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Filip Schauer

On 18/11/2024 18:53, Thomas Lamprecht wrote:
diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm 
index 4af58ed..ed6fcea 100644 --- a/src/PVE/GuestImport/OVF.pm +++ 
b/src/PVE/GuestImport/OVF.pm @@ -191,6 +191,7 @@ sub parse_ovf { # 
'ovf' is the default namespace so it will prepended to each xml 
element my $xpc = XML::LibXML::XPathContext->new($dom); 
$xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1'); + 
$xpc->registerNs('vmw', 'http://www.vmware.com/schema/ovf'); 
$xpc->registerNs('rasd', 
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData'); 
$xpc->registerNs('vssd', 
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');


This fixes the XPath error, but the "name" text box in the import dialog
is empty. When giving it a name and clicking "Import" a VM is
immediately created but it has no disks.



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 18:53 schrieb Thomas Lamprecht:
> diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm
> index 4af58ed..ed6fcea 100644
> --- a/src/PVE/GuestImport/OVF.pm
> +++ b/src/PVE/GuestImport/OVF.pm
> @@ -191,6 +191,7 @@ sub parse_ovf {
>  # 'ovf' is the default namespace so it will prepended to each xml element
>  my $xpc = XML::LibXML::XPathContext->new($dom);
>  $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1');
> +$xpc->registerNs('vmw', 'http://www.vmware.com/schema/ovf');
>  $xpc->registerNs('rasd', 
> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData');
>  $xpc->registerNs('vssd', 
> 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');
>  

both, the GNS3 VirtualBox and the CentOS 7 image you linked work with above.
So I would just commit that as follow-up, or do you have other results?


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 18:49 schrieb Thomas Lamprecht:
> Am 18.11.24 um 18:44 schrieb Filip Schauer:
>> I tried importing the GNS3 OVA files found here:
>> https://www.gns3.com/software/download-vm
>>
>> I got the same XPath error with the VirtualBox file.
> 
> Can you try something like:
> 
> diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm
> index 4af58ed..0348807 100644
> --- a/src/PVE/GuestImport/OVF.pm
> +++ b/src/PVE/GuestImport/OVF.pm
> @@ -191,6 +191,7 @@ sub parse_ovf {
>  # 'ovf' is the default namespace so it will prepended to each xml element
>  my $xpc = XML::LibXML::XPathContext->new($dom);
>  $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1');
> +$xpc->registerNs('vmf', 'http://schemas.dmtf.org/ovf/envelope/1'); # 
> FIXME: fix schema URL

I meant to write s/vmf/vmw/ i.e.:

diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm
index 4af58ed..ed6fcea 100644
--- a/src/PVE/GuestImport/OVF.pm
+++ b/src/PVE/GuestImport/OVF.pm
@@ -191,6 +191,7 @@ sub parse_ovf {
 # 'ovf' is the default namespace so it will prepended to each xml element
 my $xpc = XML::LibXML::XPathContext->new($dom);
 $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1');
+$xpc->registerNs('vmw', 'http://www.vmware.com/schema/ovf');
 $xpc->registerNs('rasd', 
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData');
 $xpc->registerNs('vssd', 
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');
 


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 18:44 schrieb Filip Schauer:
> I tried importing the GNS3 OVA files found here:
> https://www.gns3.com/software/download-vm
> 
> I got the same XPath error with the VirtualBox file.

Can you try something like:

diff --git a/src/PVE/GuestImport/OVF.pm b/src/PVE/GuestImport/OVF.pm
index 4af58ed..0348807 100644
--- a/src/PVE/GuestImport/OVF.pm
+++ b/src/PVE/GuestImport/OVF.pm
@@ -191,6 +191,7 @@ sub parse_ovf {
 # 'ovf' is the default namespace so it will prepended to each xml element
 my $xpc = XML::LibXML::XPathContext->new($dom);
 $xpc->registerNs('ovf', 'http://schemas.dmtf.org/ovf/envelope/1');
+$xpc->registerNs('vmf', 'http://schemas.dmtf.org/ovf/envelope/1'); # 
FIXME: fix schema URL
 $xpc->registerNs('rasd', 
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData');
 $xpc->registerNs('vssd', 
'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData');



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Thomas Lamprecht
Am 18.11.24 um 18:35 schrieb Aaron Lauterer:
>> Upon clicking "Import" in the web UI the "Import Guest" dialog opens
>> along with an error message stating:
>> XPath error : Undefined namespace prefix at /usr/share/perl5/PVE/ 
>> GuestImport/OVF.pm line 239. (500)
> I untar'ed that OVA and inspected the OVF. The filter for that is:
>  my $xpath_find_firmware = 
> "/ovf:Envelope/ovf:VirtualSystem/ovf:VirtualHardwareSection/vmw:Config[\@vmw:key=\"firmware\"]/\@vmw:value";
> 
> The GNS3 OVF does have `vmw:Config` elements, though none for the 
> firmware -> Default SeaBIOS
> 
> The CentOS OVF does not have any `vmw:Config` sub elements in that 
> search path. That is probably what is causing the issue.

There might also be a 

$xpc->registerNs('vmw', "???");

missing further above?

But I need to relearn that xpath/xml stuff, I was blessed for way to long
to just ignore (and forget) most of it.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Filip Schauer

I tried importing the GNS3 OVA files found here:
https://www.gns3.com/software/download-vm

I got the same XPath error with the VirtualBox file.

The ESXi and Workstation & Fusion OVA files were imported successfully
and they boot aswell.


On 18/11/2024 18:14, Filip Schauer wrote:

Hello,

I tried to quickly test the OVA import with a CentOS 7 OVA file that I
downloaded from:
https://dlconusc1.linuxvmimages.com/046389e06777452db2ccf9a32efa3760:dldatac/VirtualBox/C/7/CentOS_7.9.2009_VBM.zip 



6785cb04dc5e7ab5a28ec139f631dfc8aeb8a6278c5fc66e1e7030d3f5a83b18 
/var/lib/vz/import/CentOS_7.9.2009_VBM_LinuxVMImages.COM.ova


After enabling the "import" content type on my local directory storage,
the ova file shows up in the import section of the storage.

Upon clicking "Import" in the web UI the "Import Guest" dialog opens
along with an error message stating:
XPath error : Undefined namespace prefix at 
/usr/share/perl5/PVE/GuestImport/OVF.pm line 239. (500)


Closing the error message also closes the import dialog, preventing me
from importing.

The same thing happens with this ArcoLinux OVA file:
https://master.dl.sourceforge.net/project/linuxovafiles/GUI/ArcoLinux-vm.ova?viasf=1 
to /var/lib/vz/import/ArcoLinux-vm.ova


2b353ac59598bac24d4cf0721e367935d00178a31d84e09c94425bdee3dab6a1 
/var/lib/vz/import/ArcoLinux-vm.ova


Tested-by: Filip Schauer 

On 18/11/2024 16:29, Dominik Csapak wrote:

This series enables importing ova/ovf from directory based storages,
inclusive upload/download via the webui (ova only).

It also improves the ovf importer by parsing the ostype, nics, bootorder
(and firmware from vmware exported files).

We now extract the images into either a given target storage or in the
import storage in the 'images' dir so accidentally left over images
are discoverable by the ui/cli.

This version includes a modified qemu-server patch of fabians 
hardening series:
https://lore.proxmox.com/pve-devel/20241104104221.228730-1-f.gruenbich...@proxmox.com/ 



I sent the qemu-server patch from fabian again but omitted some
problematic checks. I add them later with a check
against the import vtype again (last patch in qemu-server)

changes from v6:
* rebase on master (omit already applied patches)
* style/indentation fixes
* omit explicit check for .ova in upload path
* use assert_file_validity check for download_file_from_url
* only warn on whitespace in parent image (file_size_info) to 
preserve backward compatibility

   for possible existing cases
* fix cleanup on live-import  (added wrong variable to cleanup list)
* renamed 'import-extraction-storage' to 'import-working-storage'
* mad priv check for extraction storage simpler (combine branches)
* reworded some gettexts

changes from v5:
* removed leftover hunks in makefile
* moved ova checks to correct patch
* split up error messages for unexpected format
* remove unnecessary untaint
* reword error message
* reintroduce symlink check in ova/ovf check
* added sanity check for ovas after uploading/downloading
* added new patch for checking import vtypes
* fixed issue with files with absolute path

changes from v4:
* rebased on master/fabians series
* added the file_size_info check for untrusted images after extracting

changes from v3:
* fixed dependencies in control file
* removed unnecessary use statements
* removed unnecessary remove helper
* moved 'needs_extract' helper to qemu-server
* removed import storage param from PUT call
* check down/uploaded ova filename more strictly (same as listing)
* improved filepath checking in ovf
* forbid importing when extracted image references a base/backing file
* instead of trying to manually create a proper filename, use 'alloc' to
   create a small (1M) file with the same format and overwrite it with
   renaming. this also solves the cluster locking issue
* prefer using PVE::Storage functions instead of plugin methods in
   ova extraction code
* use $vollist for cleaning up extracted images in qemu-server and
   add manual cleanup for the success case

changes from v2:
* use better 'format' values for embedded images (e.g. ova+vmdk)
* use this format to decide if images should be extracted
* consistent use of the 'safe character' classes when listing
   and parsing
* also list vmdk/qcow2/raw images in content listing
   (this will be useful when we have a gui for the 'import-from'
   in the wizard/disk edit for vms)
* a few gui adaptions


changes from v1:
* move ovf code to GuestImport
* move extract/checking code to GuestImport
* don't return 'image' types from import volumes
* use allow 'safe' characters for filenames of ova/ovfs and inside
* check for non-regular files (e.g. symlinks) after extraction
* add new 'import-extraction-storage' for import
* rename panel in gui for directory storages
* typo fixes
* and probably more, see the individual patches for details

pve-storage:

Dominik Csapak (11):
   plugin: dir: implement import content type
   plugin: dir: handle ova files for import
   ovf: improv

Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Aaron Lauterer




On  2024-11-18  18:14, Filip Schauer wrote:

Hello,

I tried to quickly test the OVA import with a CentOS 7 OVA file that I
downloaded from:
https:// 
dlconusc1.linuxvmimages.com/046389e06777452db2ccf9a32efa3760:dldatac/ 
VirtualBox/C/7/CentOS_7.9.2009_VBM.zip


6785cb04dc5e7ab5a28ec139f631dfc8aeb8a6278c5fc66e1e7030d3f5a83b18 /var/ 
lib/vz/import/CentOS_7.9.2009_VBM_LinuxVMImages.COM.ova


After enabling the "import" content type on my local directory storage,
the ova file shows up in the import section of the storage.

Upon clicking "Import" in the web UI the "Import Guest" dialog opens
along with an error message stating:
XPath error : Undefined namespace prefix at /usr/share/perl5/PVE/ 
GuestImport/OVF.pm line 239. (500)


I untar'ed that OVA and inspected the OVF. The filter for that is:
my $xpath_find_firmware = 
"/ovf:Envelope/ovf:VirtualSystem/ovf:VirtualHardwareSection/vmw:Config[\@vmw:key=\"firmware\"]/\@vmw:value";


The GNS3 OVF does have `vmw:Config` elements, though none for the 
firmware -> Default SeaBIOS


The CentOS OVF does not have any `vmw:Config` sub elements in that 
search path. That is probably what is causing the issue.




Closing the error message also closes the import dialog, preventing me
from importing.

The same thing happens with this ArcoLinux OVA file:
https://master.dl.sourceforge.net/project/linuxovafiles/GUI/ArcoLinux- 
vm.ova?viasf=1 to /var/lib/vz/import/ArcoLinux-vm.ova


2b353ac59598bac24d4cf0721e367935d00178a31d84e09c94425bdee3dab6a1 /var/ 
lib/vz/import/ArcoLinux-vm.ova


Tested-by: Filip Schauer 




___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Filip Schauer

Hello,

I tried to quickly test the OVA import with a CentOS 7 OVA file that I
downloaded from:
https://dlconusc1.linuxvmimages.com/046389e06777452db2ccf9a32efa3760:dldatac/VirtualBox/C/7/CentOS_7.9.2009_VBM.zip

6785cb04dc5e7ab5a28ec139f631dfc8aeb8a6278c5fc66e1e7030d3f5a83b18 
/var/lib/vz/import/CentOS_7.9.2009_VBM_LinuxVMImages.COM.ova


After enabling the "import" content type on my local directory storage,
the ova file shows up in the import section of the storage.

Upon clicking "Import" in the web UI the "Import Guest" dialog opens
along with an error message stating:
XPath error : Undefined namespace prefix at 
/usr/share/perl5/PVE/GuestImport/OVF.pm line 239. (500)


Closing the error message also closes the import dialog, preventing me
from importing.

The same thing happens with this ArcoLinux OVA file:
https://master.dl.sourceforge.net/project/linuxovafiles/GUI/ArcoLinux-vm.ova?viasf=1 
to /var/lib/vz/import/ArcoLinux-vm.ova


2b353ac59598bac24d4cf0721e367935d00178a31d84e09c94425bdee3dab6a1 
/var/lib/vz/import/ArcoLinux-vm.ova


Tested-by: Filip Schauer 

On 18/11/2024 16:29, Dominik Csapak wrote:

This series enables importing ova/ovf from directory based storages,
inclusive upload/download via the webui (ova only).

It also improves the ovf importer by parsing the ostype, nics, bootorder
(and firmware from vmware exported files).

We now extract the images into either a given target storage or in the
import storage in the 'images' dir so accidentally left over images
are discoverable by the ui/cli.

This version includes a modified qemu-server patch of fabians hardening series:
https://lore.proxmox.com/pve-devel/20241104104221.228730-1-f.gruenbich...@proxmox.com/

I sent the qemu-server patch from fabian again but omitted some
problematic checks. I add them later with a check
against the import vtype again (last patch in qemu-server)

changes from v6:
* rebase on master (omit already applied patches)
* style/indentation fixes
* omit explicit check for .ova in upload path
* use assert_file_validity check for download_file_from_url
* only warn on whitespace in parent image (file_size_info) to preserve backward 
compatibility
   for possible existing cases
* fix cleanup on live-import  (added wrong variable to cleanup list)
* renamed 'import-extraction-storage' to 'import-working-storage'
* mad priv check for extraction storage simpler (combine branches)
* reworded some gettexts

changes from v5:
* removed leftover hunks in makefile
* moved ova checks to correct patch
* split up error messages for unexpected format
* remove unnecessary untaint
* reword error message
* reintroduce symlink check in ova/ovf check
* added sanity check for ovas after uploading/downloading
* added new patch for checking import vtypes
* fixed issue with files with absolute path

changes from v4:
* rebased on master/fabians series
* added the file_size_info check for untrusted images after extracting

changes from v3:
* fixed dependencies in control file
* removed unnecessary use statements
* removed unnecessary remove helper
* moved 'needs_extract' helper to qemu-server
* removed import storage param from PUT call
* check down/uploaded ova filename more strictly (same as listing)
* improved filepath checking in ovf
* forbid importing when extracted image references a base/backing file
* instead of trying to manually create a proper filename, use 'alloc' to
   create a small (1M) file with the same format and overwrite it with
   renaming. this also solves the cluster locking issue
* prefer using PVE::Storage functions instead of plugin methods in
   ova extraction code
* use $vollist for cleaning up extracted images in qemu-server and
   add manual cleanup for the success case

changes from v2:
* use better 'format' values for embedded images (e.g. ova+vmdk)
* use this format to decide if images should be extracted
* consistent use of the 'safe character' classes when listing
   and parsing
* also list vmdk/qcow2/raw images in content listing
   (this will be useful when we have a gui for the 'import-from'
   in the wizard/disk edit for vms)
* a few gui adaptions


changes from v1:
* move ovf code to GuestImport
* move extract/checking code to GuestImport
* don't return 'image' types from import volumes
* use allow 'safe' characters for filenames of ova/ovfs and inside
* check for non-regular files (e.g. symlinks) after extraction
* add new 'import-extraction-storage' for import
* rename panel in gui for directory storages
* typo fixes
* and probably more, see the individual patches for details

pve-storage:

Dominik Csapak (11):
   plugin: dir: implement import content type
   plugin: dir: handle ova files for import
   ovf: improve and simplify path checking code
   ovf: implement parsing the ostype
   ovf: implement parsing out firmware type
   ovf: implement rudimentary boot order
   ovf: implement parsing nics
   api: allow ova upload/download
   plugin: enable import for nfs/btrfs/cifs/cephfs/glusterfs
   add 'im

Re: [pve-devel] [PATCH storage/qemu-server/manager v7] implement ova/ovf import for file based storages

2024-11-18 Thread Aaron Lauterer

Gave this series a test.


GNS3 OVA, the following variants:

OVA location -> Target Storage

local -> local:  worked
local -> zfs:worked
local -> lvm-thin:   worked
local -> rbd:worked

cephfs -> any: did not work. got the following error:
---
scsi0: storage selected for extraction does not support 'images' content 
type or is not file based.

---
Which makes me wonder, because in API2/Qemu.pm 184+ we check for 
content->image or if the storage has a path. The the cephfs does have a 
path set.
More inline in [PATCH qemu-server v7 4/5] api: create: add 
'import-working-storage' parameter


Also tested once, overriding the default config:
* CPU type host
* cores
* unique mac
* different vmbr/network
* VirtIO NIC
* VirtIO SCSI controller
* Override the target storage for one of the two disks

Which worked fine.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel