Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/

Bug 1091716

Summary: cannot attache volume after volume snapshot create/delete
Product: [Community] RDO Reporter: Attila Fazekas <afazekas>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED CURRENTRELEASE QA Contact: Dafna Ron <dron>
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: afazekas, eharney, jobernar, pasik, yeylon
Target Milestone: ---Keywords: TestBlocker
Target Release: Icehouse   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1096489 (view as bug list) Environment:
Last Closed: 2015-03-02 17:17:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1096489, 1111694    
Attachments:
Description Flags
volume.log none

Description Attila Fazekas 2014-04-27 14:33:58 UTC
Description of problem:
On rhel 6.5 with lvm volume backend, with tgtd iscsi helper,
cannot attache volume after snapshot create/delete.

Version-Release number of selected component (if applicable):
rdo icehouse
python-cinder-2014.1-2.el6.noarch
openstack-cinder-2014.1-2.el6.noarch
python-cinderclient-1.0.8-1.el6.noarch
openstack-nova-cert-2014.1-2.el6.noarch
openstack-nova-objectstore-2014.1-2.el6.noarch
python-nova-2014.1-2.el6.noarch
openstack-nova-novncproxy-2014.1-2.el6.noarch
openstack-nova-api-2014.1-2.el6.noarch
openstack-nova-console-2014.1-2.el6.noarch
openstack-nova-conductor-2014.1-2.el6.noarch
openstack-nova-scheduler-2014.1-2.el6.noarch
openstack-nova-common-2014.1-2.el6.noarch
openstack-nova-compute-2014.1-2.el6.noarch
openstack-nova-network-2014.1-2.el6.noarch
python-novaclient-2.17.0-1.el6.noarch
python-greenlet-0.4.2-1.el6.x86_64
python-eventlet-0.14.0-1.el6.noarch
openstack-packstack-2014.1.1-0.8.dev1045.el6.noarch
openstack-packstack-puppet-2014.1.1-0.8.dev1045.el6.noarch

How reproducible:
Looks like always.

Steps to Reproduce:
1. nova boot test2 --image cirros-0.3.2-x86_64-uec --flavor 42 # wait for 'active'
2. cinder create 1 #  wait for 'available'
3. cinder snapshot-create <vol_id> # wait for create
4. cinder snapshot-delete <snap_id>  # wait for delete
5. nova volume-attach test2 <vol_id> /dev/vdc
6. cinder list # says it is in 'attaching' status for long time (>10s)
7. cinder list #  the volume in 'available' status
Actual results:
 Volume not attached.

Looks like n-cpu got 500 from the c-api (v1).
2014-04-27 14:20:07.283 22817 DEBUG nova.openstack.common.lockutils [req-00e3f225-bc75-4666-b92d-b4a79aa30d22 admin admin] Semaphore / lock released "update_usage" inner /usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py:252
2014-04-27 14:20:07.287 22817 ERROR oslo.messaging.rpc.dispatcher [-] Exception during message handling: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-4a1aa7c0-1e8f-46aa-a458-94b40759759b)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     incoming.message))
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     result = getattr(endpoint, method)(ctxt, **new_args)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 399, in decorated_function
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return function(self, context, *args, **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/exception.py", line 88, in wrapped
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     payload)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/exception.py", line 71, in wrapped
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return f(self, context, *args, **kw)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 280, in decorated_function
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     pass
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 266, in decorated_function
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return function(self, context, *args, **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 309, in decorated_function
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     e, sys.exc_info())
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 296, in decorated_function
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return function(self, context, *args, **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4132, in attach_volume
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     bdm.destroy(context)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4129, in attach_volume
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return self._attach_volume(context, instance, driver_bdm)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4150, in _attach_volume
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     self.volume_api.unreserve_volume(context, bdm.volume_id)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4142, in _attach_volume
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     do_check_attach=False, do_driver_attach=True)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/virt/block_device.py", line 44, in wrapped
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     ret_val = method(obj, context, *args, **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/virt/block_device.py", line 225, in attach
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     connector)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/volume/cinder.py", line 173, in wrapper
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     res = method(self, ctx, volume_id, *args, **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/nova/volume/cinder.py", line 271, in initialize_connection
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     connector)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinderclient/v1/volumes.py", line 321, in initialize_connection
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     {'connector': connector})[1]['connection_info']
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinderclient/v1/volumes.py", line 250, in _action
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return self.api.client.post(url, body=body)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinderclient/client.py", line 209, in post
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     return self._cs_request(url, 'POST', **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinderclient/client.py", line 173, in _cs_request
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     **kwargs)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinderclient/client.py", line 156, in request
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher     raise exceptions.from_response(resp, body)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher ClientException: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-4a1aa7c0-1e8f-46aa-a458-94b40759759b)
2014-04-27 14:20:07.287 22817 TRACE oslo.messaging.rpc.dispatcher 
2014-04-27 14:20:07.291 22817 ERROR oslo.messaging._drivers.common [-] Returning exception The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-4a1aa7c0-1e8f-46aa-a458-94b40759759b) to caller



