Unity: Failed to detach LUN when auto zone enabled

Bug #1759175 reported by Ryan Liang on 2018-03-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Ryan Liang

Bug Description

The exception raised when detaching LUN.
The auto zone is enabled.

The root cause is that the LUN is the last LUN attached to the host. After detaching it, the `host.host_luns` is None.
To fix this issue, add None check.

2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils Traceback (most recent call last):
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/powervc_cinder/zonemanager/powervc_utils.py", line 570, in decorator
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils info = terminate_connection(self, *args, **kwargs)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/dell_emc/unity/driver.py", line 166, in terminate_connection
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils return self.adapter.terminate_connection(volume, connector)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 883, in trace_logging_wrapper
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils result = f(*args, **kwargs)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/dell_emc/unity/adapter.py", line 317, in terminate_connection
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils return self._terminate_connection(lun, connector)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 883, in trace_logging_wrapper
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils result = f(*args, **kwargs)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/dell_emc/unity/adapter.py", line 746, in _terminate_connection
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils if len(host.host_luns) == 0:
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils TypeError: object of type 'NoneType' has no len()
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils

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

Changed in cinder:
assignee: nobody → Ryan Liang (ryan-liang)
status: New → In Progress

Reviewed: https://review.openstack.org/556803
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c816be897e7ab1c95b38979b2cc94ecf179e44e7
Submitter: Zuul
Branch: master

commit c816be897e7ab1c95b38979b2cc94ecf179e44e7
Author: Ryan Liang <email address hidden>
Date: Wed Mar 28 07:30:39 2018 +0000

    Unity: fail to detach lun when auto zone enabled

    When the lun is the last one attached to the host and it is detached,
    the attribute `host.host_luns` is None. Use `not` in if statement which
    is pythonic in checking None and empty list of `host.host_luns`.

    Change-Id: I5d8f63f9a78d001bc699af538f586aab8d73a5cf
    Closes-bug: #1759175

Changed in cinder:
status: In Progress → Fix Released

Change abandoned by Ryan Liang (<email address hidden>) on branch: stable/pike
Review: https://review.openstack.org/558662
Reason: According to Eric's comments, need to cherry pick from Queens.

Reviewed: https://review.openstack.org/558659
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=febe57cfee50425c0fc9945169b5f9c3898cbdfe
Submitter: Zuul
Branch: stable/queens

commit febe57cfee50425c0fc9945169b5f9c3898cbdfe
Author: Ryan Liang <email address hidden>
Date: Wed Mar 28 07:30:39 2018 +0000

    Unity: fail to detach lun when auto zone enabled

    When the lun is the last one attached to the host and it is detached,
    the attribute `host.host_luns` is None. Use `not` in if statement which
    is pythonic in checking None and empty list of `host.host_luns`.

    Change-Id: I5d8f63f9a78d001bc699af538f586aab8d73a5cf
    Closes-bug: #1759175
    (cherry picked from commit c816be897e7ab1c95b38979b2cc94ecf179e44e7)

tags: added: in-stable-queens

This issue was fixed in the openstack/cinder 13.0.0.0b1 development milestone.

Reviewed: https://review.openstack.org/558662
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ead818199e07923760e525c0367c9dcb5f4ab343
Submitter: Zuul
Branch: stable/pike

commit ead818199e07923760e525c0367c9dcb5f4ab343
Author: Ryan Liang <email address hidden>
Date: Wed Mar 28 07:30:39 2018 +0000

    Unity: fail to detach lun when auto zone enabled

    When the lun is the last one attached to the host and it is detached,
    the attribute `host.host_luns` is None. Use `not` in if statement which
    is pythonic in checking None and empty list of `host.host_luns`.

    Change-Id: I5d8f63f9a78d001bc699af538f586aab8d73a5cf
    Closes-bug: #1759175
    (cherry picked from commit c816be897e7ab1c95b38979b2cc94ecf179e44e7)
    (cherry picked from commit febe57cfee50425c0fc9945169b5f9c3898cbdfe)

tags: added: in-stable-pike

This issue was fixed in the openstack/cinder 12.0.2 release.

This issue was fixed in the openstack/cinder 11.1.1 release.

Reviewed: https://review.openstack.org/625855
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=e704e834024cf4ec156527b16f7437f9dba4d551
Submitter: Zuul
Branch: stable/ocata

commit e704e834024cf4ec156527b16f7437f9dba4d551
Author: Ryan Liang <email address hidden>
Date: Wed Mar 28 07:30:39 2018 +0000

    Unity: fail to detach lun when auto zone enabled

    When the lun is the last one attached to the host and it is detached,
    the attribute `host.host_luns` is None. Use `not` in if statement which
    is pythonic in checking None and empty list of `host.host_luns`.

    Change-Id: I5d8f63f9a78d001bc699af538f586aab8d73a5cf
    Closes-bug: #1759175
    (cherry picked from commit c816be897e7ab1c95b38979b2cc94ecf179e44e7)
    (cherry picked from commit febe57cfee50425c0fc9945169b5f9c3898cbdfe)
    (cherry picked from commit ead818199e07923760e525c0367c9dcb5f4ab343)

tags: added: in-stable-ocata
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers