马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
1. 检查cinder当前backend配置 使用cinder service-list,查看cinder-volume服务的Host字段格式。 旧版格式: + q7 b7 F" S+ x7 N8 K/ \& [8 \, D
新版格式: 5 v% s1 ^, c$ o9 x* Y
旧版中Host字段是cinder-volume服务所在节点的HOSTNAME,新版中Host字段是HOSTNAME@BACKEND。 如果是旧版,需要先修改为新版,见步骤2。 如果是新版,不需要修改,直接执行步骤3。
4 s6 q% v1 `& p2. 修改旧版backend配置为新版 编辑/etc/cinder/cinder.conf文件,删除其中原有的ceph backend相关配置: [backcolor=rgb(245, 245, 245) !important][url=][/url]
5 B9 o3 ]$ {6 Z9 R[DEFAULTrbd_store_chunk_size = 4rbd_max_clone_depth = 5rbd_flatten_volume_from_snapshot = truerbd_ceph_conf = /etc/ceph/ceph.confrbd_pool = volumesrados_connect_timeout = -1volume_driver = cinder.volume.drivers.rbd.RBDDriver[backcolor=rgb(245, 245, 245) !important][url=][/url]
7 Q5 }( u, W7 }/ ^7 A- V3 Q* D5 N& _! y% o
添加如下配置: [backcolor=rgb(245, 245, 245) !important][url=][/url]+ l" ]! r# C( N; h$ c! \4 q; \
[DEFAULTenabled_backends = ceph[cephrbd_pool = volumesrbd_ceph_conf = /etc/ceph/ceph.confrbd_flatten_volume_from_snapshot = truerbd_max_clone_depth = 5rbd_store_chunk_size = 4rados_connect_timeout = -1glance_api_version = 2volume_backend_name=cephvolume_driver = cinder.volume.drivers.rbd.RBDDriver[backcolor=rgb(245, 245, 245) !important][url=][/url]- z. U, f, Y, F: x2 Z+ L" {- W3 N
9 Z+ @0 m) }( w! W2 H- x0 t' t w
重启cinder-volume服务: # service cinder-volume restart # 对于Ubuntu 14.04# systemctl restart openstack-cinder-volume # 对于CentOS 7
. Z) x2 e1 |, q1 d/ }. l" Q执行cinder service-list,查看cinder-volume的Host字段是否变为新版格式。 然后更新已经创建的volume的host属性: # cinder-manage volume update_host --currenthost HOSTNAME --newhost HOSTNAME@BACKEND
* w: t2 _) s6 N. W& f( \' U例如: # cinder-manage volume update_host --currenthost node-1.domain.tld --newhost node-1.domain.tld @ceph
$ b5 b9 W4 v6 g* h查看volume 的os-vol-host-attr:host属性已经变为HOSTNAME@BACKEND#RBD的格式: 2 `& E8 d3 c2 V N5 F& h) x- _% z
到此,旧版配置格式已经改成新版配置格式,进行步骤3添加另一个ceph后端。 0 Z- p; o( D9 X9 i. o4 _
3. 添加一个ceph后端 将新的ceph集群的配置文件复制到所有openstack节点(包括控制节点和计算节点)。 注意:不同ceph集群依靠配置文件的名字区分,如:已有ceph集群的配置文件为/etc/ceph/ceph.conf,如果新集群全用SAS盘,配置文件可以命名为:/etc/ceph/ceph-sas.conf。 然后编辑/etc/cinder/cinder.conf,添加新的ceph backend,编辑完后的相关配置如下: [backcolor=rgb(245, 245, 245) !important][url=][/url]
# w) I/ s# |/ v& |& V* ^5 S[DEFAULTenabled_backends = ceph,ceph-sas[cephrbd_pool = volumesrbd_ceph_conf = /etc/ceph/ceph.confrbd_flatten_volume_from_snapshot = truerbd_max_clone_depth = 5rbd_store_chunk_size = 4rados_connect_timeout = -1glance_api_version = 2volume_backend_name=cephvolume_driver = cinder.volume.drivers.rbd.RBDDriver[ceph-sasrbd_pool = volumesrbd_ceph_conf = /etc/ceph/ceph-sas.confrbd_flatten_volume_from_snapshot = truerbd_max_clone_depth = 5rbd_store_chunk_size = 4rados_connect_timeout = -1glance_api_version = 2volume_backend_name=ceph-sasvolume_driver = cinder.volume.drivers.rbd.RBDDriver[backcolor=rgb(245, 245, 245) !important][url=][/url]
8 D) M. C8 I. \" V2 S+ n6 m- i8 n( v: Y* l, p Z
重启cinder-volume服务: # service cinder-volume restart # 对于Ubuntu 14.04# systemctl restart openstack-cinder-volume # 对于CentOS 7
/ m$ U! i6 z5 R$ M* g, H* E1 C9 I* G! P执行cinder service-list命令,可以看到每个后端对应一个cinder-volume服务:
3 w# w% U3 f9 ^& k/ u
" K/ i% o; G0 f- |4. 配置volume-type 对于每个ceph后端,创建一个volume type,并将volume type关联配置文件中的volume_backend_name: # cinder type-create ceph# cinder type-key ceph set volume_backend_name=ceph# cinder type-create ceph-sas# cinder type-key ceph-sas set volume_backend_name=ceph-sas
0 f: v. Q9 F Q. V( }然后执行cinder type-list可以看到配置的volume type: - L& Z$ `' a) N5 x- i: k$ T
6 Z8 O# Y, g; a# c( t
5. 创建卷 此后创建卷时,可以指定volume type,将卷创建到指定的ceph后端: # cinder create 10 --name vol-01 --volume-type ceph-sas
! X0 q5 h3 c: W前端也可选则volume type: % Z! _" h0 H( d$ M J" J- `
注:如果不指定volume type,cinder-scheduler会忽略volume type,按默认的调度器从所有cinder-volume调度。 |