Bug 1348805
| Summary: | Import vm from export domain using REST API returns "Internal Server Error" | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine | Reporter: | Raz Tamir <ratamir> |
| Component: | RestAPI | Assignee: | Juan Hernández <juan.hernandez> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Raz Tamir <ratamir> |
| Severity: | urgent | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 4.0.0 | CC: | bugs, gklein, mperina |
| Target Milestone: | ovirt-4.0.1 | Keywords: | Automation, Regression |
| Target Release: | 4.0.1.1 | Flags: | rule-engine:
ovirt-4.0.z+
rule-engine: blocker+ rule-engine: planning_ack+ juan.hernandez: devel_ack+ rule-engine: testing_ack+ |
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-08-04 13:31:29 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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 |
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: