Bug 1737234 - Attach a non-existent ISO to vm by the API return 201 and marks the Attach CD checkbox as ON
Summary: Attach a non-existent ISO to vm by the API return 201 and marks the Attach CD...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.3.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-4.4.1
: ---
Assignee: Liran Rotenberg
QA Contact: Beni Pelled
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-04 11:44 UTC by Beni Pelled
Modified: 2020-08-04 13:20 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, if you sent the RHV Manager an API command to attach a non-existing ISO to a VM, it attached an empty CD or left an existing one intact. The current release fixes this issue. Now, the Manager checks if the specified ISO exists, and throws an error if it doesn't.
Clone Of:
Environment:
Last Closed: 2020-08-04 13:20:00 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
attache_a_non-existent_iso_image (23.27 KB, image/png)
2019-08-04 11:44 UTC, Beni Pelled
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:3247 0 None None None 2020-08-04 13:20:34 UTC
oVirt gerrit 103151 0 master MERGED core: validate iso path in update vm command 2020-07-18 19:29:14 UTC

Description Beni Pelled 2019-08-04 11:44:13 UTC
Created attachment 1600342 [details]
attache_a_non-existent_iso_image

Description of problem:
Attempting to attach a non-existent ISO image to vm by the API returns 201 and marks the Attach CD checkbox as ON (screenshot attached),
In case the vm already has a ISO image attached, The ISO will remain unchanged but we'll still get 201.

Version-Release number of selected component (if applicable):
4.3.5.4-0.1.el7

How reproducible:
100%

Steps to Reproduce:
1. Create a vm.

2. Attach a non-existent ISO image by the API:
curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u <USER:PASS> -d "<cdrom><file id='non-existent.iso'/></cdrom>" https://<ENGINE-FQDN>/ovirt-engine/api/vms/<VM-ID>/cdroms

3. Open the Edit VM window on the Admin Portal and see the 'Attach CD' checkbox under 'Boot Options' tab (screenshot attached)

Actual results:
The API return 201 with the following response and the Attache CD checkbox marks as ON:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cdrom href="/ovirt-engine/api/vms/<VM-ID>/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
    <vm href="/ovirt-engine/api/vms/<VM-ID>" id="<VM-ID>"/>
    <file id="non-existent.iso"/>
</cdrom>
 

Expected results:
The API should return some error code and the checkbox shouldn't change.

Additional info:

Comment 1 Michal Skrivanek 2019-08-05 04:56:49 UTC
You could remove an iso any time later too and it would behave the same. There's not much point in checking it..

Comment 2 RHV bug bot 2019-12-13 13:13:28 UTC
WARN: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops

Comment 3 RHV bug bot 2019-12-20 17:43:28 UTC
WARN: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops

Comment 4 RHV bug bot 2020-01-08 14:46:34 UTC
WARN: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops

Comment 5 RHV bug bot 2020-01-08 15:14:05 UTC
WARN: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops

Comment 6 Beni Pelled 2020-01-22 14:44:58 UTC
Verified on:
- ovirt-engine-4.4.0-0.14.master.el7.src.rpm

Verification steps:
1. create a VM.
2. Run the following command: curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u <USER:PASS> -d "<cdrom><file id='non-existent.iso'/></cdrom>" https://<ENGINE-FQDN>/ovirt-engine/api/vms/<VM-ID>/cdroms


Result:
- 'Attach CD' under 'Edit VM > Boot Options' is unchecked and the API return:

/vms/<VM-ID>/cdroms
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[Invalid ISO image path]</detail>
    <reason>Operation Failed</reason>
</fault>

Comment 7 RHV bug bot 2020-01-24 19:48:20 UTC
WARN: Bug status (VERIFIED) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops: Bug status (VERIFIED) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{}', ]

For more info please contact: rhv-devops

Comment 9 RHEL Program Management 2020-06-15 20:18:45 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 12 errata-xmlrpc 2020-08-04 13:20:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: RHV Manager (ovirt-engine) 4.4 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3247


Note You need to log in before you can comment on or make changes to this bug.