Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1512850

Summary: Unable to boot VM from CD-ROM
Product: [oVirt] ovirt-engine-sdk-java Reporter: Mirko Solic <mirko.solic>
Component: CoreAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1.3CC: bugs, juan.hernandez, lveyde, omachace
Target Milestone: ovirt-4.1.8Flags: rule-engine: ovirt-4.1+
Target Release: 4.1.6   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: java-ovirt-engine-sdk4-4.1.6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-11 16:29:50 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:

Description Mirko Solic 2017-11-14 09:52:53 UTC
Description of problem:

I'm trying to boot VM from CD-ROM, using SDK. This is code I use

connection.systemService().vmsService()
  .vmService("123")
  .start()
  .vm(
     vm()
       .os(
	 operatingSystem().boot(boot().devices(BootDevice.CDROM)))
       )
   .send();

Response I get from server is 400.

Looking further into code I realised that SDK produces wrong request. It looks like this:

<action>
  <vm>
    <os>
      <boot>
        <devices>
          <boot_device>cdrom</boot_device>
        </devices>
      </boot>
    </os>
  </vm>
</action>

Problem is in tag <boot_device>, it should be <device>

The same I see in engine.log

2017-11-14 10:27:06,967+01 ERROR [org.ovirt.engine.api.restapi.resource.validation.IOExceptionMapper] (default task-30) [] Exception: java.io.IOException: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"boot_device"). Expected elements are <{}device>
        at org.ovirt.engine.api.restapi.xml.JAXBProvider.readFrom(JAXBProvider.java:199) [restapi-jaxrs.jar:]
        at org.ovirt.engine.api.restapi.xml.JAXBProvider.readFrom(JAXBProvider.java:161) [restapi-jaxrs.jar:]


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

I'm using java SDK version 4.1.5 and I'm connecting to Ovirt 4.1.6.
I tried the same code with SDK version 4.2.0.alpha2, but had the same problem.


How reproducible:

Run this code.

connection.systemService().vmsService()
  .vmService("123")
  .start()
  .vm(
     vm()
       .os(
	 operatingSystem().boot(boot().devices(BootDevice.CDROM)))
       )
   .send();

Comment 1 Juan Hernández 2017-11-14 10:35:28 UTC
To fix this we need to fix the code generator. That is what the proposed patch does. Once that fix is merged and the new code generator is released, we will need to re-generate the SDK.

Comment 2 Lev Veyde 2017-11-23 16:39:52 UTC
Package was added to oVirt 4.1.8 RC2 release.

Comment 3 Lucie Leistnerova 2017-11-28 16:33:05 UTC
VM from cdrom booted successfully 

verified in java-ovirt-engine-sdk4-4.1.6-1.el7ev.noarch with ovirt-engine-4.1.8.1-0.1.el7.noarch