Bug 1096327 - cinder: can't delete a volume (raise exception.ISCSITargetNotFoundForVolume)
Summary: cinder: can't delete a volume (raise exception.ISCSITargetNotFoundForVolume)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 5.0 (RHEL 7)
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: rc
: 5.0 (RHEL 7)
Assignee: Sergey Gotliv
QA Contact: Dafna Ron
URL:
Whiteboard: storage
: 1098865 (view as bug list)
Depends On: 1084046
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-09 16:47 UTC by Attila Fazekas
Modified: 2016-04-26 16:41 UTC (History)
9 users (show)

Fixed In Version: openstack-cinder-2014.1-3.1.el7ost
Doc Type: Bug Fix
Doc Text:
Clone Of: 1084046
Environment:
Last Closed: 2014-07-08 15:31:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1300136 0 None None None Never
OpenStack gerrit 92472 0 None None None Never
OpenStack gerrit 93029 0 None None None Never
Red Hat Product Errata RHEA-2014:0852 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement - Block Storage 2014-07-08 19:22:44 UTC

Description Attila Fazekas 2014-05-09 16:47:47 UTC
+++ This bug was initially created as a clone of Bug #1084046 +++

Description of problem:

on lvm with rhel7 I fail to delete a volume with ISCSITargetNotFoundForVolume

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

[root@orange-vdsf ~(keystone_admin)]# rpm -qa |grep cinder
python-cinderclient-1.0.7-2.el7.noarch
openstack-cinder-2014.1-0.6.b3.el7.noarch
python-cinder-2014.1-0.6.b3.el7.noarch

How reproducible:

100%

Steps to Reproduce:
1. install AIO with lvm backend for cinder 
2. create a volume (cinder create 1)
3.  delete the volume (cinder delete <volume>)

Actual results:

we fail to delete the volume with raise exception.ISCSITargetNotFoundForVolume

Expected results:

we should be able to delete the volume 

Additional info: full log attached 


2014-04-03 16:32:20.140 2616 DEBUG cinder.volume.manager [req-6aecfae7-5977-41af-b73b-31f2e2f931f6 None] volume b3fcb999-eb36-422c-ae35-da3276794665: removing export delete_volume /usr/lib/python2.7/site-packages/cinder/volume/manager.py:396
2014-04-03 16:32:20.177 2616 DEBUG cinder.openstack.common.lockutils [req-6aecfae7-5977-41af-b73b-31f2e2f931f6 None] Released file lock "b3fcb999-eb36-422c-ae35-da3276794665-delete_volume" at /var/lib/cinder/tmp/cinder-b3fcb999-eb36-422c-ae35-da3276794665-delete_volume for method "lvo_inner2"... inner /usr/lib/python2.7/site-packages/cinder/openstack/common/lockutils.py:239
2014-04-03 16:32:20.177 2616 ERROR cinder.openstack.common.rpc.amqp [req-6aecfae7-5977-41af-b73b-31f2e2f931f6 None] Exception during message handling
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp Traceback (most recent call last):
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/openstack/common/rpc/amqp.py", line 462, in _process_data
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     **args)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     result = getattr(proxyobj, method)(ctxt, **kwargs)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 143, in lvo_inner1
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     return lvo_inner2(inst, context, volume_id, **kwargs)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/openstack/common/lockutils.py", line 233, in inner
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     retval = f(*args, **kwargs)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 142, in lvo_inner2
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     return f(*_args, **_kwargs)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 413, in delete_volume
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     {'status': 'error_deleting'})
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/openstack/common/excutils.py", line 68, in __exit__
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     six.reraise(self.type_, self.value, self.tb)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 397, in delete_volume
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     self.driver.remove_export(context, volume_ref)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 540, in remove_export
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     self.target_helper.remove_export(context, volume)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/volume/iscsi.py", line 232, in remove_export
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     volume['id'])
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/db/api.py", line 232, in volume_get_iscsi_target_num
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     return IMPL.volume_get_iscsi_target_num(context, volume_id)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 117, in wrapper
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     return f(*args, **kwargs)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 1221, in volume_get_iscsi_target_num
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp     raise exception.ISCSITargetNotFoundForVolume(volume_id=volume_id)
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp ISCSITargetNotFoundForVolume: No target id found for volume b3fcb999-eb36-422c-ae35-da3276794665.
2014-04-03 16:32:20.177 2616 TRACE cinder.openstack.common.rpc.amqp 
2014-04-03 16:32:57.363 2616 DEBUG cinder.openstack.common.periodic_task [-] Running periodic task VolumeManager._publish_service_capabilities run_periodic_tasks /usr/lib/python2.7/site-packages/cinder/openstack/common/periodic_task.py:178



