Description of problem: When importing a vm from an export domain using REST API I get "Internal Server Error" but the operation succeeds. Version-Release number of selected component (if applicable): ovirt-engine-4.0.0.5-0.1.el7ev.noarch How reproducible: 100% Steps to Reproduce: Setup: - Make sure you have an export domain with vm already exported to it 1. Import the vm: send POST request to /api/storagedomains/{sd_id}/vms/{vm_id}/import : <action> <async>true</async> <grace_period> <expiry>10</expiry> </grace_period> <storage_domain> <name>iscsi_1</name> </storage_domain> <cluster> <name>golden_env_mixed_1</name> </cluster> <vm> <name>test</name> <snapshots> <collapse_snapshots>true</collapse_snapshots> </snapshots> </vm> <clone>true</clone> </action> 2. 3. Actual results: return code - 500 return body - <html> <head> <title>Error</title> </head> <body>Internal Server Error</body> </html> Expected results: Additional info:
What version of the API are you using? Note that in version 4 of the API the "collapse_snapshots" element was removed, as it is not really an attribute of the snapshots collection. It has been replaced by a "collapse_snapshots" URL parameter, so the request should look like this: ---8<--- POST /storagedomains/{sd:id}/vms/{vm:id}/import?collapse_snapshots=true Version: 4 <action> <storage_domain> <name>iscsi_1</name> </storage_domain> <cluster> <name>golden_env_mixed_1</name> </cluster> <vm> <name>test</name> </vm> <clone>true</clone> </action> --->8--- This works correctly. In version 3 of the API there the problem is that the backwards compatibility layer tries to populate the IP addresses reported by the guest agent, and that isn't possible for the VM object returned by the import operation, as that VM doesn't exist yet.
Hi Juan, I'm using API v3
Verified on rhevm-4.0.1.1-0.1.el7ev.noarch