+++ 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)
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)
I would introduce new value called DISABLED as we have for other enums. (Originally by Ondra Machacek)
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>
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