Expected results:
 volume attached. ('in-use' status; volume is visible on the guest) 

Additional info:
 nova-network, I did as admin user, packstack setup.

Comment 1 Eric Harney 2014-04-28 18:42:53 UTC
What appears in the Cinder api and volume logs when this happens?

Comment 3 Attila Fazekas 2014-04-29 08:21:44 UTC
From the strace of the c-api:

26357 recvfrom(10, "\1\0\1\0\0\0]\0<\0<\0011\0\0\0\0\0\0\0009\0&reply_f8e80f44ee2a4b7c88fa73708809d92b&reply_f8e80f44ee2a4b7c88fa73708809d92b\316\2\0\1\0\0\0+\0<\0\0\0\0\0\0\0\0\10\247\370\0\20application/json\5utf-8\0\0\0\0\2\0
\316\3\0\1\0\0\10\247{\"oslo.message\": \"{\\\"_unique_id\\\": \\\"613265ac51494685a8021c5a7d10864e\\\", \\\"failure\\\": \\\"{\\\\\\\"args\\\\\\\": [\\\\\\\"Failed to create iscsi target for volume volume-3d0618b3-73d2-45c6-b2f
8-4d87dc0c30db.\\\\\\\"], \\\\\\\"module\\\\\\\": \\\\\\\"cinder.brick.exception\\\\\\\", \\\\\\\"kwargs\\\\\\\": {\\\\\\\"code\\\\\\\": 500, \\\\\\\"volume_id\\\\\\\": \\\\\\\"volume-3d0618b3-73d2-45c6-b2f8-4d87dc0c30db\\\\\\\"
}, \\\\\\\"message\\\\\\\": \\\\\\\"Failed to create iscsi target for volume volume-3d0618b3-73d2-45c6-b2f8-4d87dc0c30db.\\\\\\\", \\\\\\\"tb\\\\\\\": [\\\\\\\"Traceback (most recent call last):\\\\\\\\n\\\\\\\", \\\\\\\"  File 
\\\\\\\\\\\\\\\"/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py\\\\\\\\\\\\\\\", line 133, in _dispatch_and_reply\\\\\\\\n    incoming.message))\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2
.6/site-packages/oslo/messaging/rpc/dispatcher.py\\\\\\\\\\\\\\\", line 176, in _dispatch\\\\\\\\n    return self._do_dispatch(endpoint, method, ctxt, args)\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2.6/sit
e-packages/oslo/messaging/rpc/dispatcher.py\\\\\\\\\\\\\\\", line 122, in _do_dispatch\\\\\\\\n    result = getattr(endpoint, method)(ctxt, **new_args)\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2.6/site-pac
kages/cinder/volume/manager.py\\\\\\\\\\\\\\\", line 783, in initialize_connection\\\\\\\\n    volume)\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2.6/site-packages/cinder/volume/drivers/lvm.py\\\\\\\\\\\\\\\
", line 524, in create_export\\\\\\\\n    return self._create_export(context, volume)\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2.6/site-packages/cinder/volume/drivers/lvm.py\\\\\\\\\\\\\\\", line 533, in _
create_export\\\\\\\\n    data = self.target_helper.create_export(context, volume, volume_path)\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2.6/site-packages/cinder/volume/iscsi.py\\\\\\\\\\\\\\\", line 53, i
n create_export\\\\\\\\n    chap_auth)\\\\\\\\n\\\\\\\", \\\\\\\"  File \\\\\\\\\\\\\\\"/usr/lib/python2.6/site-packages/cinder/brick/iscsi/iscsi.py\\\\\\\\\\\\\\\", line 244, in create_iscsi_target\\\\\\\\n    raise exception.I
SCSITargetCreateFailed(volume_id=vol_id)\\\\\\\\n\\\\\\\", \\\\\\\"ISCSITargetCreateFailed: Failed to create iscsi target for volume volume-3d0618b3-73d2-45c6-b2f8-4d87dc0c30db.\\\\\\\\n\\\\\\\"], \\\\\\\"class\\\\\\\": \\\\\\\"
ISCSITargetCreateFailed\\\\\\\"}\\\", \\\"result\\\": null, \\\"_msg_id\\\": \\\"9d098b746bd8423a8747394d017b4624\\\"}\", \"oslo.version\": \"2.0\"}\316", 65536, 0, NULL, NULL) = 2375

