Revision history [back]

click to hide/show revision 1
initial version

NoMoreTargets: An unknown exception occurred when attaching a volume to instance

The critical log in related cinder volume node is as following:

2015-12-22 18:15:48.911 43956 ERROR cinder.volume.manager [req-3173227d-7cfd-4549-8ab3-10821fff373c 6e34546a7f604db083db828e982c723c ef43a0aabdea40a29f1870a377db7e90 - - -] Unable to create export for volume eeacca5c-5e0c-49a2-a362-65b56f11b1ee
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager Traceback (most recent call last):
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 902, in initialize_connection
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     volume)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     return f(*args, **kwargs)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 548, in create_export
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     return self._create_export(context, volume)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 560, in _create_export
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     self.configuration)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/iscsi.py", line 42, in create_export
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     max_targets)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/iscsi.py", line 148, in _get_target_and_lun
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     volume['host'])
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/db/api.py", line 167, in volume_allocate_iscsi_target
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     return IMPL.volume_allocate_iscsi_target(context, volume_id, host)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 154, in wrapper
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     return f(*args, **kwargs)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 210, in wrapped
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     return f(*args, **kwargs)
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 1014, in volume_allocate_iscsi_target
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager     raise exception.NoMoreTargets()
2015-12-22 18:15:48.911 43956 TRACE cinder.volume.manager NoMoreTargets: An unknown exception occurred.

The event point is at volume_allocate_iscsi_target of cinder/db/sqlalchemy/api.py:

def volume_allocate_iscsi_target(context, volume_id, host):
    session = get_session()
    with session.begin():
        iscsi_target_ref = model_query(context, models.IscsiTarget,
                                       session=session, read_deleted="no").\
            filter_by(volume=None).\
            filter_by(host=host).\
            with_lockmode('update').\
            first()

        # NOTE(vish): if with_lockmode isn't supported, as in sqlite,
        #             then this has concurrency issues
        if not iscsi_target_ref:
            raise exception.NoMoreTargets()

        iscsi_target_ref.volume_id = volume_id
        session.add(iscsi_target_ref)

    return iscsi_target_ref.target_num

It still doesn't make sense to me. In my environment, there is already an coressponding record in iscsi_targets of cinder db, shown as following

MariaDB [cinder]> select id, host, volume_id,target_num from iscsi_targets where volume_id = 'eeacca5c-5e0c-49a2-a362-65b56f11b1ee';
+----+----------------------+--------------------------------------+------------+
| id | host                 | volume_id                            | target_num |
+----+----------------------+--------------------------------------+------------+
| 95 | computer02#LVM_iSCSI | eeacca5c-5e0c-49a2-a362-65b56f11b1ee |         95 |
+----+----------------------+--------------------------------------+------------+

Could anyone help me to understand what really happens? Any information is appreciated.

Regards Sunzen