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:
Ondra, how can we send a PUT request that will nullify an enum field? Seems that sending an empty value fails
I would introduce new value called DISABLED as we have for other enums.
sync2jira
Tested on: ovirt-engine-4.4.0-0.6.master.el7.noarch vdsm-4.40.0-154.git4e13ea9.el8ev.x86_64 Created a VM with direct LUN disk via UI. Managed to move the sgio from 'filtered' to 'disabled' using both UI and REST-API. From the UI: VM -> DISKS -> Edit button -> check/uncheck the 'Enable SCSI Pass-Through' From REST-API: PUT request to https://<engine>/ovirt-engine/api/disks/<disk_id> <disk> <sgio>disabled</sgio> </disk> OR <disk> <sgio>filtered</sgio> </disk> * When tried to use a value like 'aaa', the response was: <fault> <detail>The string 'aaa' isn't a valid value for the 'ScsiGenericIO' enumerated type. Valid values are: 'filtered', 'unfiltered', 'disabled'.</detail> <reason>Invalid value</reason> </fault> Moving to VERIFIED
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
I tried running this with the python SDK. It worked for 4.3.7 RHV Manager, but failed for 4.4 beta. --------- # python3.6 test.py Traceback (most recent call last): File "test.py", line 31, in <module> sgio=types.ScsiGenericIO('disabled') File "/usr/lib64/python3.6/site-packages/ovirtsdk4/services.py", line 6921, in update return self._internal_update(disk_attachment, headers, query, wait) File "/usr/lib64/python3.6/site-packages/ovirtsdk4/service.py", line 253, in _internal_update return future.wait() if wait else future File "/usr/lib64/python3.6/site-packages/ovirtsdk4/service.py", line 55, in wait return self._code(response) File "/usr/lib64/python3.6/site-packages/ovirtsdk4/service.py", line 250, in callback self._check_fault(response) File "/usr/lib64/python3.6/site-packages/ovirtsdk4/service.py", line 132, in _check_fault self._raise_error(response, body) File "/usr/lib64/python3.6/site-packages/ovirtsdk4/service.py", line 118, in _raise_error raise error ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Internal Engine Error]". HTTP response code is 400. ENGINE LOGS ----------- ~~~ 2020-05-14 19:55:07,317Z INFO [org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand] (default task-17) [0ab71037-8173-443a-bd1f-9055f059f54f] Lock Acquired to object 'EngineLock:{exclusiveLocks='[b0a7aa52-bece-4438-a8c7-b6ec9f2e9abb=DISK]', sharedLocks='[3264cf77-5515-4693-9314-2c34b378a630=VM]'}' 2020-05-14 19:55:07,371Z INFO [org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand] (default task-17) [0ab71037-8173-443a-bd1f-9055f059f54f] Running command: UpdateDiskCommand internal: false. Entities affected : ID: b0a7aa52-bece-4438-a8c7-b6ec9f2e9abb Type: DiskAction group EDIT_DISK_PROPERTIES with role type USER, ID: b0a7aa52-bece-4438-a8c7-b6ec9f2e9abb Type: DiskAction group CONFIGURE_SCSI_GENERIC_IO with role type ADMIN 2020-05-14 19:55:07,371Z ERROR [org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand] (default task-17) [0ab71037-8173-443a-bd1f-9055f059f54f] Command 'org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand' failed: class org.ovirt.engine.core.common.businessentities.storage.LunDisk cannot be cast to class org.ovirt.engine.core.common.businessentities.storage.DiskImage (org.ovirt.engine.core.common.businessentities.storage.LunDisk and org.ovirt.engine.core.common.businessentities.storage.DiskImage are in unnamed module of loader 'org.ovirt.engine.core.common' @511513ff) 2020-05-14 19:55:07,371Z ERROR [org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand] (default task-17) [0ab71037-8173-443a-bd1f-9055f059f54f] Exception: java.lang.ClassCastException: class org.ovirt.engine.core.common.businessentities.storage.LunDisk cannot be cast to class org.ovirt.engine.core.common.businessentities.storage.DiskImage (org.ovirt.engine.core.common.businessentities.storage.LunDisk and org.ovirt.engine.core.common.businessentities.storage.DiskImage are in unnamed module of loader 'org.ovirt.engine.core.common' @511513ff) at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand.lockImageInDb(UpdateDiskCommand.java:1032) at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.storage.disk.UpdateDiskCommand.executeVmCommand(UpdateDiskCommand.java:212) at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:177) ~~~
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