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

Bug 1428404

Summary: Trying to sparsify a direct lun via the REST API fails with the wrong error message
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: BLL.VirtAssignee: Michal Skrivanek <michal.skrivanek>
Status: CLOSED WONTFIX QA Contact: meital avital <mavital>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.1.1.2CC: bugs, juan.hernandez, tjelinek
Target Milestone: ---Flags: sbonazzo: ovirt-4.2-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-14 14:00:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sefi litmanovich 2017-03-02 14:08:10 UTC
Description of problem:

This bug is a follow up to bz:
https://bugzilla.redhat.com/show_bug.cgi?id=1415759

hen trying to sparsify a direct lun via the REST API the detail of the failure is incorrect, I get:

<action>
<async>false</async>
<fault>
<detail>[User is not authorized to perform this action.]</detail>
<reason>Operation Failed</reason>
</fault>
<grace_period>
<expiry>10</expiry>
</grace_period>
<status>failed</status>
</action>

This is although I'm running the cmd as admin with superUser permissions on the vm, just the same as other vms with which the sparsify action works or fails with specific msg, e.g.

[Cannot sparsify Virtual Disk. Sparsifying is not supported for preallocated disk bla_Disk1.]

Please check it out.

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

How reproducible:
always

Steps to Reproduce:
1. Have a direct lun.
2. Try to sparsify it via the REST API:
POST http://<host_name>:8080/ovirt-engine/api/disks/<direct_lun_id>/sparsify

Actual results:
<action>
<async>false</async>
<fault>
<detail>[User is not authorized to perform this action.]</detail>
<reason>Operation Failed</reason>
</fault>
<grace_period>
<expiry>10</expiry>
</grace_period>
<status>failed</status>
</action>

Expected results:
Should be passed to the backend and let it return an error message that direct luns can't be sparsified.

Comment 1 Juan Hernández 2017-03-06 11:54:22 UTC
The validation of the type of disk, and the error message, should come from the backend, the API does not perform this kind of validation.

Comment 2 Tomas Jelinek 2017-08-14 14:00:20 UTC
It is only an incorrect message, the functionality behind works properly.

Unfortunately I have to close this due to capacity - please feel free to reopen if you think it should be fixed.