Hello virt folks,

Background:

I'm using the REST API to import a VM from an attached export domain. The VM was imported using the virt-v2v tool. I've tried this with cURL and with the python SDK, both yield the same error message.

RHEVM Version: 3.5.6.0-1
Python SDK Version: 3.5.6.0-1

According to the documentation, importing should follow this syntax:

> POST /ovirt-engine/api/storagedomains/{storagedomain:id}/vms/{vm:id}/import

With a small <action> body attached. In theory (by the documentation and bug tracker [1]) either of these XML documents (both in the same paste) should work:

http://fpaste.org/309944/52627148/

However, this fails with the following error message (full response in [2])

> Cannot import VM. Storage Domain type not specified.


Steps to reproduce:

1. Import a VM into an export storage domain
2. Create an XML document with an action like this (filling in the correct values for the ID variables)

<action>
  <cluster id="<CLUSTER_ID>"/>
  <storage_domain id="<STORAGE_DOMAIN_ID>">
    <type>export</type>
  </storage_domain>
  <clone>True</clone>
  <vm>
    <name>IMPORTED_VM</name>
  </vm>
</action>

3. POST to the import location (again, substitute the correct ID variables in the location)

/ovirt-engine/api/storagedomains/<STORAGE_DOMAIN_ID>/vms/<VM_ID>/import


Where is this storage domain type supposed to be defined, if not inside of the storage_domain element as demonstrated in the documentation?

I would appreciate any advice you can offer or pointers to useful resources/documentation.

Thanks!


[1] https://bugzilla.redhat.com/show_bug.cgi?id=1147011#c13
[2] http://fpaste.org/309949/14526274/

--
Tim Bielawa
1BA0 4FAB 4C13 FBA0 A036  4958 AD05 E75E 0333 AE37