Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.

Bug 864836

Summary: RESTAPI: RSDL does not document '?current' query parameter in: PUT /api/vms/xxx/cdroms/yyy
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Dagan <bdagan>
Component: ovirt-engine-restapiAssignee: Ravi Nori <rnori>
Status: CLOSED CURRENTRELEASE QA Contact: Barak Dagan <bdagan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: dyasny, ecohen, iheim, mpastern, oramraz, pstehlik, Rhev-m-bugs, sgrinber, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: si22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 14:59:15 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Logs from jenkins qa run (build 18 si:19.1) none

Description Barak Dagan 2012-10-10 04:44:03 EDT
Created attachment 624658 [details]
Logs from jenkins qa run (build 18 si:19.1)

Description of problem:
update on cdrom triggers vm update (and it fails with appropriate error message)
unless '?current' query parameter raised:

>> UPDATE api content is --  collection :cdroms element:<cdrom href="/api/vms/00548c94-b208-4ddd-b5a4-e28bf4438e2e/cdroms/00000000-0000-0000-0000-000000000000?current" id="00000000-0000-0000-0000-000000000000">
>>     <vm href="/api/vms/00548c94-b208-4ddd-b5a4-e28bf4438e2e" id="00548c94-b208-4ddd-b5a4-e28bf4438e2e"/>
>>     <file id="en_windows_7_enterprise_x64_dvd_x15-70749.iso"/>
>> </cdrom>
>>  
>> Failed to update an element, status: 400, reason: Bad Request, details:
>> status: 400
>> reason: Bad Request

Version-Release number of selected component (if applicable):
3.1.0

How reproducible:
The following test fails each time:
http://jenkins.qa.lab.tlv.redhat.com:8080/view/Core+Tools/job/3.1-automation_restapi_reg_vms_sdk

Steps to Reproduce (see the above test - Iteration number: 150):
1.Run VM once with boot from cdrom:
  Test action: runVmOnce
  Test parameters: True, vm='restvm_run_once', cdrom_image='en_windows_7_enterprise_x64_dvd_x15-70749.iso', boot_dev='cdrom', pause='true'

2.Chance CD while the VM is on:
  Test action: changeCDWhileRunning
  Test parameters: vm_name='restvm_run_once',
    Cdrom_image='en_windows_7_enterprise_x64_dvd_x15-70749.iso'
  Running command: changeCDWhileRunning(vm_name='restvm_run_once',
    cdrom_image='en_windows_7_enterprise_x64_dvd_x15-70749.iso')
  UPDATE api content is :collection :cdroms element:
    <cdrom href="/api/vms/00548c94-b208-4ddd-b5a4-e28bf4438e2e/cdroms
      /00000000-0000-0000-0000-000000000000?current"
      id="00000000-0000-0000-0000-000000000000">
    <vm href="/api/vms/00548c94-b208-4ddd-b5a4-e28bf4438e2e" 
      id="00548c94-b208-4ddd-b5a4-e28bf4438e2e"/>
   <file id="en_windows_7_enterprise_x64_dvd_x15-70749.iso"/>
</cdrom>
3.
  
Actual results:


Expected results:


Additional info:
Comment 2 Ravi Nori 2012-10-18 11:57:49 EDT
Link : http://gerrit.ovirt.org/#/c/8607/

Commit Hash : 7ab9baeea9a0bf3c6a6e0b0668f38bbabd99aae8
Comment 3 Ravi Nori 2012-10-18 12:45:15 EDT
Correct Commit Hash Is : 7006d0e91a3b0595bd49d80b1bae15391745d98c
Comment 4 Barak Dagan 2012-11-14 10:46:03 EST
Verified on si24.