Bug 1045350
| Summary: | REST error during VM creation via API | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] oVirt | Reporter: | Sven Kieske <s.kieske> | ||||
| Component: | ovirt-engine-api | Assignee: | Juan Hernández <juan.hernandez> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ondra Machacek <omachace> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 3.3 | CC: | acathrow, bazulay, iheim, juan.hernandez, omachace, tjelinek, yeylon | ||||
| Target Milestone: | --- | ||||||
| Target Release: | 3.4.0 | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | infra | ||||||
| Fixed In Version: | ovirt-3.4.0-alpha1 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-03-31 12:32:38 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1024889 | ||||||
| Attachments: |
|
||||||
|
Description
Sven Kieske
2013-12-20 08:46:12 UTC
Sorry, the Description of the problem was incomplete: Description of problem: When you create a VM via REST-API, it get's successfully created, but you get a Java Exception as answer and no expected HTTP 201 OK with the VM Data you just submitted. This is an error in the API Implementation of 3.3. why is the target release of the fix 3.4. ? Sven, this is a side effect of a known problem with RESTEasy JSON serialization. JSON serialization support is experimental at the moment (including 3.3.2) and will be fully supported starting with 3.4. The changes done for 3.4 will fix this particular problem. However they will also introduce changes to the names of many properties: all those that contain more than one word separated by underscores in the XML representation. For example if you are creating a VM using the "deleteProtected" property you will have to change your code to use "delete_protected" instead. oVirt 3.4.0 alpha has been released including the fix for this issue. curl -k -X POST -H "Accept: application/json" -H "Content-Type:
application/json" -d "@json_vm" -u $ADMIN $URL/vms
json_vm:
{"name":"test_vm2","cluster":{"id":"4200f114-f2d7-4711-994b-d29e525fc4fc", "name": "cl34"},"template":{"id":"00000000-0000-0000-0000-000000000000", "name": "Blank"},"console":{"enabled":true}}
output:
{
"type" : "desktop",
"status" : {
"state" : "down"
},
"memory" : 1073741824,
"cpu" : {
"topology" : {
"sockets" : "1",
"cores" : "1"
},
"architecture" : "X86_64"
},
"cpu_shares" : "0",
"os" : {
"boot" : [ {
"dev" : "hd"
} ],
"type" : "other"
},
"high_availability" : {
"enabled" : false,
"priority" : "0"
},
"display" : {
"type" : "vnc",
"monitors" : "1",
"single_qxl_pci" : false,
"allow_override" : false,
"smartcard_enabled" : false
},
"cluster" : {
"href" : "/ovirt-engine/api/clusters/4200f114-f2d7-4711-994b-d29e525fc4fc",
"id" : "4200f114-f2d7-4711-994b-d29e525fc4fc"
},
"template" : {
"href" : "/ovirt-engine/api/templates/00000000-0000-0000-0000-000000000000",
"id" : "00000000-0000-0000-0000-000000000000"
},
"stop_time" : 1392656267945,
"creation_time" : 1392656267943,
"origin" : "ovirt",
"stateless" : false,
"delete_protected" : false,
"sso" : {
"methods" : {
"method" : [ {
"id" : "GUEST_AGENT"
} ]
}
},
"console" : {
"enabled" : true
},
"initialization" : {
"domain" : "",
"regenerate_ssh_keys" : false,
"nic_configurations" : { }
},
"placement_policy" : {
"affinity" : "migratable"
},
"memory_policy" : {
"guaranteed" : 1073741824,
"ballooning" : true
},
"usb" : {
"enabled" : false
},
"migration_downtime" : "-1",
"virtio_scsi" : {
"enabled" : true
},
"actions" : {
"link" : [ {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/ticket",
"rel" : "ticket"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/migrate",
"rel" : "migrate"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/reboot",
"rel" : "reboot"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/cancelmigration",
"rel" : "cancelmigration"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/shutdown",
"rel" : "shutdown"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/start",
"rel" : "start"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/suspend",
"rel" : "suspend"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/stop",
"rel" : "stop"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/detach",
"rel" : "detach"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/export",
"rel" : "export"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/move",
"rel" : "move"
} ]
},
"name" : "test_vm2",
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8",
"id" : "f23baac6-e916-47d1-84ab-da0d373cd7a8",
"link" : [ {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/applications",
"rel" : "applications"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/disks",
"rel" : "disks"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/nics",
"rel" : "nics"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/cdroms",
"rel" : "cdroms"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/snapshots",
"rel" : "snapshots"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/tags",
"rel" : "tags"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/permissions",
"rel" : "permissions"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/statistics",
"rel" : "statistics"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/reporteddevices",
"rel" : "reporteddevices"
}, {
"href" : "/ovirt-engine/api/vms/f23baac6-e916-47d1-84ab-da0d373cd7a8/watchdogs",
"rel" : "watchdogs"
} ]
}
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released |