Hide Forgot
Created attachment 1154164 [details] engine log Description of problem: Attempting to add a vm which include a custom_properties attribute fails via api version 3. e.g. https://{engine_url}/ovirt-engine/api/vms/ POST headers: Content-type: application/xml Accept: application/xml Version: 3 <vm> <name>add_vm_test</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="00000000-0000-0000-0000-000000000000"/> </vm> Actual results: 500 Internal Server Error Expected results: response 201 Vm is created successfully with the correct custom property Version-Release number of selected component (if applicable): ovirt-engine-4.0.0-0.0.master.20160504171422.git8c24183.el7.centos.noarch How reproducible: always Additional info: See attached log from entry: 2016-05-05 13:53:44,386 ERROR [org.ovirt.engine.api.restapi.resource.validation.IOExceptionMapper] (default task-5) [] IO exception while processing "POST" request for path "/vms"
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.