|
|
创建存储池7 f& f |& o! p- n# E0 j! E
% M X$ u. d1 K" L4 e/ |. ~4 }
# ceph osd pool create images 64
1 I$ x3 n9 m$ X$ _5 ^# ceph osd pool create compute 64
. e: @( B3 [; R/ y$ Q7 X$ R1 d" f# ceph osd pool create volumes 64
: a, v/ ~/ Y5 O" m! _: D( B# ceph osd pool create backups 640 r: T5 M. L6 `+ y
Create Ceph User ceph
# G6 m8 f% u/ H# _4 {" i* b0 ~$ f& i6 ?( \( B; `
# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \6 e' V# a5 i" |: f: `- e4 x! F9 Q/ f3 X `
allow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'2 U) y2 o' F: N
[client.ceph]: W; o: Q+ @; L/ O
key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==
5 q' ~6 t" a" X: T
+ H7 ^, V1 ~ M; fcopy user.keyring to glance-api node and cinder-volume node
1 e; F7 F! ?/ k% d
9 W0 k1 P' Y7 y Kceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring* R. a$ ?# }, K$ {7 z
# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/
- X0 q/ K! P, @# m7 [# H# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/
1 F) ?" C" x2 u" L6 x
2 P: S- E" k2 V9 v+ W. O对接glance-api
3 C: e8 `: E2 i+ W" g5 Pinstall rbd% r5 H# H3 k$ q; R$ Z
W U: n: w F* f L
5 E+ w9 x& a; {! L- N
# yum install ceph-common python-rbd
! P; i- D' L2 Z设置key权限
: S) K2 i& D/ ~( c' K) r6 N. O2 p; d) U' f5 K- y
h7 X$ n) Q( b6 s3 T, P# chown glance:glance /etc/ceph/ceph.client.ceph.keyring
8 A- |& R, x. e2 v7 ?( L$ vedit /etc/glance/glance-api.conf
) O# \* v/ b7 }9 \7 C% q2 ]% [3 l% C" j1 [
6 t2 R7 M/ T+ J4 d
[DEFAULT]
" [9 p' [* t! ?7 e...4 j1 Y5 \; {# _% x
default_store = rbd" P p# j& X' G( E
...
3 M1 S5 u( Z! z! |" A8 X8 F# E[glance_store]
& L: q! ~( E4 i+ }stores = rbd
' \+ L. Q5 r, J4 yrbd_store_pool = images
! o" ~* I+ F/ l" S8 grbd_store_user = ceph
% H" h7 H5 ?9 D# }rbd_store_ceph_conf = /etc/ceph/ceph.conf
* x# \' x, y& H# x9 Brbd_store_chunk_size = 8
' B! m2 \, i$ P4 s+ _- }: ?& frestart glance service
' p& G0 Q' u. k, Y0 r1 v% P, {2 m0 v9 ?7 s, y
4 r, d9 M( o" \1 u4 c& c
# stemctl restart openstack-glance-api.service openstack-glance-registry.service% e- \; \' M. G! w ]) K
2 H L3 V @) H3 c
# k! B8 g8 `- i. c9 Y' C- o' }; {
对接cinder-volume, b+ v9 C, K) C3 T
install ceph-common+ g% t( v0 z6 |- _7 q. |0 e: S
4 l* X; X+ e' g) d
# yum install ceph-common python-rbd
% q& f+ k3 s( o: t" _3 O设置key权限
7 D, f! r: F, J
3 y0 R- H) Q0 b9 r2 _
4 K; u# C! ~# J! o1 b7 T! n2 |# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring' t$ v7 J( x; F: V0 ], c+ t$ T
edit /etc/cinder/cinder.conf6 C. U$ Y; |" A0 h S
4 _* s" V4 _- I. d+ t( p8 y) ~
[DEFAULT]
7 {7 M2 G/ ?6 o3 ~( T2 h8 j( j- t. S' v% A4 O% N7 ]
enabled_backends = ceph
P8 J4 {3 O( m5 f: }5 K, t
4 ~8 W+ z4 N! ]" b8 n' i! d0 |# `[ceph]
; L" }* ?9 Z" o: _5 w$ ^4 |, D" y) ~3 Z/ Q9 t& J6 b
volume_driver = cinder.volume.drivers.rbd.RBDDriver' G( S1 d7 G; l3 {: V3 z5 b
volume_backend_name = ceph3 [8 s: i# g5 ~& f, F
rbd_pool = volumes9 D" n, ]2 @! }: Z4 Z
rbd_ceph_conf = /etc/ceph/ceph.conf
9 ~/ A* J: @# _2 \& Erbd_flatten_volume_from_snapshot = false
' O& j, U5 w( e% T$ t0 Prbd_max_clone_depth = 5, k+ F2 a) E7 ~4 k
rbd_store_chunk_size = 4
3 p( r/ l& c/ U9 T% crados_connect_timeout = -1, K8 w6 S6 o* N$ I
glance_api_version = 2
9 J; K2 l0 }9 k" s( \1 Jrbd_user = ceph
P3 X5 s4 \. M6 w1 Jrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
' ~) o! U) W/ F; X: J: Rrestart cinder-volume service
- K5 m9 `9 m) b- H1 V: j; k8 H3 v6 M" N# c, [% C% y
# systemctl restart openstack-cinder-volume.service$ z% |: o2 c4 l) B5 s0 b- V
) [3 E U9 B, `* ^
- S: X3 o3 _! C9 D
8 o4 L! Y, a b3 [, [对接compute% q# w( k# F# J5 N
install7 X3 F( A4 j& l6 o) h& a
7 n7 X- ^( T2 ^. ~% p8 i# yum install ceph-common python-rbd: I# e) }4 T/ Z1 [! s/ ?; @# m. ?
edit nova config5 T) `, w& P5 {" _- h1 l
( P' G# E: b( \" j# g- q
[cinder]/ P6 _! l5 h% N* j
os_region_name = RegionOne [% K4 l& U/ B+ ?6 x! b
* g" T- ~' P2 s$ G# p+ x
[libvirt]
: z& R! A+ ^3 s3 Z8 E g8 A/ oimages_type = rbd5 x+ q+ C( ~4 U+ Y$ q$ ^4 ?
images_rbd_pool = compute
$ t1 a8 R, R( F% v" fimages_rbd_ceph_conf = /etc/ceph/ceph.conf& t$ |2 |: ?2 O9 e$ y
disk_cachemodes="network=writeback"$ D- J& Q+ N9 S# l0 p9 j2 i
rbd_user = ceph
. Q1 m+ V \2 J. n# Wrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
g$ Q8 \. b9 K7 M3 C2 `
0 d I, A4 w, y8 Winject_password = false
: g; @, a5 Z3 ]; {3 Y# s, sinject_key = false
$ ?& h( l- D: d; g0 \9 G. ginject_partition = -2$ V0 O- O/ q# C6 a) R5 x( A& n
. w. o, s/ |1 A6 c& w
live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
: J/ ?$ D" {7 m) I/ z. ohw_disk_discard = unmap. N s8 V; |1 D6 n$ Y" Q2 I
7 u& ~( s+ o- D# o6 q
3 I8 M5 t" Q+ t# K) [" ?2 I1 G2 h- i# d, e# R7 q$ Q: h; ?' I/ l: A
0 V# ?: F i& |4 ~: M+ x
copy ceph config
* q8 l" x# g- r3 o9 x# [
. _1 F0 M5 R" h4 W6 n d7 c# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring /etc/ceph
7 u. K8 a0 F4 [. _! b1 R# chown nova:nova /etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring
) q4 T3 i& M, k5 ncopy ceph user keyring! |) k1 G2 s: x% q& i/ H$ w+ K
/ z7 W+ Y6 |) {$ q2 s2 J n
- Z; q$ {. ^" L3 y5 `[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key
3 c, l$ I9 T; \' l( Y" U8 h$ ^[ceph-monitor]# scp client.ceph.key compute:/etc/nova
1 v4 m% E; X/ ^) A! ~) K* w
. Z( y9 {) V B! [) e3 |8 O+ [8 V6 V! C- x$ H" R
# v8 U; v o0 ^: F4 j! u8 e2 A$ @设置libvird2 [0 a9 m- v4 N9 `7 D% H
& K/ ?! J1 D' W+ z$ a- Y# uuidgen * W) a$ t% s9 \7 |
791c2ef6-bc56-43b0-b2c7-0cd8636210406 v4 N( b0 w% [$ A# v2 ~" `
( p! u0 `# u" w6 A* [ # cat > secret.xml <<EOF
: a* @* o5 @# S<secret ephemeral='no' private='no'>
2 ?$ w" Z; O' [1 r e0 d <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
9 C, x5 x+ @/ U. E0 D7 x <usage type='ceph'>
' _% t9 ?& a" r H) U# c <name>client.cinder secret</name>2 j% f8 a" D$ m* n! i2 d: M
</usage>: k* D: q3 R- L, w
</secret>/ [% _& i* V! y
EOF* X% w7 _6 S# h/ }0 m
- E! Y0 e: c* {7 h0 L$ S/ j# virsh secret-define --file secret.xml
- Q R& y; h# _: a6 G! gSecret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created: m; G! E% E1 W8 j- ?; _& h1 K
$ A n# @5 E# `8 a' z2 R/ ` P
# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)
2 n2 O+ J) W. bSecret value set" c2 F: i9 ], V+ \' a& L! h& W7 d
restart nova-compute
- q% S% c: ^+ Q! m+ F6 a. d; X! z C" k4 @4 {
systemctl restart openstack-nova-compute.service4 W/ ~7 n- Z# c, L1 ]! G
|
|