Bug 1096217 - Direct iSCSI lun disk details aren't validated
Summary: Direct iSCSI lun disk details aren't validated
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.5.0
Assignee: Daniel Erez
QA Contact: Carlos Mestre González
URL:
Whiteboard: storage
Depends On:
Blocks: 1123754
TreeView+ depends on / blocked
 
Reported: 2014-05-09 13:21 UTC by Juan Hernández
Modified: 2016-02-10 19:43 UTC (History)
9 users (show)

Fixed In Version: ovirt-engine-3.5.0_rc2
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1123754 (view as bug list)
Environment:
Last Closed: 2014-09-22 08:02:35 UTC
oVirt Team: Storage
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 31676 0 master MERGED core,restapi: DirectLUN disk - validate LUN visibilty Never
oVirt gerrit 31924 0 None None None Never

Description Juan Hernández 2014-05-09 13:21:45 UTC
When adding a direct iSCSI direct LUN disk using the RESTAPI without creating a storage domain, the details given by the user aren't validated, and stored in the database regardless of their correctness. In particular the LUN id isn't validated, just stored in the database. Other attributes, like the vendor id, the model id, the serial number and the size aren't retrieved from the iSCSI server and left empty in the database.

This can be reproduced with a Python script like this:

#!/usr/bin/python

import ovirtsdk.api
import ovirtsdk.xml.params

api = ovirtsdk.api.API(
    url="https://rhel.example.com/ovirt-engine/api",
    username="admin@internal",
    password="******",
    insecure=True,
    debug=True)

# Create the iSCSI storage connection:
sc = ovirtsdk.xml.params.StorageConnection()
sc.set_address("192.168.122.1")
sc.set_type("iscsi")
sc.set_port(3260)
sc.set_target("iqn.2014-01.com.example:iscsi")
sc = api.storageconnections.add(sc)

# Add the direct LUN disk:
lu = ovirtsdk.xml.params.LogicalUnit()
lu.set_id("something_that_doesnt_exist")
lu.set_address(sc.get_address())
lu.set_port(sc.get_port())
lu.set_target(sc.get_target())
storage = ovirtsdk.xml.params.Storage()
storage.set_type("iscsi")
storage.set_logical_unit([lu])
disk = ovirtsdk.xml.params.Disk()
disk.set_name("mylun")
disk.set_interface("virtio")
disk.set_type("iscsi")
disk.set_format("raw")
disk.set_lun_storage(storage)
disk = api.disks.add(disk)

api.disconnect()

This succeeds, and the LUN disk is created, but will never work. The expected result is that incorrect LUN ids are detected, and that the additional attributes are populated correctly.

Comment 1 Allon Mureinik 2014-08-20 06:59:10 UTC
Daniel, where's the patch that moved this BZ to POST? thanks.

Comment 2 Daniel Erez 2014-08-20 07:10:34 UTC
(In reply to Allon Mureinik from comment #1)
> Daniel, where's the patch that moved this BZ to POST? thanks.

Added.


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