Where can I find a basic OVF template XML for importing VMs into Proxmox?

proxale

Active Member
May 24, 2020
44
4
28
113
I am trying to migrate VMs from various existing platforms into Proxmox and they commonly allow exporting VMs either in OVF or OVA format. Unfortunately, there are various problems when trying to qm importovf because, depending on the platform, they have custom tags which seem to confuse the importer.

I literally have hundreds of VMs to migrate so manually importing their disk images and reconstructing their configuration by reading their individual XML is not a practical approach.

Due to this, I would want to write a script (for each platform) to read the key parameters from their configuration and inject into a template XML that the importer can handle. Does anybody have any idea if such a template exists or can Proxmox provide one?

note: even the xml from a virsh dumpxml of a standard Linux qemu/libvirt system cannot be parsed successfully by the importer.
 
Last edited:
note: even the xml from a virsh dumpxml of a standard Linux qemu/libvirt system cannot be parsed successfully by the importer.
can you post such an xml? we should be able to fix the bugs in such a case
 
XMl from standard KVM virsh dumpxml which produces the following errro with --dryrun
Code:
warning: unable to parse the VM name in this OVF manifest, generating a default value
{
   "disks" : [],
   "qm" : {
      "cores" : "",
      "memory" : ""
   }
}


Without --dryrun
Code:
warning: unable to parse the VM name in this OVF manifest, generating a default value
error during import, cleaning up created resources...
import failed - unable to parse value of 'cores' - type check ('integer') failed - got ''

XML:
<domain type='kvm' id='5'>
  <name>test-kvm-vm</name>
  <uuid>b390d18d-a2f8-45a3-6a7b-17eaa2899de7</uuid>
  <title>KVM VM One</title>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://centos.org/centos/7.0"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>3145728</memory>
  <currentMemory unit='KiB'>3145728</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-3.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>EPYC-Rome</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='tsc_adjust'/>
    <feature policy='require' name='arch-capabilities'/>
    <feature policy='require' name='xsaves'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='virt-ssbd'/>
    <feature policy='disable' name='tsc-scale'/>
    <feature policy='require' name='rdctl-no'/>
    <feature policy='require' name='skip-l1dfl-vmentry'/>
    <feature policy='require' name='mds-no'/>
    <feature policy='require' name='pschange-mc-no'/>
    <feature policy='disable' name='clwb'/>
    <feature policy='disable' name='umip'/>
    <feature policy='disable' name='rdpid'/>
    <feature policy='disable' name='wbnoinvd'/>
    <feature policy='disable' name='amd-stibp'/>
    <feature policy='disable' name='svm'/>
    <feature policy='require' name='topoext'/>
    <feature policy='disable' name='npt'/>
    <feature policy='disable' name='nrip-save'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/shared/test_kvm/test_vm_01.qcow2' index='1'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <alias name='pci.3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <alias name='pci.4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <alias name='pci.5'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x15'/>
      <alias name='pci.6'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0x16'/>
      <alias name='pci.7'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </controller>
    <interface type='direct'>
      <mac address='52:54:00:a7:bc:ad'/>
      <source dev='eno1' mode='bridge'/>
      <target dev='macvtap4'/>
      <model type='virtio'/>
      <link state='up'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:60:6a:62'/>
      <source network='default' portid='0431bdbf-804c-4ded-85d6-464057f1d0b7' bridge='virbr0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
      <link state='down'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-5-test-kvm-vm/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='connected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich9'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
      <address type='usb' bus='0' port='3'/>
    </redirdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </memballoon>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </rng>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c474,c860</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c474,c860</imagelabel>
  </seclabel>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+971:+100</label>
    <imagelabel>+971:+100</imagelabel>
  </seclabel>
</domain>
 
Last edited:
XML from QNAP Virtualization Station also from virsh dumpxml
Generates similar error with --dryrun
Code:
warning: unable to parse the VM name in this OVF manifest, generating a default value
{
   "disks" : [],
   "qm" : {
      "cores" : "",
      "memory" : ""
   }
}

