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

Bug 1068803

Summary: RHEVM 3.3 is not correctly receiving the floppy payload
Product: [Retired] oVirt Reporter: Kevin Morey <kmorey>
Component: ovirt-engine-apiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.3CC: acathrow, bazulay, gklein, iheim, kmorey, oramraz, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.5.0   
Hardware: All   
OS: All   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-24 10:03:00 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 Kevin Morey 2014-02-21 22:29:55 UTC
Description of problem:
RHEVM 3.3 is not correctly receiving the floppy payload. This same curl command works on RHEVM 3.1 * 3.2 but fails on 3.3


curl -X PUT -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin@internal -k -d "<vm><payloads><payload type='floppy'><file name='hosts'><content>'blah'</content></file></payload></payloads></vm>" https://10.3.76.20/api/vms/cea44930-2b83-4418-890b-a8031982361d

<payloads>
 <payload type="floppy">
  <file name="hosts">
   <content>'blah'</content>
  </file>
 </payload>
</payloads>

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

How reproducible:
always

Steps to Reproduce:
1. Run the above curl command against a RHEVM 3.3 VM

Actual results:
floppy is mountable but has no files and no content
    <payloads>
        <payload type="floppy"/>
    </payloads>

Expected results:
expected to attach the floppy and include the payload as in 
<payloads>
  <payload type="file">
    <file name="hosts">
      <content>blah</content>
    </file>
  </payload>
</payloads>

Additional info:
This is a blocker for CloudForms 3.01 to be able to provision VMs via ISO as we use the floppy payload to deliver the kickstart file (ks.cfg).

Comment 1 Juan Hernández 2014-02-22 00:43:00 UTC
The capability to specify only one file was considered incorrect, as it induced a problem in the Python bindings generated with the generateDS.py script, see bugs 1018782 and 1019618.

Currently the correct way to use set the payload is to use a "files" element containing multiple "file" elements. In addition the name of the file has been changed from an attribute to an inner element. So the correct way to do this now is the following:

curl \
-k \
-X PUT \
-H "Accept: application/xml" \
-H "Content-Type: application/xml" \
-d '
<vm>
  <payloads>
    <payload type="floppy">
      <files>
        <file>
          <name>hosts</name>
          <content>blah</content>
        </file>
      </files>
    </payload>
  </payloads>
</vm>
' \
-u admin@internal:*** \
https://rhel.example.com/api/vms/9f8be70b-bd6d-44ea-91c8-d89c0aee3dbe

Is it feasible for Cloud Forms to use the new format with 3.3 and the old one with 3.2?

Supporting the old format isn't difficult in the engine side, but it breaks the testing framework and the code generator of the Python SDK, as both use generateDS.py.

Comment 2 Kevin Morey 2014-02-22 02:43:32 UTC
I tested your curl command in my environment and it works. This is great! Thank you so much for clarifying this. I have updated BZ1068804 with your notes and hope that development fixes our api call. You can close my ticket.

Comment 3 Juan Hernández 2014-03-05 09:28:18 UTC

*** This bug has been marked as a duplicate of bug 1072819 ***