[root@orange-vdsf ~(keystone_admin)]# cinder create --display-name dafna1 1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2014-04-03T13:32:07.576476      |
| display_description |                 None                 |
|     display_name    |                dafna1                |
|      encrypted      |                False                 |
|          id         | b3fcb999-eb36-422c-ae35-da3276794665 |
|       metadata      |                  {}                  |
|         size        |                  1                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+
[root@orange-vdsf ~(keystone_admin)]# cinder list 
+--------------------------------------+----------------+--------------+------+-------------+----------+-------------+
|                  ID                  |     Status     | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+----------------+--------------+------+-------------+----------+-------------+
| 51c841ec-24a5-49fe-8441-01593b39b2f7 | error_deleting |    dafna     |  10  |     None    |  false   |             |
| 54d28f61-2f0f-4be4-8e27-855a50a50c33 |   available    |   emptyVol   |  1   |     None    |  false   |             |
| 82a7a825-6106-4139-9bc8-4334ccc38e85 |   available    | volFromImage |  1   |     None    |   true   |             |
| b3fcb999-eb36-422c-ae35-da3276794665 |   available    |    dafna1    |  1   |     None    |  false   |             |
+--------------------------------------+----------------+--------------+------+-------------+----------+-------------+
[root@orange-vdsf ~(keystone_admin)]# cinder delete b3fcb999-eb36-422c-ae35-da3276794665
[root@orange-vdsf ~(keystone_admin)]# cinder list 
+--------------------------------------+----------------+--------------+------+-------------+----------+-------------+
|                  ID                  |     Status     | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+----------------+--------------+------+-------------+----------+-------------+
| 51c841ec-24a5-49fe-8441-01593b39b2f7 | error_deleting |    dafna     |  10  |     None    |  false   |             |
| 54d28f61-2f0f-4be4-8e27-855a50a50c33 |   available    |   emptyVol   |  1   |     None    |  false   |             |
| 82a7a825-6106-4139-9bc8-4334ccc38e85 |   available    | volFromImage |  1   |     None    |   true   |             |
| b3fcb999-eb36-422c-ae35-da3276794665 | error_deleting |    dafna1    |  1   |     None    |  false   |             |
+--------------------------------------+----------------+--------------+------+-------------+----------+-------------+

--- Additional comment from Eric Harney on 2014-05-06 15:28:46 EDT ---

The problem here is that when using LIO, the iscsi_targets table does not get an entry until an attach is attempted (which is when the LIO target is created for that volume).

The delete path expects there to always be a target id in that table tied to that volume, but that is not guaranteed to the be the case.

LioAdm's remove_export tries to handle this via "except exception.NotFound:" but that is referencing cinder.brick.exception.NotFound rather than cinder.exception.NotFound so the error is not skipped.

Comment 5 Dafna Ron 2014-05-19 08:09:01 UTC
*** Bug 1098865 has been marked as a duplicate of this bug. ***

Comment 9 Yogev Rabl 2014-06-26 10:35:31 UTC
verified in:

python-cinder-2014.1-6.el7ost.noarch
openstack-cinder-2014.1-6.el7ost.noarch
python-cinderclient-1.0.9-1.el7ost.noarch

Comment 11 errata-xmlrpc 2014-07-08 15:31:15 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHEA-2014-0852.html


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