设为首页 收藏本站
查看: 2120|回复: 0

[经验分享] openstack安装笔记 Cinder(三)

[复制链接]

尚未签到

发表于 2016-1-8 15:03:01 | 显示全部楼层 |阅读模式
问题,怎么在一个操作后,看系统中多了和修改了哪些内容
yum源配置参考前两篇

yum install openstack-cinder openstack-utils python-kombu python-amqplib



source  /root/keystone_admin
内容为
cat  /root/keystone_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://172.16.21.233:35357/v2.0/
export PS1='[\u@\h \W(keystone_admin)]\$ '


在keystone中加service

keystone service-create --name cinder  --type volume --description "Cinder Volume Service hao"
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    Cinder Volume Service hao     |
|      id     | 97dd83f58ab949ba88d543b26665b564 |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+

在keystone库中加了一条数据

keystone endpoint-create --service-id  cinder --publicurl "http://172.16.21.233:8776/v1/\$(tenant_id)s" --adminurl "http://172.16.21.233:8776/v1/\$(tenant_id)s" --internalurl "http://172.16.21.233:8776/v1/\$(tenant_id)s" --region beijing
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+--------------------------------------------+
|   Property  |                   Value                    |
+-------------+--------------------------------------------+
|   adminurl  | http://172.16.21.233:8776/v1/$(tenant_id)s |
|      id     |      7f99d9b455354bd2b44b16c2d13654ba      |
| internalurl | http://172.16.21.233:8776/v1/$(tenant_id)s |
|  publicurl  | http://172.16.21.233:8776/v1/$(tenant_id)s |
|    region   |                  beijing                   |
|  service_id |      97dd83f58ab949ba88d543b26665b564      |
+-------------+--------------------------------------------+
[iyunv@controller ~(keystone_admin)]#

keystone库的endpoint表加了三条数据
vmware iscs硬盘新建个10G的
然后
pvcreate  /dev/sdb  
vgcreate vgstorage /dev/sdb
vgs
lvs

修改Cinder的配置文件,在配置文件里面指定了keystone的设置,cinder采用的逻辑卷的名称vgstorage,和指定了cinder服务器的ip地址
cp /etc/cinder/cinder.conf cinder.conf
修改后vimdiff观察修改,每个操作启示就是在default下面多了一行

openstack-config --set /etc/cinder/cinder.conf  DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf DEFAULT sql_connection   mysql://cinder:cinder@172.16.21.233/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT volume_group vgstorage
openstack-config --set /etc/cinder/cinder.conf DEFAULT volume_driver cinder.volume.drivers.lvm.LVMISCSIDriver
openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 172.16.21.233
openstack-config --set /etc/cinder/cinder.conf DEFAULT rabbit_host  172.16.21.233
openstack-config --set /etc/cinder/cinder.conf  keystone_authtoken auth_host 172.16.21.233
openstack-config --set /etc/cinder/cinder.conf  keystone_authtoken admin_tenant_name admin
openstack-config --set /etc/cinder/cinder.conf  keystone_authtoken admin_user admin
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password openstack

cinde.conf多了如下

[DEFAULT]                                                
auth_strategy = keystone                                 
sql_connection = mysql://cinder:cinder@172.16.21.233/cinder
volume_group = vgstorage  
volume_driver = cinder.volume.drivers.lvm.LVMISCSIDriver
rpc_backend = cinder.openstack.common.rpc.impl_kombu   
my_ip = 172.16.21.233                                    
rabbit_host = 172.16.21.233
[keystone_authtoken]                                    
auth_host = 172.16.21.233                             
admin_tenant_name = admin                          
admin_user = admin                                    
admin_password = openstack


创建cinder数据库

openstack-db --init --service cinder --password cinder --rootpw openstack

migrate_version表默认有一条数据
quota_classes表会有默认三条数据
volumes snapshots gigabytes
修改权限

chown -R cinder:cinder /etc/cinder
chown -R cinder:cinder /var/lib/cinder
chown -R cinder:cinder /var/log/cinder


配置iSCSI服务,配合Cinder,将Cinder创建的逻辑卷通过iscsi挂载给虚拟机
vi /etc/tgt/targets.conf,添加一行:
include /etc/cinder/volumes/*
·设置tgtd服务开机自启动,并启动tgtd服务
chkconfig tgtd on
service tgtd start


·设置Cinder服务开机自启动,并启动Cinder服务
chkconfig  openstack-cinder-api on
chkconfig openstack-cinder-scheduler on
chkconfig openstack-cinder-volume on
service openstack-cinder-api start
service openstack-cinder-scheduler start
service openstack-cinder-volume start


cinder list  查看目前的EBS块存储

# cinder list
+----+--------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+----+--------+--------------+------+-------------+----------+-------------+
+----+--------+--------------+------+-------------+----------+-------------+
[iyunv@controller volumes(keystone_admin)]# lvdisplay
[iyunv@controller volumes(keystone_admin)]# vgs
VG        #PV #LV #SN Attr   VSize  VFree
vgstorage   1   0   0 wz--n- 10.00g 10.00g
[iyunv@controller volumes(keystone_admin)]# cinder create --display-name=vol-1G  1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2015-02-04T06:41:05.986450      |
| display_description |                 None                 |
|     display_name    |                vol-1G                |
|      encrypted      |                False                 |
|          id         | d6e1529f-633c-4e86-ad45-fc61734b950e |
|       metadata      |                  {}                  |
|         size        |                  1                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+
[iyunv@controller volumes(keystone_admin)]#
[iyunv@controller volumes(keystone_admin)]# lvdisplay
--- Logical volume ---
LV Path                /dev/vgstorage/volume-d6e1529f-633c-4e86-ad45-fc61734b950e
LV Name                volume-d6e1529f-633c-4e86-ad45-fc61734b950e
VG Name                vgstorage
LV UUID                ff6Rkw-GCFP-UEMx-SydY-rcJa-fpEJ-4xnH1L
LV Write Access        read/write
LV Creation host, time controller, 2015-02-03 22:41:06 -0800
LV Status              available
# open                 0
LV Size                1.00 GiB
Current LE             256
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           253:0



当将该卷绑定到VM上面后可以查看:
tgtadm --lld iscsi --op show --mode target 
???? 怎么绑定?

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-161973-1-1.html 上篇帖子: openstack安装笔记 glance(二) 下篇帖子: openstack dashboard 修改密码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表