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

Bug 1449289

Summary: RESTAPI - Amend (update VM disk attachment disk qcow2_v3 field) to raw disk is allowed
Product: [oVirt] ovirt-engine Reporter: Avihai <aefrat>
Component: BLL.StorageAssignee: Maor <mlipchuk>
Status: CLOSED CURRENTRELEASE QA Contact: Avihai <aefrat>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.2.1CC: amureini, bugs, stirabos, tnisan
Target Milestone: ovirt-4.1.3Flags: rule-engine: ovirt-4.1+
Target Release: 4.1.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Amend a VM disk attachment without any QCOW volumes is allowed and show a success response through REST. Consequence: The amend operation go through every volume in the disk and filter out all the QCOW volumes to amend. Since there are no any, the operation will be finished with success. Fix: Introduce a new validation with reasonable error which will be presented to the user once a VM disk attachment without any QCOW volumes will be amended. Result: A validation message will be presented to the user once the QCOW version is changed for a disk without any QCOW volumes. A user might still see a successful response through REST even if no change has been done on the disk, this is the current behavior through REST (For example when a disk alias/description is being updated with the same value as before or if disk is being amended with the same QCOW version as before).
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-06 13:22:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine & vdsm logs none

Description Avihai 2017-05-09 14:22:02 UTC
Created attachment 1277391 [details]
engine & vdsm logs

Description of problem:
Amend (update VM disk attachment disk qcow2_v3 field) to raw disk is allowed.

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

How reproducible:
100%

Steps to Reproduce:
1.Create VM with RAW disk
2.Via RESTAPI amend disk


Actual results:
The response is successful & event log shows an update is successful.

Event log:
May 9, 2017, 4:54:49 PM 
VM vm_TestCase18349_REST_NFS_0916144083 vm_TestCase18349_REST_NFS_0916144083_Disk1 disk was updated by admin@internal-authz.

Expected results:
I would expect that update qcow2_v3 to VM disk attachment on a RAW disk that does not have this field will fail with a reasonable error.

Additional info:
RESTAPI amend request:

URL:
https://storage-ge-04.scl.lab.tlv.redhat.com/ovirt-engine/api/vms/cee54bba-c327-4e34-9482-6d77781d8627/diskattachments/dd39bbc5-fd3d-4c7b-ba3f-6e9c640ead22

Body:
<disk_attachment>
    <disk>
        <qcow_version>qcow2_v3</qcow_version>
    </disk>
</disk_attachment>

Comment 1 Maor 2017-05-24 14:15:38 UTC
The following validation message will be presented to the user once the QCOW version is changed for a disk without any QCOW volumes:

  "Cannot ${action} ${type}. The amend operation does not support disk without any QCOW2 volumes."

A user might still see a successful response through REST even if no change has been done on the disk, this is the current behavior through REST (For example update the disk alias/description with the same value or amend a disk to the same QCOW version)

Comment 2 rhev-integ 2017-05-28 14:46:15 UTC
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Tag 'ovirt-engine-4.1.3' doesn't contain patch 'https://gerrit.ovirt.org/77308']
gitweb: https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=shortlog;h=refs/tags/ovirt-engine-4.1.3

For more info please contact: infra

Comment 3 Maor 2017-06-06 12:04:37 UTC
As mentioned in comment 2
patch https://gerrit.ovirt.org/77308 was not part of ovirt-engine-4.1.3 tag, therefore it should not be moved to ON_QA for target 4.1.3, moving again to modified until next build of 4.1.4.

Comment 4 Allon Mureinik 2017-06-20 10:00:37 UTC
(In reply to Maor from comment #3)
> As mentioned in comment 2
> patch https://gerrit.ovirt.org/77308 was not part of ovirt-engine-4.1.3 tag,
> therefore it should not be moved to ON_QA for target 4.1.3, moving again to
> modified until next build of 4.1.4.

It's part of the ovirt-engine-4.1.3.1 resping. Moving back to 4.1.3 and setting ON_QA.

Comment 5 Avihai 2017-06-20 16:22:32 UTC
verified on 4.1.3.4