Looks like it got an rpc error message from the c-vol,
but it is not logged!! Both the debug and verbose is True in the cinder.conf. 


Really the c-api send the error message to n-api:
26357 sendto(16, "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 128\r\nContent-Type: application/json; charset=UTF-8\r\nX-Compute-Request-Id: req-3ae53594-0513-4a7d-9a96-9a266bae8f06\r\nX-Openstack-Request-Id: req-3ae53594-0513-4a7d-9a96-9a266bae8f06\r\nDate: Tue, 29 Apr 2014 08:12:47 GMT\r\n\r\n{\"computeFault\": {\"message\": \"The server has either erred or is incapable of performing the requested operation.\", \"code\": 500}}", 401, 0, NULL, 0) = 401

Comment 4 Attila Fazekas 2014-04-29 08:47:59 UTC
The logging issue was related to c-vol:
 
"  File \"/usr/lib/python2.6/site-packages/cinder/openstack/common/log.py\", line 669, in format\n"
"    return logging.Formatter.format(self, record)\n"
"  File \"/usr/lib64/python2.6/logging/__init__.py\", line 439, in format\n"
"    s = self._fmt % record.__dict__\n"
"KeyError: u'user_name'\n"

The above was stripped from strace, it went to fd=2.

$ openstack-config --get /etc/cinder/cinder.conf DEFAULT logging_context_format_string
%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s] %(instance)s%(message)s

The above option removed, The attachment still not working, but now it logs to the logfile.
2014-04-29 08:44:43.843 31172 ERROR oslo.messaging.rpc.dispatcher [req-6b85ff2c-2841-4c46-8173-bf776ec540a5 75af574f3f40474da0c6aa93acee40d0 06a996d6bd5047368c931c77c7c76237 - - -] Exception during message handling: Failed to create iscsi target for volume volume-3d0618b3-73d2-45c6-b2f8-4d87dc0c30db.
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     incoming.message))
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     result = getattr(endpoint, method)(ctxt, **new_args)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line 783, in initialize_connection
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     volume)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinder/volume/drivers/lvm.py", line 524, in create_export
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     return self._create_export(context, volume)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinder/volume/drivers/lvm.py", line 533, in _create_export
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     data = self.target_helper.create_export(context, volume, volume_path)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinder/volume/iscsi.py", line 53, in create_export
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     chap_auth)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.6/site-packages/cinder/brick/iscsi/iscsi.py", line 244, in create_iscsi_target
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher     raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
2014-04-29 08:44:43.843 31172 TRACE oslo.messaging.rpc.dispatcher ISCSITargetCreateFailed: Failed to create iscsi target for volume volume-3d0618b3-73d2-45c6-b2f8-4d87dc0c30db.

Comment 5 Attila Fazekas 2014-04-29 10:41:53 UTC
Created attachment 890729 [details]
volume.log

Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/cinder-volumes/volume-b7c223d6-d29e-4032-b743-a089342699c0
Exit code: 22
Stdout: ''
Stderr: 'tgtadm: invalid request\n'


In the log "LUN: 0" not "LUN: 1".

Comment 6 Eric Harney 2014-05-06 18:11:38 UTC
The cinder volume log shows:

ERROR cinder.brick.iscsi.iscsi [req-75f6e209-a9d9-41f5-8769-b3477eaef7bd 22501918310c44e28b9cca280ee55254 3c0ab2cab3d44aa5a895fff8ee913b8f - - -] Failed to create iscsi target for volume id:volume-fb2b7b77-6f2e-45ed-bdc9-6f9d7547cbef. Please ensure your tgtd config file contains 'include /etc/cinder/volumes/*'


