Bug 1333354
| Summary: | [REST API V3] Adding a vm with custom_properties fails via api version 3 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [oVirt] ovirt-engine | Reporter: | sefi litmanovich <slitmano> | ||||
| Component: | RestAPI | Assignee: | Juan Hernández <juan.hernandez> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Lukas Svaty <lsvaty> | ||||
| Severity: | urgent | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 4.0.0 | CC: | bugs, gklein, juan.hernandez, sbonazzo | ||||
| Target Milestone: | ovirt-4.0.0-beta | Keywords: | Automation, AutomationBlocker, Regression | ||||
| Target Release: | 4.0.0 | Flags: | rule-engine:
ovirt-4.0.0+
rule-engine: blocker+ rule-engine: planning_ack+ juan.hernandez: devel_ack+ pstehlik: testing_ack+ |
||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2016-07-05 07:50:28 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: | |||||||
| Attachments: |
|
||||||
|
Description
sefi litmanovich
2016-05-05 11:08:38 UTC
Operation is successful, however custom property was not added to VM and is missing-> FailedQA, tested in ovirt-engine-restapi-4.0.0.4-0.1.el7ev.noarch
curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin@internal:{admin_pwd} --cacert ca.crt -d "<vm><name>add_vm_test3</name><type>desktop</type><os type=\"rhel_6x64\"/><cluster href=\"/ovirt-engine/api/clusters/{cluster_id}\" id=\"{cluster_id}\"></cluster><display><type>spice</type></display><custom_properties>custom_property name=\"sndbuf\" value=\"111\"/></custom_properties><template id=\"{blank_template}\"/></vm>" https://test-engine.com:443/ovirt-engine/api/vms
engine log:
2016-06-15 10:29:56,083 INFO [org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-13) [] User admin@internal successfully logged in with scopes: ovirt-app-api ovirt-ext=token-info:authz-search ovirt-ext=token-info:public-authz-search ovirt-ext=token-info:validate
2016-06-15 10:29:56,119 INFO [org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand] (default task-16) [19a8a636] Running command: CreateUserSessionCommand internal: false.
2016-06-15 10:29:56,238 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (default task-16) [ea862b2] Lock Acquired to object 'EngineLock:{exclusiveLocks='[add_vm_testx=<VM_NAME, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}'
2016-06-15 10:29:56,324 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (default task-16) [] Running command: AddVmFromScratchCommand internal: false. Entities affected : ID: 00000002-0002-0002-0002-000000000299 Type: ClusterAction group CREATE_VM with role type USER
2016-06-15 10:29:56,363 INFO [org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher] (DefaultQuartzScheduler6) [d8a08e1] Fetched 0 VMs from VDS '189561d6-2c03-4cc4-be5d-15d9652a2113'
2016-06-15 10:29:56,495 INFO [org.ovirt.engine.core.bll.AddGraphicsDeviceCommand] (default task-16) [69739fb8] Running command: AddGraphicsDeviceCommand internal: true. Entities affected : ID: f919ce13-d17b-4691-b6a2-426ca7c6f4f1 Type: VMAction group EDIT_VM_PROPERTIES with role type USER
2016-06-15 10:29:56,524 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-16) [69739fb8] Correlation ID: ea862b2, Job ID: 13607998-d0f4-4efd-a77e-42820d41a4a5, Call Stack: null, Custom Event ID: -1, Message: VM add_vm_testx was created by admin@internal-authz.
2016-06-15 10:29:56,550 INFO [org.ovirt.engine.core.bll.AddVmFromScratchCommand] (default task-16) [69739fb8] Lock freed to object 'EngineLock:{exclusiveLocks='[add_vm_testx=<VM_NAME, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}'
2016-06-15 10:29:56,592 INFO [org.ovirt.engine.core.bll.aaa.LogoutSessionCommand] (default task-16) [ffe839f] Running command: LogoutSessionCommand internal: false.
2016-06-15 10:29:56,599 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-16) [ffe839f] Correlation ID: ffe839f, Call Stack: null, Custom Event ID: -1, Message: User admin@internal-authz logged out.
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release. just note: mentioned behaviour is the same with -H "Version: 3" I think that it has an error in the body, it is missing a "<" before the "custom_property" tag:
<custom_properties>custom_property
Add the version header, and fix the "custom_property" tag, then it should work correctly, I just verified it in my environment.
Thank you for noticing, seems to be working with correct xml, also only working for "Version: 3" without this header it has the previous issue of not assigning the custom property, bug? However this issue is fixed and verified. Without the version header you will be using version 4 of the API, and in version 4 of the API XML attributes aren't used (except "id" and "href"), so the custom properties element should look like this:
<custom_properties>
<custom_property>
<name>sndbuf</name>
<value>111</value>
</custom_property>
</custom_properties>
Same for the "os" element, should be like this when using version 4 of the API:
<os>
<type>rhel_6x64</type>
</os>
Try that, please, if doesn't work, then there is a bug.
just checked with new API it seems to be working correctly with changes you mentioned oVirt 4.0.0 has been released, closing current release. |