Without --dryrun. the error is slightly different
Code:
warning: unable to parse the VM name in this OVF manifest, generating a default value
error during import, cleaning up created resources...
import failed - unable to parse value of 'memory' - type check ('integer') failed - got ''

XML:
<domain type='kvm'>
  <name>4a3f24fe-1c6e-412c-a784-5faf21bc348b</name>
  <uuid>4a3f24fe-1c6e-412c-a784-5faf21bc348b</uuid>
  <description>QNAP QVS VM
10.1.0.100</description>
  <metadata xmlns:qvs="http://www.qnap.com/schemas/qvs/1.0">
    <qvs:vm>
      <qvs:os arch="x86" type="ubuntufocal"/>
      <qvs:name>QVS_TEST</qvs:name>
      <qvs:auto_start_delay enable="off">0</qvs:auto_start_delay>
      <qvs:qvm enable="no"/>
      <qvs:test enable="no"/>
      <qvs:mom reserved_memory="268435456">0</qvs:mom>
      <qvs:hdds>
        <qvs:hdd bus="virtio" dev="vda" index="1" root="/share/images/QVS_TEST_VM/QVS_TEST_VM.img"/>
      </qvs:hdds>
      <qvs:cdroms>
        <qvs:cdrom bus="ide" dev="hda" index="1"/>
      </qvs:cdroms>
      <qvs:nics>
        <qvs:nic bridge="qvs0" index="1" mac="52:54:00:fd:48:f8" model="virtio" type="bridge"/>
      </qvs:nics>
      <qvs:usbs/>
      <qvs:serialports/>
      <qvs:meta_path>/share/images/QVS_TEST_VM/.4a3f24fe-1c6e-412c-a784-5faf21bc348b.meta</qvs:meta_path>
      <qvs:host_cpu>Intel(R) Xeon(R) CPU E5-2630 v3</qvs:host_cpu>
      <qvs:nas_model>TS-X89U</qvs:nas_model>
      <qvs:snapshot type="external"/>
      <qvs:graphics>
        <qvs:graphics autoport="yes" keymap="en-us" listen="127.0.0.1" type="vnc"/>
      </qvs:graphics>
      <qvs:videos>
        <qvs:video>
          <qvs:model heads="1" type="vmvga" vram="16384"/>
        </qvs:video>
      </qvs:videos>
    </qvs:vm>
  </metadata>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-4.1'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>Nehalem</model>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/QVS/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/share/images/QVS_TEST_VM/QVS_TEST_VM.img' startupPolicy='optional'/>
      <target dev='vda' bus='virtio'/>
      <serial>4a3f24fe1c6e412ca701</serial>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/share/ISO/debian-10.10.0-amd64-DVD-1.iso' startupPolicy='optional'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='nec-xhci' ports='6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:fd:48:f8'/>
      <source bridge='qvs0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <channel type='unix'>
      <source mode='bind' path='/QVS/var/lib/libvirt/qemu/4a3f24fe-1c6e-412c-a784-5faf21bc348b.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='vmvga' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>
 
Funnily enough, I'm having exactly the same issue.

root@pve:/tmp/thing# qm importovf 333 os2_warp_4.ovf store2 -format qcow2 --dryrun warning: unable to parse the VM name in this OVF manifest, generating a default value { "disks" : [], "qm" : { "cores" : "", "memory" : "" } } root@pve:/tmp/thing# qm importovf 333 os2_warp_4.ovf store2 -format qcow2 warning: unable to parse the VM name in this OVF manifest, generating a default value error during import, cleaning up created resources... import failed - unable to parse value of 'memory' - type check ('integer') failed - got ''
 
As I had to get that task done quickly back then, I simply extended my script to generate the commands to create the VM and attach the disks.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!