/etc/tgt/targets.conf contains:
include /etc/tgt/stack.d/*


But /etc/tgt/stack.d/ does not seem to exist based on the log tarball?

Comment 7 Attila Fazekas 2014-05-07 09:52:05 UTC
Because it is symbolic link in that setup.

In a packstack setup the 
/etc/tgt/targets.conf:
include /etc/cinder/volumes/*
default-driver iscsi

The same path configured in the 
/usr/share/cinder/cinder-dist.conf:
volumes_dir = /etc/cinder/volumes

The /etc/cinder/cinder.conf does not overrides it.

In simple attach sequence (excluding the create/delete snapshot step), Cinder adds a new entry to the /etc/cinder/volumes.

Comment 8 Attila Fazekas 2014-05-07 10:42:11 UTC
# lvs
  LV                                          VG             Attr       LSize Pool Origin Data%  Move Log Cpy%Sync Convert                                        
  volume-30968368-38f6-4952-a6dd-cfe333ff442c cinder-volumes -wi-a----- 1.00g     

# cinder snapshot-create 30968368-38f6-4952-a6dd-cfe333ff442c
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|      created_at     |      2014-05-07T10:35:55.885437      |
| display_description |                 None                 |
|     display_name    |                 None                 |
|          id         | b89457d4-1c14-4843-a509-190d3b9e740a |
|       metadata      |                  {}                  |
|         size        |                  1                   |
|        status       |               creating               |
|      volume_id      | 30968368-38f6-4952-a6dd-cfe333ff442c |
+---------------------+--------------------------------------+
# vgs
  VG             #PV #LV #SN Attr   VSize  VFree 
  cinder-volumes   1   4   1 wz--n- 20.60g 16.60g
# lvs
  LV                                             VG             Attr       LSize Pool Origin                                      Data%  Move Log Cpy%Sync Convert
  _snapshot-b89457d4-1c14-4843-a509-190d3b9e740a cinder-volumes swi-a-s--- 1.00g      volume-30968368-38f6-4952-a6dd-cfe333ff442c   0.00                          
1.00g                                                                                  
  volume-30968368-38f6-4952-a6dd-cfe333ff442c    cinder-volumes owi-a-s--- 1.00g                                                                                  
# cinder snapshot-delete b89457d4-1c14-4843-a509-190d3b9e740a
# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable |             Attached to              |
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
| 30968368-38f6-4952-a6dd-cfe333ff442c | available |     None     |  1   |     None    |  false   |                                      |
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
# lvs
  LV                                          VG             Attr       LSize Pool Origin Data%  Move Log Cpy%Sync Convert                                          
  volume-30968368-38f6-4952-a6dd-cfe333ff442c cinder-volumes -wi------- 1.00g 

The volume looses the 'a' (active?) attribute and the /dev/cinder-volumes entry on a snapshot deletion.

Comment 9 Attila Fazekas 2014-05-07 12:23:59 UTC
It is an upstream issue.
Originally I wanted to reproduce a different issue, but this more simple sequence did not worked.

Comment 10 Eric Harney 2014-05-07 18:34:00 UTC
Appears to be related to LVM activation.

(Below commands are snipped to relevant info.)

# lvs
  LV                                             VG             Attr       LSize Pool Origin                                      Data%  Move Log Cpy%Sync Convert
  _snapshot-757d0311-c47a-4d93-8cb5-0bf160386e4f cinder-volumes swi-a-s--- 1.00g      volume-07f8cd8f-9571-471b-b692-9a3502ee9bb6   0.00                          
  volume-07f8cd8f-9571-471b-b692-9a3502ee9bb6    cinder-volumes owi-a-s--- 1.00g                                                                                  
# cinder snapshot-delete 757d0311-c47a-4d93-8cb5-0bf160386e4f

# vgs
  VG             #PV #LV #SN Attr   VSize  VFree 
  cinder-volumes   1   1   0 wz--n- 20.60g 19.60g
  vg_centosrdo2    1   2   0 wz--n- 11.51g     0 

# lvs
  LV                                          VG             Attr       LSize Pool Origin Data%  Move Log Cpy%Sync Convert
  volume-07f8cd8f-9571-471b-b692-9a3502ee9bb6 cinder-volumes -wi------- 1.00g                                             
  lv_root                                     vg_centosrdo2  -wi-ao---- 7.63g                                             
  lv_swap                                     vg_centosrdo2  -wi-ao---- 3.88g   

(Volume LV is no longer active.)

Nova volume-attach will fail now because tgtd tries to access /dev/cinder-volumes/volume-xxxx which does not exist.  Running "vgchange -a y cinder-volumes" and then nova volume-attach will succeed.

Comment 11 Eric Harney 2014-05-07 18:51:50 UTC
This breaks because the brick vg.delete() code which is used to delete a snapshot or a volume calls "lvchange -y -an cinder-volumes/snapshot-xxxx" which has the effect of deactivating both the snapshot and the source volume.  This may have other implications as well.