Bug 1926819 - python-sdk iscsidiscover return iscsi_targets instead of iscsi_details
Summary: python-sdk iscsidiscover return iscsi_targets instead of iscsi_details
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-python
Classification: oVirt
Component: Core
Version: 4.4.9
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.4.6
: 4.4.11
Assignee: Ori Liel
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks: 1922748
TreeView+ depends on / blocked
 
Reported: 2021-02-09 14:11 UTC by Martin Necas
Modified: 2021-05-05 05:36 UTC (History)
5 users (show)

Fixed In Version: python-ovirt-engine-sdk4-4.4.11 ovirt-engine-4.4.6.5
Doc Type: Release Note
Doc Text:
Host 'iscsi_discover' action has been deprecated. Host 'discover_iscsi' action has been added to replace it. The actions do the same thing but have different return values. 'discover_iscsi' returns the information in a 'iscsi_details' element. 'iscsi_discover' returns the information in a 'iscsi_targets' element. In summary, the action which should be used from now on is 'discover_iscsi'.
Clone Of:
Environment:
Last Closed: 2021-05-05 05:36:10 UTC
oVirt Team: Infra
Embargoed:
pm-rhel: ovirt-4.4+
gdeolive: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 113492 0 master MERGED Add Host DiscoverIscsi Action 2021-02-18 06:58:57 UTC
oVirt gerrit 113493 0 master MERGED restapi: Add Host.DiscoverIscsi implementation 2021-04-13 08:31:41 UTC

Description Martin Necas 2021-02-09 14:11:32 UTC
Description of problem:
According to the documentation [1] the iscsi discovery should return iscsi_details, but for python sdk it only returns iscsi_targets.

[1] https://github.com/oVirt/ovirt-engine-api-model/blob/master/src/main/java/services/HostService.java#L675-L698


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


How reproducible:


Steps to Reproduce:
1. Use iscsi discovery with python sdk 
Example from ansible module (https://github.com/oVirt/ovirt-ansible-collection/blob/master/plugins/modules/ovirt_host.py#L615-L623)
2. Check out the response
3.

Actual results:
Returns list of strings with iscsi targets

Expected results:
Return IscsiDetails

Additional info:

Comment 1 Ori Liel 2021-02-15 09:44:50 UTC
The reason for this bug is an architectural constraint in the SDKs, which denies the possibility to deprecate an output parameter of an action.

Due to this constraint, this patch:

  https://gerrit.ovirt.org/c/ovirt-engine-api-model/+/84198/

did not work as designed, resulting in this bugzilla.

Changing the SDK architecture to support deprecating output parameters of an action does not justify the ROI, as the present bug is only such case
in recent memory. Should additional cases present themselves, this decision will be reevaluated. 

  model patch:  https://gerrit.ovirt.org/c/ovirt-engine-api-model/+/113492
  engine patch: https://gerrit.ovirt.org/c/ovirt-engine/+/113493

Comment 2 Sandro Bonazzola 2021-04-15 07:09:19 UTC
All referenced patches are merged, can you please update on this bug status?

Comment 3 Guilherme Santos 2021-05-04 19:20:33 UTC
Verified on:
ovirt-engine-4.4.6.6-0.10.el8ev.noarch
ovirt-engine-sdk-python==4.4.12

Steps:
1. # cat test_iscsi.py
import ovirtsdk4 as sdk
import ovirtsdk4.types as otypes

connection = sdk.Connection(
    url='https://<engine-fqdn>/ovirt-engine/api',
    username='admin@internal',
    password=<password>,
    insecure=True,
    debug=True,
)

hosts_service = connection.system_service().hosts_service()
host_id = "b952649e-5c15-4f14-af8e-56e45fd01aab"
iscsi_targets = hosts_service.service(host_id).iscsi_discover(
    iscsi=otypes.IscsiDetails(
        port=3260,
        address=<iscsi-addr>,
    ),
)
print(iscsi_targets)
connection.close()
2. # python3 test_iscsi.py
['iqn.200...., 'iqn.200...., 'iqn.200..., 'iqn.200...]


Results:
iscsi targets discovered, via sdk, as expected

Comment 4 Sandro Bonazzola 2021-05-05 05:36:10 UTC
This bugzilla is included in oVirt 4.4.6 release, published on May 4th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.6 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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