Bug 1719737

Summary: [downstream clone - 4.3.5] Cannot disable SCSI passthrough using API
Product: Red Hat Enterprise Virtualization Manager Reporter: RHV bug bot <rhv-bugzilla-bot>
Component: ovirt-engineAssignee: Tal Nisan <tnisan>
Status: CLOSED ERRATA QA Contact: Avihai <aefrat>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.3.1CC: ldelouw, omachace, Rhev-m-bugs, tnisan
Target Milestone: ovirt-4.3.5Keywords: ZStream
Target Release: 4.3.5   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.5.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1714834 Environment:
Last Closed: 2019-08-12 11:53:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1714834    
Bug Blocks:    

Description RHV bug bot 2019-06-12 12:45:51 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1714834 +++
======================================================================

Description of problem:

The option which is available to configure the SCSI passthrough is sgio. The sgio only accepts FILTERED/UNFILTERED value which disables/enables "Privileged SCSI I/O". So once SCSI passthrough is enabled, there is no way to disable it using API. If we pass an empty value "<sgio></sgio>", it will fail with error below.

<detail>The string '' isn't a valid value for the 'ScsiGenericIO' enumerated type. Valid values are: 'filtered', 'unfiltered'.</detail>

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

ovirt-engine-4.3.3.7-0.1.el7.noarch

How reproducible:

100%

Steps to Reproduce:

Try to disable the SCSI passthrough using API.

Actual results:

Cannot disable SCSI passthrough using API.

Expected results:

Provide a way to disable SCSI passthrough using API.

Additional info:

(Originally by Nijin Ashok)

Comment 1 RHV bug bot 2019-06-12 12:45:53 UTC
Ondra, how can we send a PUT request that will nullify an enum field? Seems that sending an empty value fails

(Originally by Tal Nisan)

Comment 2 RHV bug bot 2019-06-12 12:45:54 UTC
I would introduce new value called DISABLED as we have for other enums.

(Originally by Ondra Machacek)

Comment 4 Avihai 2019-06-27 15:57:01 UTC
Added to automation as well on ovirt-engine 4.3.5-1

1) Direct LUN disk with enabled passthrough unfiltered mode :
    </disk>
............................................................................................................
        <name>new_direct_lun_5918</name>
        <description></description>
        <alias>new_direct_lun_5918</alias>
............................................................................................................
        <sgio>unfiltered</sgio>
    </disk>


2) Disabling an enabled passthrough direct LUN disk to passthrough disabled is successfull:

2019-06-27 17:42:29,081 - MainThread - diskattachments - DEBUG - PUT request content is --  url:/ovirt-engine/api/vms/28eb16de-3ab0-4cb5-bd88-1be30d81b26b/diskattachments/9c7ad0b3-fbf1-4733-9ae9-aa746ee4773d body:<disk_attachment>
    <interface>virtio_scsi</interface>
    <disk>
        <alias>new_direct_lun_5918</alias>
        <sgio>disabled</sgio>
        <shareable>true</shareable>
    </disk>
</disk_attachment>
 
2019-06-27 17:42:29,083 - MainThread - diskattachments - INFO - Using Correlation-Id: diskattachments_update_b21330b1-29c4-419a
2019-06-27 17:42:29,522 - MainThread - diskattachments - DEBUG - Cleaning Correlation-Id: diskattachments_update_b21330b1-29c4-419a
2019-06-27 17:42:29,523 - MainThread - diskattachments - DEBUG - Response code is valid: [200, 201] 
2019-06-27 17:42:29,524 - MainThread - diskattachments - DEBUG - Response body for PUT request is: 
<disk_attachment href="/ovirt-engine/api/vms/28eb16de-3ab0-4cb5-bd88-1be30d81b26b/diskattachments/9c7ad0b3-fbf1-4733-9ae9-aa746ee4773d" id="9c7ad0b3-fbf1-4733-9ae9-aa746ee4773d">
    <active>true</active>
    <bootable>false</bootable>
    <interface>virtio_scsi</interface>
    <pass_discard>false</pass_discard>
    <read_only>false</read_only>
    <uses_scsi_reservation>false</uses_scsi_reservation>
    <disk href="/ovirt-engine/api/disks/9c7ad0b3-fbf1-4733-9ae9-aa746ee4773d" id="9c7ad0b3-fbf1-4733-9ae9-aa746ee4773d"/>
    <vm href="/ovirt-engine/api/vms/28eb16de-3ab0-4cb5-bd88-1be30d81b26b" id="28eb16de-3ab0-4cb5-bd88-1be30d81b26b"/>
</disk_attachment>

Comment 6 errata-xmlrpc 2019-08-12 11:53:28 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, 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/RHEA-2019:2431