Setting iscsi_ip_address in backend doesn't work

Bug #1325799 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Jay Bryant
Icehouse
Won't Fix
Undecided
Unassigned

Bug Description

The iscsi code doesn't use the backend configuration object. Consider the following cinder.conf

iscsi_ip_address=10.0.0.1

enabled_backends=lvm1,lvm2

[lvm1]
volume_group=lvm1
iscsi_ip_address=10.0.0.2

[lvm2]
volume_group=lvm2
iscsi_ip_addres=10.0.0.3

The flags are correctly printed out on cinder-volume startup:

DEBUG cinder.openstack.common.service [-] iscsi_ip_address = 10.0.0.1
DEBUG cinder.openstack.common.service [-] lvm1.iscsi_ip_address = 10.0.0.2
DEBUG cinder.openstack.common.service [-] lvm2.iscsi_ip_address = 10.0.0.3

but both of the backends will use 10.0.0.1 when they pass the info during initialize_connection. This is because cinder/volume/iscsi.py is using cfg.CONF instead of the backend config object.

Revision history for this message
Jay Bryant (jsbryant) wrote :

I have seen this same problem with LVM but don't see it in the storwize driver. Thanks for narrowing down the source.

Changed in cinder:
status: New → Confirmed
importance: Undecided → High
milestone: none → juno-1
tags: added: drivers
tags: added: icehouse-backport-potential
Revision history for this message
John Griffith (john-griffith) wrote :

Started working on this and found all sort of little surprises. The main issue here is we have all sorts of overlap and dead code between the tgt admin drivers. In addition, most of the volume/iscsi.py code uses global confs and the mixin pattern doesn't enable the passing in of the drivers configuration object very readily.

Anyway, cleaning things up should have this submitted shortly.

Changed in cinder:
assignee: nobody → John Griffith (john-griffith)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/98527

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
John Griffith (john-griffith) wrote :

So I've been trying to figure out the least invasive way to do this to allow us to backport the fix. The problem is we've got some ugliness going on in the inheritance model, particularly the ordering of setting up the target-helper and the base class of the driver. The problem is that simply trying to just grab "self.configuration" settings from the individual backend proves to cause a number of things to break.

I've got a pretty significant refactor of the code that will fix this, but I think it's too heavy for a backport so I'm holding off on doing anything more with it until I see if I can come up with a hack that can be backported.

Changed in cinder:
milestone: juno-1 → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by John Griffith (<email address hidden>) on branch: master
Review: https://review.openstack.org/98527
Reason: Have an interim fix that doesn't have such a large impact

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/99501

Changed in cinder:
assignee: John Griffith (john-griffith) → Jay Bryant (jsbryant)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/99501
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=1b21d499bb3bb1e94e2815cbada86db8e8e21406
Submitter: Jenkins
Branch: master

commit 1b21d499bb3bb1e94e2815cbada86db8e8e21406
Author: John Griffith <email address hidden>
Date: Wed Jun 11 22:43:41 2014 +0000

    Remove global conf settings from iscsi helper

    This "intermediate" iscsi helper pulls all of it's
    config settings from the global config. This is fine
    if you only have a single backend, but if you do
    multi-backend it puts things in a bad state where some
    of the backend specific settings are picked up but
    others are not (for example iscsi_ip_address).

    This change modifies methods like create_export in
    the volume/iscsi helper to take the drivers version
    of the config settings as a parameter and use those
    instead of setting off of the global values.

    Long term there's a lot of cleanup surrounding our
    inheritance model and especially the iscsi helpers.
    We can address that going forward but here we just want
    to fix the bug in the safest way possible.

    Change-Id: If17ec3ffb3f4ea7f95da65781885dcd613b1a807
    Closes-Bug: 1325799

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/102499

Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-2 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/icehouse)

Change abandoned by Mike Perez (<email address hidden>) on branch: stable/icehouse
Review: https://review.openstack.org/102499

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.