← Back to team overview

openstack team mailing list archive

Re: using cinder to create volumes error

 

On Sun, Oct 21, 2012 at 9:24 PM, livemoon <mwjpiero@xxxxxxxxx> wrote:

> When I create volumes by cinder, error occurs in cinder-volume.log
>
> 2012-10-22 10:58:25 DEBUG cinder.volume.manager
> [req-f51ade4d-5bed-4f24-b492-528b9baca625 cd7e95086cfc4693945f37e59c1b7206
> 67456c69ae074be4b4ba0af7048b5ceb] volume
> volume-e224dfdb-913c-4135-811d-eb075a551de8: creating export create_volume
> /usr/lib/python2.7/dist-packages/cinder/volume/manager.py:155
> 2012-10-22 10:58:25 28674 ERROR cinder.openstack.common.rpc.amqp [-]
> Exception during message handling
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp Traceback
> (most recent call last):
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/openstack/common/rpc/amqp.py",
> line 276, in _process_data
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp     rval
> = self.proxy.dispatch(ctxt, version, method, **args)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/openstack/common/rpc/dispatcher.py",
> line 145, in dispatch
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> return getattr(proxyobj, method)(ctxt, **kwargs)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 163, in
> create_volume
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> volume_ref['id'], {'status': 'error'})
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> self.gen.next()
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 156, in
> create_volume
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> model_update = self.driver.create_export(context, volume_ref)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/driver.py", line 380, in
> create_export
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> volume_path)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/iscsi.py", line 112, in
> create_iscsi_target
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> utils.ensure_tree(FLAGS.volumes_dir)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/utils.py", line 1049, in
> ensure_tree
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> os.makedirs(path)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/os.py", line 157, in makedirs
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
> mkdir(name, mode)
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp OSError:
> [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/volumes'
> 2012-10-22 10:58:25 28674 TRACE cinder.openstack.common.rpc.amqp
>
> Then I manually create directory "volumes" in
> /usr/lib/python2.7/dist-packages" and give 777 to it
> but error again:
>
> 2012-10-22 11:21:43 ERROR cinder.volume.iscsi
> [req-d965ffd6-aff8-4c2d-b3c0-c6aaca4cebf0 cd7e95086cfc4693945f37e59c1b7206
> 67456c69ae074be4b4ba0af7048b5ceb] Failed to create iscsi target for volume
> id:volume-a430f00e-53fa-44e9-9470-f604d63b88b8. Please ensure your tgtd
> config file contains 'include /usr/lib/python2.7/dist-packages/volumes/*'
> 2012-10-22 11:21:43 28674 ERROR cinder.openstack.common.rpc.amqp [-]
> Exception during message handling
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp Traceback
> (most recent call last):
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/openstack/common/rpc/amqp.py",
> line 276, in _process_data
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp     rval
> = self.proxy.dispatch(ctxt, version, method, **args)
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/openstack/common/rpc/dispatcher.py",
> line 145, in dispatch
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp
> return getattr(proxyobj, method)(ctxt, **kwargs)
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 163, in
> create_volume
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp
> volume_ref['id'], {'status': 'error'})
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp
> self.gen.next()
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 156, in
> create_volume
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp
> model_update = self.driver.create_export(context, volume_ref)
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/driver.py", line 380, in
> create_export
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp
> volume_path)
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp   File
> "/usr/lib/python2.7/dist-packages/cinder/volume/iscsi.py", line 148, in
> create_iscsi_target
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp     raise
> exception.NotFound()
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp NotFound:
> Resource could not be found.
> 2012-10-22 11:21:43 28674 TRACE cinder.openstack.common.rpc.amqp
>
> Do I need to cofiguration something in tgtd conf?
>
>
> --
> 非淡薄无以明志,非宁静无以致远
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
>
> Hi Livemoon,

It looks like your data-path to your volumes is configured incorrectly, it
appears to be pointing to the source cinder/volume.py file but this is
actually supposed to be the path to your actual LVM (ie
/opt/stack/data/cinder/volumes/) and yes it needs to be added to your
/etc/tgt/conf.d/cinder.conf file.

For example, in devstack we use the default path I mentioned above, and
create the persistence file cinder.conf in /etc/tgt/conf.d.  Here's what
that looks like:

vagrant@precise:/etc/tgt$ cat /etc/tgt/conf.d/cinder.conf
include /opt/stack/data/cinder/volumes/*
vagrant@precise:/etc/tgt$


Let me know if this isn't enough to get things sorted and we can work
through a bit more.

Thanks,
John

References