[pve-devel] [PATCH qemu-server v7 0/6] Add qm importovf command

Emmanuel Kasper e.kasper at proxmox.com
Wed Jun 7 11:37:36 CEST 2017


Changes since V6:
    * refactor smbios1 uuid generation and default bootdisk computation to own subs
    * generate minimal config without going through vm_create api call as most of it
    is useless for us
    * do all creation steps inside lock_config_full
    * rollback the imported VM when import fails

Changes since V5:
    * use Storage.pm package instead of Plugin/Storage.pm when calling file_size_info()
    * allow to optionally set the target disk format when importing an ovf image
    * add some sanity tests on user submitted parameters before parsing and converting
    * rename ovfimport to importovf, like most of our commands
    * import disk images referenced in the OVF file

Changes since V4:
    Improve ovfimport command:
    * make the ovf manifest a mandatory parameter
    * complete the vmid on non existing instead of existing

    Tests (suggestions from Wolfgang):
    * prepend .. to @INC so we use the local version of PVE packages
    * Add ovf_test to test target

    OVF module(suggestions from Wolgang)
    * Add a regexp to match correct characters expected in a HostResource element
    HostResources/ovf:href elements are uri paths components/url, so we test them
    with the according regexp.
    * Test if the disk image the OVF is refering to is contained in the current directory
    to prevent symlinks attacks.

Emmanuel Kasper (6):
  Force overwriting existing compressed man pages and symbolic links
  Add a build dependency to libxml-libxml-perl, needed for OVF parsing
  Initial support for importing OVF virtual machines
  Add tests for parse_ovf function
  Refactor defaut bootdisk and smbios1 uuid generation in own subs
  Add new qm command 'importovf', to create VMs from an OVF manifest

 Makefile                                     |   8 +-
 PVE/API2/Qemu.pm                             |  20 +--
 PVE/CLI/qm.pm                                |  99 +++++++++++
 PVE/QemuServer.pm                            |  20 +++
 PVE/QemuServer/Makefile                      |   1 +
 PVE/QemuServer/OVF.pm                        | 236 +++++++++++++++++++++++++++
 control.in                                   |   2 +-
 test/Makefile                                |   5 +-
 test/ovf_manifests/Win10-Liz-disk1.vmdk      | Bin 0 -> 65536 bytes
 test/ovf_manifests/Win10-Liz.ovf             | 142 ++++++++++++++++
 test/ovf_manifests/Win_2008_R2_two-disks.ovf | 145 ++++++++++++++++
 test/ovf_manifests/disk1.vmdk                | Bin 0 -> 65536 bytes
 test/ovf_manifests/disk2.vmdk                | Bin 0 -> 65536 bytes
 test/run_ovf_tests.pl                        |  42 +++++
 14 files changed, 698 insertions(+), 22 deletions(-)
 create mode 100644 PVE/QemuServer/OVF.pm
 create mode 100644 test/ovf_manifests/Win10-Liz-disk1.vmdk
 create mode 100755 test/ovf_manifests/Win10-Liz.ovf
 create mode 100755 test/ovf_manifests/Win_2008_R2_two-disks.ovf
 create mode 100644 test/ovf_manifests/disk1.vmdk
 create mode 100644 test/ovf_manifests/disk2.vmdk
 create mode 100755 test/run_ovf_tests.pl

-- 
2.11.0





More information about the pve-devel mailing list