Bug 1714834 - Cannot disable SCSI passthrough using API
Summary: Cannot disable SCSI passthrough using API
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.3.1
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ovirt-4.4.0
: ---
Assignee: Tal Nisan
QA Contact: Yosi Ben Shimon
URL:
Whiteboard:
Depends On:
Blocks: 1719737
TreeView+ depends on / blocked
 
Reported: 2019-05-29 02:34 UTC by nijin ashok
Modified: 2020-08-04 13:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1719737 (view as bug list)
Environment:
Last Closed: 2020-08-04 13:19:31 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:
lsvaty: testing_plan_complete-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:3247 0 None None None 2020-08-04 13:19:46 UTC
oVirt gerrit 100532 0 'None' MERGED Allow setting a disk ScsiGenericIO to disabled 2020-08-03 13:28:54 UTC
oVirt gerrit 100533 0 'None' MERGED restapi: Allow setting a disk ScsiGenericIO to disabled 2020-08-03 13:28:54 UTC
oVirt gerrit 100657 0 'None' MERGED Allow setting a disk ScsiGenericIO to disabled 2020-05-12 11:35:44 UTC
oVirt gerrit 100747 0 'None' MERGED restapi: Update to model 4.4.2 2020-08-03 13:28:54 UTC
oVirt gerrit 100758 0 'None' MERGED restapi: Update to model 4.3.5 2020-08-03 13:28:53 UTC
oVirt gerrit 101067 0 'None' MERGED restapi: Allow setting a disk ScsiGenericIO to disabled 2020-08-03 13:28:53 UTC

Description nijin ashok 2019-05-29 02:34:15 UTC
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:

Comment 1 Tal Nisan 2019-05-29 08:56:50 UTC
Ondra, how can we send a PUT request that will nullify an enum field? Seems that sending an empty value fails

Comment 2 Ondra Machacek 2019-05-30 07:56:16 UTC
I would introduce new value called DISABLED as we have for other enums.

Comment 4 Daniel Gur 2019-08-28 13:14:54 UTC
sync2jira

Comment 5 Daniel Gur 2019-08-28 13:19:57 UTC
sync2jira

Comment 7 Yosi Ben Shimon 2019-12-04 15:13:56 UTC
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

Comment 9 RHV bug bot 2019-12-13 13:14:51 UTC
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

Comment 10 RHV bug bot 2019-12-20 17:44:39 UTC
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

Comment 11 RHV bug bot 2020-01-08 14:47:12 UTC
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

Comment 12 RHV bug bot 2020-01-08 15:15:53 UTC
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

Comment 13 RHV bug bot 2020-01-24 19:48:55 UTC
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

Comment 14 Siddhant Rao 2020-05-14 20:01:39 UTC
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)
~~~

Comment 20 errata-xmlrpc 2020-08-04 13:19:31 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 (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


Note You need to log in before you can comment on or make changes to this bug.