作者:陈小默gg | 来源:互联网 | 2014-05-27 20:14
作为个人学习笔记分享,有任何问题欢迎交流!根据《Ubuntu13.04安装OpenStackGrizzly》,安装Cinder组件:apt-getinstall-ycinder-apicinder-schedulercinder-volumeiscsitargetopen-iscsiiscsitarget-dkms在/
作为个人学习笔记分享,有任何问题欢迎交流!
根据《Ubuntu13.04安装OpenStack
Grizzly》,安装Cinder组件:
apt-get install-y cinder-api cinder-scheduler cinder-volume
iscsitargetopen-iscsi iscsitarget-dkms
在/etc/cinder/cinder.conf文件中,更改对应iscsitarget 组件的配置:iscsi_helper= ietadm 。
以上方法无法正常使用volume,原因如下:
ubuntu下安装target服务有2个包都能完成,一个是 iscsitarget,另外一个是tgt这俩个的区别就在于:
A)iscsitarget 是ietd.conf 为主配置文件,用ietadm动态加载;
B)而tgt 是 targets.conf,tgtadm动态加载
但是,重启电脑后,tgt将首先启动,占据与iscsi的通信端口3260,可以netstat ?tulpn| grep
3260查看,导致iscsitarget无法启动,从而导致无法使用volume。
解决方法:
卸载iscsitarget:
apt-get removeiscsitarget
根据另外一种安装方法(参考官方安装文档:bk-block-storage-adminguide-grizzly)重新安装cinder:
sudo apt-getinstall cinder-api
cinder-schedulercinder-volume open-iscsi python-cinderclient
tgt
在/etc/cinder/cinder.conf文件中,更该对应iscsitarget 组件的配置:iscsi_helper= tgtadm。
此时还不能正常运行,提示如下错误:
OSError: [Errno 13] Permission
denied:'/usr/lib/python2.7/dist-packages/volumes'
解决方法:在/etc/cinder/cinder中添加配置:
state_path=/var/lib/cinder
volumes_dir=/var/lib/cinder/volumes
原因:tgt为了以便节点或它自身重启后查询volume,会在volumes_dir目录下写入volume的信息。
grizzly中cinder-volume和tgt存在依赖关系,推荐用tgt.
2013.7.11更新:
分析上面报Errno13错误的原因
以下是/var/log/cinder/cinder-volume.log中的报错信息:
2013-07-11 07:14:32 ERROR [cinder.service]
Unhandled exception
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cinder/service.py",
line 224, in _start_child
self._child_process(wrap.server)
File "/usr/lib/python2.7/dist-packages/cinder/service.py",
line 201, in _child_process
launcher.run_server(server)
File "/usr/lib/python2.7/dist-packages/cinder/service.py",
line 95, in run_server
server.start()
File "/usr/lib/python2.7/dist-packages/cinder/service.py",
line 342, in start
self.manager.init_host()
File
"/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line
152, in init_host
self.driver.ensure_export(ctxt, volume)
File
"/usr/lib/python2.7/dist-packages/cinder/volume/drivers/lvm.py",
line 391, in ensure_export
old_name=old_name)
File
"/usr/lib/python2.7/dist-packages/cinder/volume/iscsi.py", line
127, in create_iscsi_target
utils.ensure_tree(FLAGS.volumes_dir)
File "/usr/lib/python2.7/dist-packages/cinder/utils.py",
line 1166, in ensure_tree
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied:
'/usr/lib/python2.7/dist-packages/volumes'