|
|
创建存储池5 ]( B3 q# \ y% ~: t
~. Y! ?1 `0 ?# f# ceph osd pool create images 645 h2 C8 g- f; ^( y
# ceph osd pool create compute 64
% ?7 L$ @8 S' }2 f# ceph osd pool create volumes 64( _# U9 N% k# f Q4 S( b; O! _
# ceph osd pool create backups 64' [8 ?8 a! e, c
Create Ceph User ceph, S/ Y7 R7 v7 S5 \& _
+ F# s5 J; ~% ^8 t0 u, L# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \8 I- V, W8 H! j* {6 K* O5 X: X% K$ y
allow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'
y: t- b; d( Q[client.ceph]' q5 @9 n: j% S; x* p/ x
key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==
3 R0 G# T4 `) ~% b$ w: o+ d' M9 e# G( o* d" q, l
copy user.keyring to glance-api node and cinder-volume node6 Z+ V2 C7 U3 T- U
S( |" u" I9 A/ r6 R. `5 {ceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring H# e4 h2 C$ v
# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/
* h: ?, n$ w/ R8 n: ~5 q. e! B: M# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/
, m7 Z% ?5 Q& \2 I. N6 Q1 k# b# ?, f9 e. z$ v& k, {2 z5 a
对接glance-api1 l2 G% I* V$ [ b2 e7 H. s
install rbd% s1 v$ R$ p$ A0 f: x
; ]3 O# Y0 K/ S9 C4 v
; a% y, U1 L1 P* W) o7 X# k
# yum install ceph-common python-rbd
5 k4 z& `5 ~: L5 W设置key权限8 ?% @9 G: y; k& U4 S- V
2 F& p. v1 G$ a1 j$ o9 v. s
9 b6 M* @. d- i% s5 l/ b% x! _( Q# chown glance:glance /etc/ceph/ceph.client.ceph.keyring3 V Y" w" {5 j3 c
edit /etc/glance/glance-api.conf
+ v( H7 O; u0 s# z5 m5 ^. `' K# c( D
1 Z/ g, J u% q8 S7 o4 g y+ x
[DEFAULT]/ x$ Y0 ~5 o# a$ G1 L0 Y
...
" D, h9 y$ x, B; X# }. edefault_store = rbd; _/ @) {2 e! ~$ c8 c' g* t4 Z
...
) A3 c# p9 B+ [ t2 a( M, K[glance_store]
0 ] I$ w, h* B2 lstores = rbd. L# B6 Z* A) |" k# p$ M
rbd_store_pool = images% Y. ` X7 [( {
rbd_store_user = ceph
, g+ R" ^+ w L Q, d2 G6 ~rbd_store_ceph_conf = /etc/ceph/ceph.conf
] T r! s$ M3 |rbd_store_chunk_size = 8: h* U8 s5 y* R# y" q5 b
restart glance service
7 J) Q! Q! ]# \! ]- V
" X* V) z) G' n V% x$ f }
0 U3 i( w3 c) L+ G# stemctl restart openstack-glance-api.service openstack-glance-registry.service6 M9 K! h0 z" y; y8 c/ L& j8 \
& `& v) r+ P+ L! {( A- e
?4 {1 k+ C1 I: W/ M- E对接cinder-volume
* @3 \0 t8 L) w; Einstall ceph-common) ]( m) h( d! Q1 e6 f Y
& ?2 a' u5 ~8 F3 ] }, o
# yum install ceph-common python-rbd' P+ k, ~+ F. }% Y6 } R9 [, s6 h
设置key权限
# o: F) w, s3 q4 G' U1 \
4 N4 e" S- P- j
$ V: @; w% s1 g" s3 a7 j: D# S# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring
0 \$ e% f3 O9 x& M" xedit /etc/cinder/cinder.conf
! V# c* r- A& e, K
# s9 }& h4 F/ n0 ?" ?/ H[DEFAULT]
& Q9 ^' S. ~5 e* s9 e& ?; R7 Z5 a! ?7 x6 |" D
enabled_backends = ceph8 n* w6 t3 a% n2 _
# c4 H9 E6 a/ f6 [[ceph]6 ^. u7 h. w! ]) t
t2 A! C8 W$ m/ F) Q# K7 }! b
volume_driver = cinder.volume.drivers.rbd.RBDDriver
' q j c$ ^( {# dvolume_backend_name = ceph* e' ~! o! L" s6 a z6 ]% }9 s
rbd_pool = volumes8 m1 f- Y$ C6 o' n4 G5 v. p
rbd_ceph_conf = /etc/ceph/ceph.conf9 X7 I ^+ G9 z K. g' T1 w
rbd_flatten_volume_from_snapshot = false0 k$ o; D& D5 d3 P
rbd_max_clone_depth = 5; v* W3 V& s3 n0 a7 z
rbd_store_chunk_size = 49 K* k9 u. Z3 C/ s. M/ B
rados_connect_timeout = -1
2 K5 V4 h: E7 P$ L. j* Oglance_api_version = 2
4 N: B; E* C% Z/ b! Frbd_user = ceph
/ K% }; G, A" F+ X, O/ ^rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
# j4 j. I( T, K6 f% v. _restart cinder-volume service, P/ Q# E4 g* E! c1 U$ `
8 B2 F2 v. A8 K
# systemctl restart openstack-cinder-volume.service! G4 C; s" i8 }* A9 K. {# q; G
/ V# C, h, ^7 o" H* l% k. H; k3 e) c3 f$ j0 S
& v* d8 F2 z4 Z+ w& G
对接compute
0 z$ _! `# D" f" J+ d) |install
- O2 g& O# A6 N U, ~' @% c8 D8 u2 s+ h- r! j
# yum install ceph-common python-rbd9 K6 g- e. F! J
edit nova config
. f9 ]4 j* Y( ]7 C2 a; H1 R
" q6 k# P4 S) L( W: r[cinder]: o& I* O- H+ \# X& w+ L t9 j
os_region_name = RegionOne
9 Q6 W7 U2 Y) X' {. Y7 `; L) F! I) |0 ~- ]0 Q7 _7 p/ n
[libvirt]
* R( C5 ?8 [ V- y0 ^( gimages_type = rbd
* i; k: Q G$ D! U- y0 T# `: ~images_rbd_pool = compute
* ` T) d# ?# }) K" C5 Yimages_rbd_ceph_conf = /etc/ceph/ceph.conf- k+ ?( {4 _( W& G f2 g2 p* f: p2 P
disk_cachemodes="network=writeback"
8 l7 B+ Y( j3 H1 H m; D: x: E8 zrbd_user = ceph8 ~+ U" Q) I! q! \$ {$ k
rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040. ^1 D' _, c- y7 F
4 R, a! D8 ^0 q! D+ Q7 {+ dinject_password = false2 b- T4 m) e# t: W. s- }6 J# r
inject_key = false
. M8 C% b/ y$ f( B A- Iinject_partition = -2# Y9 L% P$ c8 s! A% ]8 a4 a
1 [8 N2 k/ X" e j7 q! }% Hlive_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
7 N m0 p. Z) J* J/ N. r( uhw_disk_discard = unmap
! V3 [6 i- e4 }" D U
, J# m0 w) x0 T' I4 z
7 Z0 i0 ~! q$ {( \/ p. Z; X7 }+ f+ e
4 ^! ?* g$ d. @, \: ?) ]
copy ceph config g! V6 x8 ]2 u t
5 a2 J7 F5 g/ y# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring /etc/ceph
' |* X8 H# g7 _. ]4 c# chown nova:nova /etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring
& X( X( Y5 `+ j- t# y2 J8 Jcopy ceph user keyring) P, e8 K* u8 Z: F, k3 g' \
: \3 w1 k P8 W8 {+ }
; e. m. k' }9 w* p3 x
[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key0 }9 W4 L. _; H V- j$ R5 G
[ceph-monitor]# scp client.ceph.key compute:/etc/nova- Y5 y) f- `& w) h
) C# \5 y# q: l& f$ F, q& s6 o0 f, f9 t! O0 r7 u9 ]
# Z# X8 K, f' [+ f" |& M8 G% k设置libvird! W3 }3 B9 j i# H, l5 Z" z/ Q
& S4 O5 W8 L8 e- |" v# uuidgen ) C- ^0 l, M# A* V3 T. G) O
791c2ef6-bc56-43b0-b2c7-0cd863621040( g8 v) u- j+ X5 S Y3 n" x3 m3 s5 E7 V
# i' E" h9 t" `6 X
# cat > secret.xml <<EOF
( |* o+ \/ G1 G- _<secret ephemeral='no' private='no'>" B1 A5 J1 {$ A4 A0 Q# w
<uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
6 ]" a& U' ?( N( b <usage type='ceph'>1 f& z8 n; c8 {" {! r( _
<name>client.cinder secret</name>0 z+ u% b4 U1 }; W0 r; Y8 ^$ m9 o& D
</usage>
: q3 G0 a$ R& H9 Q7 _</secret>1 t* W8 v ]( \1 x, m
EOF
& S% \( s5 D8 s: d F' k/ z) J% v9 j$ }; M' l" ~6 Y
# virsh secret-define --file secret.xml
% t. S, | P# t i( v& ^Secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created
. E' v' u9 z% c" P% |7 y
, |5 ]0 m4 M) F, O! m# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key) # i# M- L. H6 }" l* ]% o
Secret value set1 d* K$ P: v d9 L; h$ E" d7 A
restart nova-compute8 _5 g& X! t- _1 q
3 L& ]$ Y& A# d9 T* u' M7 @
systemctl restart openstack-nova-compute.service
$ Q" {& a5 V9 S. u$ p3 ]% m |
|