|
1、SJ-6-Cloud121 192.168.170.121 操作 创建ceph 磁盘类型 cinder type-create sata02 cinder type-key sata02 set volume_backend_name=CEPH02_SATA cinder type-create sata03 cinder type-key sata03 set volume_backend_name=CEPH03_SATA ! a O9 r: B# p, ?. h7 v, ~8 J
配置cinder文件 mkdir /etc/ceph/ceph02/ mkdir /etc/ceph/ceph03/ scp 192.168.170.36:/etc/ceph/ceph.conf /etc/ceph/ceph02/ scp 192.168.170.36:/etc/ceph/ceph.client.admin.keyring /etc/ceph/ceph02/ scp 192.168.170.41:/etc/ceph/ceph.conf /etc/ceph/ceph03/ scp 192.168.170.41:/etc/ceph/ceph.client.admin.keyring /etc/ceph/ceph03/ enabled_backends=sata02,sata03 [sata02] volume_driver=cinder.volume.drivers.rbd.RBDDriver volume_backend_name=CEPH02_SATA rbd_pool=volumes rbd_ceph_conf=/etc/ceph/ceph02/ceph.conf rbd_user=cinder rbd_secret_uuid=62b1ed02-5de2-4a53-be1e-0477d1b385ae rbd_max_clone_depth=10 rbd_flatten_volume_from_snapshot = false rbd_store_chunk_size=4
5 k; L2 e/ h) V9 o8 i[sata03] volume_driver=cinder.volume.drivers.rbd.RBDDriver volume_backend_name=CEPH03_SATA rbd_pool=volumes rbd_ceph_conf=/etc/ceph/ceph03/ceph.conf rbd_user=cinder rbd_secret_uuid=62b1ed02-5de2-4a53-be1e-0477d1b385ae rbd_max_clone_depth=10 rbd_flatten_volume_from_snapshot = false rbd_store_chunk_size=4 . B9 m. n$ S: B$ K
192.168.170.121 获取cinder glance key 获取默认ceph cinder glance 认证key scp /ect/ceph/ceph.client.cinder.keyring 192.168.170.36:/etc/ceph/ scp /ect/ceph/ceph.client.glance.keyring 192.168.170.36:/etc/ceph/ + i$ Y/ T6 Z+ i8 d0 B% |
ssh 192.168.170.36 导入ceph02 auth key 删除 ceph auth import -i ceph.client.cinder.keyring ceph auth import -i ceph.client.glance.keyring 更新权限ceph ceph auth caps client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=images'
4 _+ k2 X1 ~6 Y `, X, R192.168.170.121 获取cinder glance key 获取默认ceph cinder glance 认证key scp /ect/ceph/ceph.client.cinder.keyring 192.168.170.41:/etc/ceph/ scp /ect/ceph/ceph.client.glance.keyring 192.168.170.41:/etc/ceph/
; N: a* `3 L! _' ?ssh 192.168.170.41 导入ceph03 auth key 删除 ceph auth import -i ceph.client.cinder.keyring ceph auth import -i ceph.client.glance.keyring 更新权限ceph ceph auth caps client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=images' 重启cinder服务服务 openstack-service restart openstack-cinder-api openstack-service restart openstack-cinder-scheduler openstack-service restart openstack-cinder-volume 配置完此处之后,glance从镜像启动创建磁盘时,rabbitmq消息,多个后端cinder-volume都有可能接收到;此时应该指定默认的类型来接收;
# T* k5 S+ \% }" D[url=] [/url]9 q$ U0 B- m; \( c3 R* U# j3 P
1 故障2 3 消息4 Build of instance 9865bdf5-12e5-4147-b1cf-d0e33a5ae88d aborted: Failure prepping block device.5 编码6 5007 详情8 File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2235, in _do_build_and_run_instance filter_properties) File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2349, in _build_and_run_instance 'create.error', fault=e) File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__ six.reraise(self.type_, self.value, self.tb) File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2319, in _build_and_run_instance block_device_mapping) as resources: File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2458, in _build_resources reason=msg) [url=] [/url]
5 h, K$ [0 a+ E, U! [" V
4 w$ S3 ?% T/ P, s1 \* J
$ k1 C# o$ c* `cinder配置多ceph后端:并指定默认pool
) n8 N5 F! h% d# }4 [7 d4 r创建type: cinder type-create XXX
; {6 X6 [/ F$ W7 X7 ~8 M/ Acinder type-list1 h0 e: L! c% f. B+ b! H& A
+-------------------------------------------------------+--------+' N3 V5 m4 g# U# p& q) z( ]
| ID | Name |9 {6 y$ F- u6 _/ F3 R- E9 A
+-------------------------------------------------------+--------+
4 a' Q; D* b4 ?, e| 1908f00c-a865-472c-8f90-c44d29361bd3 | sata03 |- \, q7 ]. B2 A5 \% u A
| 3b6e978f-839b-4164-b5e5-8e6e2d63fdde | sata |
$ w+ q( z3 }8 g| ead23626-0bb9-4515-9906-0b5e6f41320a | sata02 |5 _. r- D( R) {( W3 W
+-------------------------------------------------------+--------+
8 ~6 G% K: q; F' y- _/ x) u0 z
) f; H' F0 Y, b4 z8 C指定extra-specs:cinder type-key XXX set volume_backend_name=CEPH_XXX* ^6 k& p1 }+ V2 H; z$ f) O
cinder extra-specs-list. u! `4 |* Z! m0 ]' P/ P, L; N9 H* i
+------------------------------------------------------------+--------+------------------------------------------------------------+5 K, I" k: Z, |* Y! W, l" b
| ID | Name | extra_specs |3 Q3 g P1 g( u5 n) Y
+------------------------------------------------------------+--------+------------------------------------------------------------+( `) q, m/ t; p, p$ c8 Y
| 1908f00c-a865-472c-8f90-c44d29361bd3 | sata03 | {u'volume_backend_name': u'CEPH03_SATA'} |
! P! ~# x9 k# R* e: G| 3b6e978f-839b-4164-b5e5-8e6e2d63fdde | sata | {u'volume_backend_name': u'RBD_SATA'} |5 M9 W9 Y5 @ a2 T/ a& h9 m
| ead23626-0bb9-4515-9906-0b5e6f41320a | sata02 | {u'volume_backend_name': u'CEPH02_SATA'} |6 K* o" Y- k2 h5 q$ _% m0 W; _
+------------------------------------------------------------+--------+------------------------------------------------------------+
. |. f+ P+ [3 r+ c, N% o% d$ Z) ]1 c) e
修改cinder.conf:% s5 m- J+ N* I8 p" R; r3 g+ E
在DEFAULT段下指定default_volume_type = XXX
5 x+ H( B: A% u; r$ i* d* t9 \ h( u/ Z: C! k
[DEFAULT]
8 g" S: R/ P4 ]; e5 W3 R...
5 Q* j6 s" ~. |& N4 idefault_volume_type=XXX #glance创建的磁盘将位于此处' v' _+ ?' W' g' ]" _2 a
enabled_backends=sata02, XXX+ o' z' o \0 M5 }
4 ^+ M+ y6 y3 T$ W3 D: r[XXX]1 H6 J5 ?( ]: U* y
volume_driver=cinder.volume.drivers.rbd.RBDDriver K1 d; d+ A: [0 }
volume_backend_name=CEPH_XXX
* O) B: c) ~- O0 X7 N5 h/ c6 f" _4 Grbd_pool=volumes: K( w. c/ }: }6 d. {' u* R
rbd_ceph_conf=/etc/ceph/ceph02/ceph.conf' K9 w3 ^5 F/ m3 m" d
rbd_user=cinder
% }; R5 A$ F1 L1 _rbd_secret_uuid=62b1ed02-5de2-4a53-be1e-0477d1b385ae
: n5 z( G+ }- B* Lrbd_max_clone_depth=105 Y _$ u* q% O* ~3 }5 q
rbd_flatten_volume_from_snapshot = false+ v( X! y$ J: b# q! c7 b
rbd_store_chunk_size=4 |