|
|
楼主 |
发表于 2021-4-18 19:59:16
|
显示全部楼层
安装环境准备# `. R0 V" V. T, M; o* Q+ x. ?. q
官方部署文档:
( `! ^1 N- b# g4 Qhttps://docs.openstack.org/kolla ... ser/quickstart.html6 u8 ?' b" R% f w
# ]3 w4 L8 H3 z) c; p% B
本次部署train版all-in-one单节点,使用一台centos7.8 minimal节点进行部署,该节点同时作为控制节点、计算节点、网络节点和cinder存储节点使用,同时也是kolla ansible的部署节点。
8 X6 i6 F+ E; Y9 d8 `$ n' z5 G1 F0 r2 J$ {( D# b: `9 y
kolla安装节点要求:3 }5 ]( K' {0 q& q9 [- u+ p# {! ~, i- t
' F! i6 y- E9 b4 Q9 `
2 network interfaces
0 L' Y4 G3 w) j& L6 s, U3 M7 P: v8GB main memory, T2 W& Q' a: W& F1 U" D
40GB disk space4 W- r: H) D6 e
如果是vmware workstation环境,勾选处理器选项的虚拟化引擎相关功能,否则后面需要配置nova_compute_virt_type=qemu参数,这里选择勾选,跳过以下步骤。
7 D M+ s: w4 a- x: {) D- a# l6 i2 t, G( C% `0 v" z% W
# cat /etc/kolla/globals.yml' ~. X" Q( j" E1 |8 R. Z- s
nova_compute_virt_type: "qemu"
& N; P0 I' u j! T% l& R7 D& i5 T0 C4 s$ }
#或者部署完成后手动调整
\1 _9 N, F* }! _7 K7 }# h: A[root@kolla ~]# cat /etc/kolla/nova-compute/nova.conf |grep virt_type X5 j: a# S# E/ s, ?. l
#virt_type = kvm; f# N! k: A7 x& K8 F8 Q0 E, [4 Z
virt_type = qemu
5 n* e6 w5 d; [: [/ W! ]. @ O$ c* m$ K
[root@kolla ~]# docker restart nova_compute2 @; U) ]3 P- E4 y. g) S
1
8 g8 a/ R; T0 P; Y( M# b27 ~7 l4 l+ q7 m1 d- D
3
4 `+ M; q) Q, S6 K4$ _: y5 O6 ?, r( G8 O9 x
5 t4 a+ o8 K/ @# z7 X; b, b& f4 ]
6" S/ V* A" ^& A! ^
7% p9 h& D' O& m4 L$ t9 y
8+ \" k& _9 I' t' C
9
0 M8 B2 V, E. ?5 `. h+ N% fkolla的安装要求目标机器至少两块网卡,本次安装使用2块网卡对应管理网络和外部网络两个网络平面,在vmware workstation虚拟机新增一块网卡ens37:
. d9 }2 }7 }( Y w6 z6 `" S& n4 X( b; h/ S
ens33,NAT模式,管理网络,正常配置静态IP即可。租户网络与该网络复用,租户vm网络不单独创建网卡5 `) R# `+ O* Z& T9 V
ens37,桥接模式,外部网络,无需配置IP地址,这个其实是让neutron的br-ex 绑定使用,虚拟机通过这块网卡访问外网。7 r: p! J1 ^7 d- _) t
ens37网卡配置参考:
$ A" ]! g, h; G& L" ^: Whttps://docs.openstack.org/insta ... ing-controller.html; p% B% z) W0 B# y/ k
" t/ ~! i$ l0 ^9 o. b) P2 R- G
cat > /etc/sysconfig/network-scripts/ifcfg-ens37 <<EOF
4 @1 ^4 j8 q' i% `% L7 ENAME=ens37
# q6 g, c7 f0 c' a6 D5 JDEVICE=ens373 x/ |( e* N+ N6 }- m0 J: B4 [
TYPE=Ethernet
; b1 S2 k# g: H9 |1 yONBOOT="yes"
6 b( {2 c& r% E, O* H- M8 u( \BOOTPROTO="none"
- P' I& [% z% B2 E% XEOF
' D T0 r" A( u" x
! |& w4 h% I8 d, T# t9 `#重新加载en37网卡设备/ G/ j, z1 d1 N0 I+ ^- U
nmcli con reload && nmcli con up ens37
% H* @5 ] c5 Q( f) s18 C. X6 Y/ Z/ _. Y9 r% z
2" I& ], Z& f; h- @
38 X+ ]! [. W. [0 A/ E( U
4' z3 m1 _* ]4 S
5! | b/ M$ u5 ~2 R
6
" I. g7 w( I7 p' o7
7 G0 R" Q: m+ a0 S3 b6 |8# W4 o4 I3 F, n% U5 `8 O# k) X2 E
98 b' q( L" y" h0 }
10
. y4 `4 Q) ^; W" d1 I+ D4 t如果启用cinder还需要额外添加磁盘,这里以添加一块/dev/sdb磁盘为例,创建为物理卷并加入卷组。
$ G. b8 Z# i" y1 V3 a, M* o4 C* v7 |! `
3 ^2 a5 w& `& J# apvcreate /dev/sdb
7 Y, X( Q# N# A- d) yvgcreate cinder-volumes /dev/sdb- k' _7 B% \1 p* F3 W. z
13 _5 U. S& `$ h( h, R" t
2 J# \7 Q3 ]8 K, k) |
注意卷组名称为cinder-volumes,默认与后面的globals.yml中定义一致。
2 F% C, t/ m; j+ ^+ s3 }* e1 r, F8 G" K
[root@kolla ~]# cat /etc/kolla/globals.yml | grep cinder_volume_group8 W ^7 j8 w8 z; z& g, A m
#cinder_volume_group: "cinder-volumes"
4 ?% q- h5 A; ^, U- ], z1
5 z$ J2 J: O x& K# [% W2
4 X m/ z6 p4 Y; O, |7 U部署kolla ansible
: F1 z* v- k! g1 j9 v+ @7 e2 R配置主机名,kolla预检查时rabbitmq可能需要能够进行主机名解析8 ^' E2 U) ~( l; x
( I$ _5 s3 _, i8 V$ R, Thostnamectl set-hostname kolla
. g2 ~8 f) j* Z, Y R1 u6 H' r1) v& X1 j0 N5 D0 g1 g: V- H2 x
安装依赖# R! M/ f6 n( u; b
6 D) j( {% t; B. a: o* r- _4 syum install -y python-devel libffi-devel gcc openssl-devel libselinux-python
4 t2 q4 u6 D" I( v1
+ \, a. P7 T- P安装 Ansible,注意版本,默认2.9应该可以满足要求
( w# o1 ?6 X3 O( E' v6 T/ U% |+ f. Y8 f; i: Q& o( W2 `4 H
yum install -y ansible8 Q( C: R4 K7 C0 q y J6 o
1) h3 W6 C4 @' o2 H( R, C
配置阿里云pip源,否则pip安装时会很慢
* ^! o& V; d8 [4 J$ c+ U& {/ g) k6 V6 M* p5 Q
mkdir ~/.pip( ~1 n- v9 z c
cat > ~/.pip/pip.conf << EOF / T* s: q) A' d3 A0 |& \% }: ^7 Y
[global]5 D& p+ V* p# s0 F3 Q8 c
trusted-host=mirrors.aliyun.com9 K1 W& @: L7 N1 P8 a
index-url=https://mirrors.aliyun.com/pypi/simple/" B( L; } t9 f4 v$ ^
EOF: I4 A Q: K* W" g/ E9 {
18 s$ Y4 v6 q8 \# m
2
]* Q& S% i+ E( D% q* A3" R/ i- K' B6 r2 Y: L9 S# A7 T
46 D7 Q1 |( Y; G
5
0 k: v) X0 L# n$ R7 A4 w* r2 X6
* e" Z: p8 Y% p" v安装 kolla-ansible R$ z' Q+ k2 l+ h! R" p
6 d* ~2 \0 L' k3 m3 z4 {2 Y: J
kolla版本与openstack版本对应关系:https://releases.openstack.org/teams/kolla.html
) E6 @% W, Q) Q' [- h5 O% m8 Y
1 r) J3 ~: A! k `8 D! Xyum install -y epel-release1 e; n7 q0 d/ ~ ?& V# I% l! B, y- h
yum install -y python-pip
; K. o# Z: O! W6 J' o% c4 \+ Hpip install -U pip/ ~# W7 O. @- n J
pip install kolla-ansible==9.1.0 --ignore-installed PyYAML
$ Y" i" p" W& g1
+ l: _ K7 n2 {$ c) Z2
& ]8 B( x; z/ g' i2 F3 ]: C3
# h2 u8 x; E% y" ~+ Q) }- Y4) v5 G4 {1 j4 h' }
复制 kolla-ansible配置文件到当前环境
' Y6 [# Z) y& T/ s1 n1 K! w7 m8 \4 |6 }
mkdir -p /etc/kolla
. j) L: k7 \5 p. @6 cchown $USER:$USER /etc/kolla
2 s8 R( T' f% g; M" V& D7 A( \- e! z5 e5 L& s* J. O
##Copy globals.yml and passwords.yml" V) H8 G: K2 q, D
cp -r /usr/share/kolla-ansible/etc_examples/kolla/* /etc/kolla, ~1 e. P) h3 H2 p% D0 U: t$ F* e
, l& N/ o! O: D, ]% c
##Copy all-in-one and multinode inventory files! w. J8 ^9 T9 U1 g: Q3 D h. t" F
cp /usr/share/kolla-ansible/ansible/inventory/* .0 ?' n$ l3 s6 t3 q
1
# G) W+ e* }/ r# ]- T2
$ G( L5 |! y; s8 M9 b3
$ @, s. s: H( J. D" P* T9 g1 r6 z/ r! J% ?4
+ \5 Y' s# \# X! Q% F5
6 I: W$ Y. E. H$ Z6
6 A4 n+ ?' y& H5 H, z0 E7
5 A$ \8 C6 J; L) p8 ?8
) g1 {4 I! b1 E; h- {4 l) Y修改ansible配置文件* k& p$ `2 o7 j& \
* s% V+ [0 G: p T2 n$ t7 i1 [cat << EOF | sed -i '/^\[defaults\]$/ r /dev/stdin' /etc/ansible/ansible.cfg2 n2 A0 h. A2 l; v' [0 c8 q& E7 E
host_key_checking=False: k/ R9 c% H9 d! n
pipelining=True2 l( W }! C% r: R! i
forks=100
2 x# m& {/ o6 H3 t1 mEOF
! X. M9 d' w# B7 r) }: _1# W$ s1 e7 t) d* C% v7 x+ [
2
. w% ~; h. \ z0 I3
: J; J; ~; ^# [! e' d3 |; u8 p4
8 [) D3 |7 g5 e- v55 q9 c( g2 ~ k9 M! e+ l
默认有all-in-one和multinode两个inventory文件,这里使用all-in-one,来规划集群角色,配置默认即可
5 J& S% ^1 ]* c8 q) Q7 a
% N/ h! u3 y# ^( ]( a5 S W[root@kolla ~]# cat all-in-one | more
) t1 C2 m* I+ u8 |/ A3 u& e' z! W8 e# These initial groups are the only groups required to be modified. The" K) n) C G& o0 p" f- F9 g
# additional groups are for more control of the environment.
: ]1 m- f8 E# A$ a[control]) }/ f+ p" C; O. z. f, s
localhost ansible_connection=local& C: Z+ @: j3 ]9 v" w7 F
) K7 q# e+ \0 R/ s# a
[network]
; e! q$ _) C& j5 F$ F* s. zlocalhost ansible_connection=local
7 h4 t6 E/ \$ \
3 n% I b$ H3 X5 G7 t4 O[compute]( l5 p8 A+ h! a: a5 a+ a3 ]- L6 @
localhost ansible_connection=local
/ L, k& V5 ]2 ?1 c6 T7 i4 O& Q; ]; A: ~/ I9 p8 ?3 ^# Q
[storage]
2 i) U. N& I5 n- n. l/ q+ c5 [3 k; Ulocalhost ansible_connection=local
/ b9 B; J9 p" ~
6 q0 d. M* K$ H$ B' r( F[monitoring]2 B: I4 m$ W) q# i
localhost ansible_connection=local
$ V) p9 I0 v `& H: D! j1 }5 x( w& G1 d/ z# u: M
[deployment]4 x# R( o) @; g! X: W0 z
localhost ansible_connection=local
+ g# v% e- Y; |...; U7 y) W+ m/ b" R$ R) V7 l
15 w, y0 v( P, M
2+ T$ \- ?$ d: X
3
, D' y, d, h# P, C2 n43 k) s5 ^/ G4 s- N* i3 z" m
5& a$ F, v# _4 f
6& o) g; Y4 f& G0 h; d
74 X% m) ?# k7 u/ M
8
, k5 b5 k8 p! [+ n& z* i2 X9. J: n5 F; E0 l# |7 U% A
10" ~4 z3 B) f' A7 n
117 x" ~: ~$ c/ H4 _
127 V: p& z7 d0 }
13
1 h' q& S5 q/ s# K% d9 n. l14
( {. K1 X# S: p+ l' x" Z15) _5 O9 @0 g ~; W
16
/ k) ^& S: G2 s8 I/ [17
6 U9 b1 [( F# L \$ y18
5 G6 \7 x9 l( {3 Q4 l19
D$ b; {5 r: q20* y# L) Y3 \; Z" B, l
216 z2 D% P2 N5 J( l
检查inventory配置是否正确,执行:) v- K$ B- ~' Q' V- b; L* B
1 h% `4 y# u T
ansible -i all-in-one all -m ping
8 E' v/ X. G& s5 s. s6 y+ W7 i+ ^14 ?+ D9 F& [( Z/ Q% K
生成openstack组件用到的密码,该操作会填充/etc/kolla/passwords.yml,该文件中默认参数为空。
1 L9 x e. M5 X7 ^/ R. f1 V# {" ?* R% y `0 A
kolla-genpwd
& }8 t* R- B' K2 N1
. g- l& O7 O$ m; v u修改keystone_admin_password,可以修改为自定义的密码方便后续horizon登录,这里改为kolla。8 H. }% d7 U4 A* ^6 X" g
3 b6 Q, D; C. y) m: e- i
$ sed -i 's#keystone_admin_password:.*#keystone_admin_password: kolla#g' /etc/kolla/passwords.yml
! [3 x/ @, ~$ b1 F; s% h" n8 g7 S
4 R$ i% n! q5 W! F% e$ J6 M4 v( f$ cat /etc/kolla/passwords.yml | grep keystone_admin_password
S2 t( U7 o2 x# gkeystone_admin_password: kolla
& H+ P/ F. o8 f6 a$ w8 r9 X7 f10 k% S' E7 K5 v: n8 s& D: G
2
/ E" I! b# P4 H3: Y: u$ i) \8 W( L1 R
4! @! I8 A( }1 B2 j7 ?( |+ M: D- S" ^
修改全局配置文件globals.yml,该文件用来控制安装哪些组件,以及如何配置组件,由于全部是注释,这里直接追加进去,也可以逐个找到对应项进行修改。: ?7 f( n5 T/ e0 Q5 Z. l
- s- z# ?$ e. ]- {: o6 M% Gcp /etc/kolla/globals.yml{,.bak}9 F; `2 Q9 A# x
R& L# v$ a3 U Lcat >> /etc/kolla/globals.yml <<EOF
9 A0 U8 o/ K+ ~" R. S/ ]( ?: A4 Z. t- b [; C0 V' k
# Kolla options
! w0 z2 N' \: i' fkolla_base_distro: "centos"
9 d! Z4 ]5 n- d" t6 V$ `: D9 x# nkolla_install_type: "binary"# s/ M) S }( G, V$ W) H
openstack_release: "train"% r5 N- g" [- Z# x1 N9 W
kolla_internal_vip_address: "192.168.93.200"
\+ g+ K7 c6 h4 d+ U* D+ D! k) k# r# S7 |( m3 p5 z
# Docker options7 M- p/ Y5 l' O) P3 V: ?
docker_registry: "registry.cn-shenzhen.aliyuncs.com") W' z, A$ ]- j
docker_namespace: "kollaimage"
# ^: N; y& P) b2 Y
) m# ~; x* _9 I* h# Neutron - Networking Options
2 O+ Z7 [) M5 ~' a: C$ R0 Znetwork_interface: "ens33"
% c) f$ O2 j0 @# kneutron_external_interface: "ens37"* f3 j% \5 ]. X8 t
neutron_plugin_agent: "openvswitch"* h: K1 s) i! h# X
enable_neutron_provider_networks: "yes"
; {. g* x: b7 C J* b/ J8 N, T+ n \( \
# OpenStack services; w3 F* S6 r8 C2 n x6 w
enable_cinder: "yes"
1 ^ g; ?; M& m- a' B- ~enable_cinder_backend_lvm: "yes"
) g r! _$ u& B0 [3 ?, ]0 i" l! jEOF# M4 w% O' [6 J
1+ e- Q* k2 j. w4 f$ u! R( {$ ]
2
" A4 Y& L+ T9 s4 W- X0 S1 V3 v- _- |& g5 X# a/ V/ x
4+ p5 i! @% {8 c
5
# f3 @* D6 Y1 u( g* H% @6 i6: R1 W* a6 h6 Q
7
1 C9 b" I3 d9 R( s( a/ u3 O5 O87 o: L% Q: c s/ x" K2 d
9
1 f, M% p5 E" K1 C6 ^1 V4 Y( {10
& v1 ?: K. {* l5 s9 J11
- n6 A# X' A' h, S( _+ L12
2 h( Y) }8 S5 b/ H7 R13- [& e2 E0 L9 {) O7 s! Y0 Z
14 m0 `: B) h. h: R9 {! L
15
3 i, m! N% D( f1 i$ O16
4 Q ^4 i3 |! n' F5 d% A" ~$ y: |173 z0 f- @7 J' P5 k. A
18
z& f ]; x6 N2 d8 e ]8 y8 x7 H+ t) ~194 U. ]( e$ l: h
20
- V* x# x* H. q% A/ P* j1 A6 w21/ i4 [1 [1 N2 y0 s
22
) g7 q$ i8 _$ [( l9 _23
1 ~" t% B) L" g& ~# }24
9 \. G8 h% S q% W. `; _' Y: f b- p参数说明:
3 W( s/ m8 W# I& @% m9 a) k$ K' V5 H/ G2 k3 r& r: f9 w
kolla_base_distro: kolla镜像基于不同linux发型版构建,主机使用centos这里对应使用centos类型的docker镜像即可。+ ~7 C& R5 M1 j6 o9 {; k1 [# v
kolla_install_type: kolla镜像基于binary二进制和source源码两种类型构建,实际部署使用binary即可。
; ^: x6 M9 r& ^openstack_release: openstack版本可自定义,会从dockerhub拉取对应版本的镜像
, ~7 g( R/ e( k$ h9 okolla_internal_vip_address: 单节点部署kolla也会启用haproxy和keepalived,方便后续扩容为高可用集群,该地址是ens33网卡网络中的一个可用IP。. s% G9 m2 M7 {0 m: N7 h& k
docker_registry: 默认从dockerhub拉取镜像,这里使用阿里云镜像仓库,也可以本地搭建仓库,提前推送镜像上去。但该仓库目前只有train和ussuri版本的镜像,如何自己推送镜像参考该博客的其他文章。* n& ~3 p1 V1 X2 Y
docker_namespace: 阿里云kolla镜像仓库所在的命名空间,dockerhub官网默认是kolla。
2 m6 R) Y! w3 Knetwork_interface: 管理网络的网卡, @* h; o2 A! y3 k
neutron_external_interface: 外部网络的网卡
6 U( z& | Y* K/ z0 A3 u7 lneutron_plugin_agent: 默认启用openvswitch+ n5 u/ h, `' t4 h
enable_neutron_provider_networks: 启用外部网络6 z: ] r" g" O9 M, a
enable_cinder: 启用cinder# d# u; B; `+ l! z" j
enable_cinder_backend_lvm: 指定cinder后端存储为lvm
- ]. q' v/ l: N" x8 C修改docker官方yum源为阿里云yum源,另外配置docker镜像加速,指定使用阿里云镜像加速。
6 }3 _8 v% a& F8 w. A
U* {; L/ y$ A; b1 y( ised -i 's/^docker_yum_url/#&/' /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml
0 R8 a" q U T2 [& b% S" ssed -i 's/^docker_custom_config/#&/' /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml8 Z' _' X( d" J4 a% e0 w+ S, w
; X" ?; B0 c S4 M4 |' }/ z: Scat >> /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml <<EOF6 L5 t1 u5 \1 ^3 J9 e9 E' }
docker_yum_url: "https://mirrors.aliyun.com/docker-ce/linux/{{ ansible_distribution | lower }}"
3 H" ~" H. Y4 [. k0 V# n" Jdocker_custom_config: {"registry-mirrors": ["https://uyah70su.mirror.aliyuncs.com"]}( Q$ Y( l$ C+ E; G$ ]7 t
EOF
9 q* y6 t3 U, ^* t9 ~1; q% W, j7 n0 o' p3 T: h
2$ c( j. u' g5 {; M$ P5 Z. H% I5 g
3
+ ?" r! p8 j/ M- `9 b# u# P41 O3 X8 x5 C" l, i
5
6 u# {' K7 g+ Y: D3 O' R% V67 I6 Y% s$ B K7 c! ?& w
7. T) n2 b; V* N3 }$ H+ b5 y4 H
部署openstack组件. J/ u& u* `1 e# `
部署openstack
0 f/ r( d7 y; _# c1 Q. L) r6 B- C! u
#预配置,安装docker、docker sdk、关闭防火墙、配置时间同步等
0 w+ S" g- M7 qkolla-ansible -i ./all-in-one bootstrap-servers
$ E- ~2 v$ X& q. m# p& B
' e7 d1 ]* u# t#部署前环境检查/ N2 `" A5 m8 m T
kolla-ansible -i ./all-in-one prechecks
# N0 R$ \3 U+ D1 b- }8 q
. n* h6 s4 s' \5 o# v- r#拉取镜像,也可省略该步骤,默认会自动拉取6 Y3 |% G8 j6 j( l! k7 b6 m+ X& ]
kolla-ansible -i ./all-in-one pull. f# a4 z9 x( R- y
% C8 Z4 k+ b n: W0 |# [ O& K#执行实际部署,拉取镜像,运行对应组件容器
" f5 E+ @+ c+ W C# W( xkolla-ansible -i ./all-in-one deploy2 m8 w' o5 `9 W: `8 v) @
1 e7 ]6 J/ ]- ~#生成openrc文件
& t: n! j* O/ [" L4 u- V( _kolla-ansible post-deploy: ?: m# W) F. y0 |0 S$ R& E
17 Z4 u9 v% C/ ? j( d2 t$ X( g
24 J. ~. e9 h& ]% x
3
# h9 X# n' E# ]" i# ?% m! ]: q4
1 G& K" ~8 t" U9 W# H5 i0 W$ W; @) N5
u0 m0 A. ~4 f- g! S69 j5 n0 j3 N' y7 Y# r
7
, C) H+ r, Q2 y d2 [, a8
0 f" Z0 c$ ~7 }; v. f9
5 m" p( ]5 b9 w4 E: j10, @ g' D1 j0 v9 ~ ?- b/ \- y6 f
11
3 Y! ^' s# \5 q" @- c/ g+ v, s12, c9 {# q( @% d
13- D8 n* U) a2 V# [# F, J* N
14) q; v0 {+ ?! ]! f
以上部署没有报错中断说明部署成功,所有openstack组件以容器方式运行,查看容器
* T- T2 @; x! J3 O! s+ B7 X! u' q6 B* _
[root@kolla ~]# docker ps -a
U- E/ X( ^' W; [1 c8 g4 gCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES! C. S6 j' D9 c3 n9 c( G
325c17a52c79 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-chrony:train "dumb-init --single-…" 36 hours ago Up 25 hours chrony
$ G( T7 d5 J$ T3 _# l9 U, J5 Y6218d98755ee registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cron:train "dumb-init --single-…" 36 hours ago Up 25 hours cron7 U" j" {: Q1 J! P. O
02b6598c1089 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-kolla-toolbox:train "dumb-init --single-…" 36 hours ago Up 25 hours kolla_toolbox
V% u% V6 c% p- L+ ?8572e445abad registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-fluentd:train "dumb-init --single-…" 36 hours ago Up 25 hours fluentd
0 o" q+ a- e' G8 X" Sf11a103c5ade registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base:train "dumb-init --single-…" 44 hours ago Up 25 hours client
( q0 E. V! S8 ?* ]5c91def3c963 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-horizon:train "dumb-init --single-…" 44 hours ago Up 25 hours horizon' D) Q" R# q& J' O, D
e024bd4f5dd3 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-engine:train "dumb-init --single-…" 44 hours ago Up 25 hours heat_engine: A5 Y/ f' [: E9 e, D9 X: _
2d1491bd9e1a registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api-cfn:train "dumb-init --single-…" 44 hours ago Up 25 hours heat_api_cfn
8 d5 S" h* J. C. m9 eeeefcfb31a61 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api:train "dumb-init --single-…" 44 hours ago Up 25 hours heat_api
% v( K- ~6 f! p7 ^; L9 x# U9b51b53448fc registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-metadata-agent:train "dumb-init --single-…" 44 hours ago Up 25 hours neutron_metadata_agent5 Y2 e' k3 L5 H$ u* y
9f88a6c0cf31 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-l3-agent:train "dumb-init --single-…" 44 hours ago Up 25 hours neutron_l3_agent
. R$ G7 ~8 W$ R& C; s O( \5 S3 La419cb3270a6 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-dhcp-agent:train "dumb-init --single-…" 44 hours ago Up 25 hours neutron_dhcp_agent
* Y4 d8 I7 h8 q959f6faba972 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-openvswitch-agent:train "dumb-init --single-…" 44 hours ago Up 25 hours neutron_openvswitch_agent. V p( G; D' o' s4 ?$ _ l" J
cc1b081cf876 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-server:train "dumb-init --single-…" 44 hours ago Up 25 hours neutron_server
$ U/ a' Y1 `8 A2 \eea1a87feb43 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-vswitchd:train "dumb-init --single-…" 44 hours ago Up 25 hours openvswitch_vswitchd
% ?- d% I/ \" w' U376f81bf75a2 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-db-server:train "dumb-init --single-…" 44 hours ago Up 25 hours openvswitch_db" ~$ F$ Y8 E9 S, R( ^) h! z: v! X5 d
c68fd9a92d73 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-compute:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_compute0 Y' l7 F6 C5 @! k# G6 ?5 {
2492e2a32c80 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-libvirt:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_libvirt
: ?" L5 b7 s- G3802d199b29f registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-ssh:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_ssh. r7 \* M2 J) B2 p9 {
1281c311ecd4 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-novncproxy:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_novncproxy
6 z9 I: |2 V1 d* Q1 o2e8c8478116b registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-conductor:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_conductor
) K3 V2 T! K2 p8 k4 v- Z! \950feb59b549 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-api:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_api
7 r# b, `' I/ z$ a" Y0 Y) g6 k49497e664922 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-scheduler:train "dumb-init --single-…" 44 hours ago Up 25 hours nova_scheduler
. R. h9 N% @! q) P$ Kf5eb37b48f7d registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-placement-api:train "dumb-init --single-…" 44 hours ago Up 25 hours placement_api
6 O) k2 {3 d) w6 X* M0 m54cd0e3be101 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-backup:train "dumb-init --single-…" 44 hours ago Up 25 hours cinder_backup, d0 Z$ T9 q: U5 \8 d' P
b4efa4449e7f registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-volume:train "dumb-init --single-…" 44 hours ago Up 25 hours cinder_volume! k D# q u. E) ^3 f% t
159b669d2fd3 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-scheduler:train "dumb-init --single-…" 44 hours ago Up 25 hours cinder_scheduler
- h# ?4 |* W% M X4 y9fc7e6a4cb25 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-api:train "dumb-init --single-…" 44 hours ago Up 25 hours cinder_api
, {6 ?& \& n, ~5 i; p2 Sb3f8f711f2b1 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-glance-api:train "dumb-init --single-…" 44 hours ago Up 25 hours glance_api
4 I- J; P8 V1 J F0 L1 D760e92d698e2 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-fernet:train "dumb-init --single-…" 44 hours ago Up 25 hours keystone_fernet3 e7 o) p; h: V ^7 H( O" e
95f235c4ac10 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-ssh:train "dumb-init --single-…" 44 hours ago Up 25 hours keystone_ssh
4 m$ ~3 q2 `5 l$ p. r: p03306334ce19 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone:train "dumb-init --single-…" 44 hours ago Up 25 hours keystone0 J5 N8 ]% u* t; R5 u: o
5173d4191567 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-rabbitmq:train "dumb-init --single-…" 44 hours ago Up 25 hours rabbitmq
1 E: S5 n0 F5 B' G% Y8 Deb6bca26f6ce registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-tgtd:train "dumb-init --single-…" 44 hours ago Up 25 hours tgtd& m+ ?/ A( \! Q1 F- D, F% [7 L5 F
79fac2ca1b19 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-iscsid:train "dumb-init --single-…" 44 hours ago Up 25 hours iscsid0 Q2 G' U1 S n. ~+ u% v
4a3fcefc7009 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-memcached:train "dumb-init --single-…" 44 hours ago Up 25 hours memcached
* M& @4 y0 W5 [' [+ L0773eaf446e4 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-mariadb:train "dumb-init -- kolla_…" 44 hours ago Up 25 hours mariadb
/ c0 m* h* K: C B$ K77f0beaa28e5 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keepalived:train "dumb-init --single-…" 44 hours ago Up 25 hours keepalived9 F* B, P3 Z( D ]
b02b744d2da3 registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-haproxy:train "dumb-init --single-…" 44 hours ago Up 25 hours haproxy
) P+ s+ r; O0 R- m- w. ~6 _$ B13 Z2 P$ [9 Y7 B- M
2, Y# [1 H; f- v
3- _9 c6 L/ I2 i' _8 f2 B6 |7 s3 c
4
# @0 d7 \/ N5 F: q# x& g5. e6 m! P/ Q* u* B, _: R# _3 i( \
6
1 K8 q! G. T5 T7; r+ w E) l" u: P: o
8. Q! Z, h3 B2 a* `8 |: o1 D, ~
9/ f& n2 S& r9 o5 b. ]% \3 V6 p
10
8 `4 H: j" X8 [! o9 J. U) @11
/ s6 M1 v. r2 G. B* E+ L6 ?) i12, Y7 T9 ~4 t+ t! V
13. j7 m1 U; h- P# `/ R
14. t/ j& I) \; E& G
155 Y6 ]- h" B2 Y, d
161 {6 H% x, n& V9 b2 Y
17
! Q/ A# A# E) Q. D' V18
0 W0 V* ~3 ^* _" l19
* c, t, w2 J5 M* k20
, |. U: E6 d4 q( R) J! x9 }218 ~. p' I3 [3 o* b0 n9 U' P
22 Y$ r% C# `- [6 R
230 [' Z2 K$ R6 ^ U* n9 n
24, y' c' ]+ T* b
255 u! L E: h4 y* O* R" V- d6 r
26
, L0 @2 P8 h' k+ b276 E1 `% j" t, B' }2 R2 q; n. S) ?3 `
28
+ j' l. b$ z/ N, X! r# A/ T' x29. B" q# }( u$ C6 o; |( W
30
4 {0 {0 K3 n' E M: x* h- l31
$ e+ a$ E7 p2 `32- \# t& p9 i1 }7 f5 I6 |/ ~
33
% t" F; C+ \! R5 o, ?9 o34
1 I3 ^8 S' q/ A+ n. r! X+ v35
" w n/ I6 t) T; V8 p! Y36% j3 q- u6 O/ O7 ^
37
4 S) Q, `7 J7 @+ \* n38, O: U( R+ S& s7 Z4 \# X# z5 j! J
39
0 h, w4 k C5 ?8 g* e% ]5 l402 e* X6 k/ Y' n/ d
41; r7 v/ n& M8 I. r9 k8 B
确认没有Exited等异常状态的容器6 b; r1 \# P2 X+ f
4 W/ w2 i8 p7 B- G. I5 i! k- U1 U, g: T[root@kolla ~]# docker ps -a | grep -v Up6 z4 o1 a k% U) N7 G
11 ~1 J9 a4 {$ R9 j) q5 I- I
本次部署运行了39个容器, G# q* z4 n m, h. P6 q: `
1 {, S: n& X5 R2 f# I1 I
[root@localhost kolla-env]# docker ps -a | wc -l
/ W) N4 ^1 J' K3 l6 F39
& C* U! p; U- V1
8 D3 G) A7 Q; d2
- ~2 l1 k& |9 Y查看拉取的镜像,发现镜像数量与容器数量是一致的。
6 J2 c0 e/ u6 `' A0 \: N" _# M; s
7 Z: l! T0 `0 {9 f1 e[root@kolla ~]# docker images
* _- i' w; y# A+ M" a+ UREPOSITORY TAG IMAGE ID CREATED SIZE/ h4 K+ _1 I0 t5 s( w" A
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-glance-api train aec757c5908a 2 days ago 1.05GB2 R! [5 P/ I! m% s1 O& I
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-ssh train 2c95619322ed 2 days ago 1.04GB& W1 p' T" X, F# m9 j" d8 p
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-fernet train 918564aa9c01 2 days ago 1.04GB- o5 l# ~% k8 t/ K: c
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone train 8d5f3ca2a73c 2 days ago 1.04GB
, A/ r3 i$ b4 Uregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-api train 500910236e85 2 days ago 1.19GB. E. G/ J7 G+ M$ i$ r6 M I
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-volume train f76ebe1e133d 2 days ago 1.14GB
' ~% G- O5 o9 a; C9 w# \registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-backup train 19342786a92c 2 days ago 1.13GB
; F1 h. A8 ?( e( r1 _# oregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-scheduler train 920630f0ea6c 2 days ago 1.11GB5 j6 t2 k- v( u R
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api train 517f6a0643ee 2 days ago 1.07GB
$ u( P' s5 f% L9 oregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api-cfn train 2d46b91d44ef 2 days ago 1.07GB. S, o' ?' S& {2 c; j9 t |
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-engine train ab570c135dbc 2 days ago 1.07GB8 [6 k0 x4 ?& i/ [, P) h
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-horizon train a00ddb359ea5 2 days ago 1.2GB
% {3 @% R, e0 U, c" Pregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-fluentd train 6a5b7be2551b 2 days ago 697MB
) i7 x, P$ z& V2 G5 V! v" vregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cron train 0f784cd532e2 2 days ago 408MB
: {- F( l \8 Fregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-chrony train 374dabc62868 2 days ago 408MB
, t0 K, Q5 d- m! ^registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-iscsid train 575873f9e4b8 2 days ago 413MB
% R7 x1 @. C4 w2 }registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-haproxy train 9cf840548535 2 days ago 433MB
: F& w6 a) u A* ? K, l# Dregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keepalived train b2a20ccd7d6a 2 days ago 414MB
9 ]" Z, {6 G5 Dregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base train c35001fb182b 3 days ago 920MB
' x; V( @6 \8 s! |registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-compute train 93be43a73a3e 5 days ago 1.85GB
2 H- m; a- A0 G8 U8 \registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-placement-api train 26f8c88c3c50 5 days ago 1.05GB
r* ]" x" Z1 I- d. P/ [registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-api train 2a9d3ea95254 5 days ago 1.08GB
: B3 G. l+ [" K! Rregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-novncproxy train e6acfbe47b2b 5 days ago 1.05GB3 V- [& A" S+ O# k& p
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-conductor train 836a9f775263 5 days ago 1.05GB
, o% g3 ^, W6 H; j" |2 Iregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-ssh train f89a813f3902 5 days ago 1.05GB
0 O9 h6 p. r2 U* z$ z5 L, {registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-scheduler train 8061eaa33d21 5 days ago 1.05GB! o+ H, S' }' b3 q: V4 M& H" T
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-vswitchd train 2b780c8075c6 5 days ago 425MB4 ?" N) ?6 b# e. I/ L) d
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-db-server train 86168147b086 5 days ago 425MB3 b. c. ~+ z( O/ |2 v9 {% D
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-rabbitmq train 19cd34b4f503 5 days ago 487MB
4 L. p- a3 h6 v! j2 d: h3 Yregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-mariadb train 882472a192b5 6 days ago 593MB
4 L, l2 w% r5 i& n: I' t* wregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-dhcp-agent train a007b53f0507 7 days ago 1.04GB& x8 ]( F5 O; c
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-metadata-agent train 8bcff22221bd 7 days ago 1.04GB
0 Y/ G( }+ T! H9 l# ?/ v6 Qregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-libvirt train 539673da5c25 7 days ago 1.25GB% U* t1 B! k3 Y$ V+ q
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-kolla-toolbox train a18a474c65ea 7 days ago 842MB
: t, b( P* @: O& Sregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-tgtd train ad5380187ca9 7 days ago 383MB2 n' a0 X# y8 @+ u; B
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-memcached train 1fcf18645254 7 days ago 408MB
! n7 [+ ~/ x6 S. A# x0 eregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-server train 539cfb7c1fd2 8 days ago 1.08GB
, \) w( M9 [9 h, v; P) a! @+ Qregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-openvswitch-agent train 95113c0f5b8c 8 days ago 1.08GB2 U$ N- P+ c+ \- E- b, B; ?
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-l3-agent train fbe9385f49ca 8 days ago 1.08GB
, ?& @8 |1 r3 Q* g( F! X1* N$ \& |. g( i" Y( E Q% E: s2 x
2" k" `8 {' W6 Z% H: j+ f% h
30 B: u/ q& F7 l% K& {) a
4: C7 x2 A$ [9 [' b( V
5
7 f$ k* w9 H0 j O5 l f9 B! w6) F3 k1 ~ Q) f1 s
7' n0 K; X9 z `
8
$ {4 B i: [* {( R& y9
$ i- T/ S* ^; x( C. g0 t' l: n101 s4 U$ a1 l: F! `
11( V* y( F7 |7 |- W
12
7 J' w+ @2 c( \13
3 [ x) c8 y* e3 Q8 N2 _8 S, r14 k- U1 n- k! A9 S6 _3 W
15+ e1 e* k7 A& d9 x$ A; P0 `- H
16+ u: k5 a' u9 x8 j: \
170 v# ]: _# c3 B3 M& P! k/ a- j
18
z7 Q( M Z- S" Q19) d3 _$ e0 E1 x) f3 W3 B
20! Z: R! [7 K) i/ O% t+ C+ Q1 d
21, k, _) ]% ^5 B: [4 k0 O0 w+ t
22
* J( ]; t1 d' @% [/ P+ ?! `23
8 U3 i* W( h1 d0 C; M3 t" T/ I( b5 c24) Z3 w9 X% l( v' C6 m1 x
25) H9 [2 o, N/ k* s9 e; w
267 Y; D1 [# B: H/ R" e/ c* O, t
27
, k, M2 h+ N) A& q8 B1 w' ?- ?28
# f' x- \- L- F' O4 r9 Y29! i2 r5 e7 c; _6 q+ _1 g6 E$ K
309 Z. U6 |( u" c2 d
31; G4 ~5 |* K) u3 Y0 R
321 q2 v. G: X, ~- N$ @, M
33
: @" e0 G& D( `8 j8 O34
! R6 w) C$ L- @# ]35- ^" ~" [3 g- i: [1 f
36
9 V- D, @" j8 b37
/ d& }- g" R0 n7 X) H( _38- S% x7 k/ _; q8 v+ c$ g
39
) e4 |3 x$ t1 U8 m% H40
6 E% \% b/ ^# X8 |9 \/ i! `1 ~; V6 M41# L, c6 U# [- ^8 d7 {. `
查看cinder使用的卷,自动创建了lvm
- F( ^: H0 i9 S Q1 S! j( Q: G
2 }& w+ ~( \' m[root@kolla ~]# lsblk | grep cinder+ b* [" U5 }( d5 Z3 z1 X) g
├─cinder--volumes-cinder--volumes--pool_tmeta 253:3 0 20M 0 lvm
% ]; N$ j3 Z5 y7 p* ^6 E: N│ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm 9 I- ]9 d% J f' f( d
└─cinder--volumes-cinder--volumes--pool_tdata 253:4 0 19G 0 lvm 2 C4 W R) O6 o& Z/ B# d3 a; U
└─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm X/ \: _1 s2 K4 w% J
1 L$ g2 \, [8 k[root@kolla ~]# lvs | grep cinder
1 L# z; q G. `3 p' r1 r; S- a cinder-volumes-pool cinder-volumes twi-a-tz-- 19.00g 0.00 10.55% L( I) o7 O: e
13 t: ~0 ^- Z% m# \- s" s B
27 c3 J, z" {+ }, }
3
% d0 m3 T! }% A1 u4% |5 S) s( f8 p& C/ F
5
" h' P# A: M' S' X* S6- ^ N0 I9 v; w% W2 G" J4 p) T* X R
7
( l6 I+ N; J- z. F' v( o82 z3 S: P+ d& j8 x5 R% w
查看网卡状态
, s4 b, P8 J4 ~6 z. l* f: n. \" z1 u0 }
[root@kolla ~]# ip a
0 q2 K$ l! k' ]- I; ~1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000/ \0 F6 N( M4 u0 c
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:000 r8 P# _: t) ?. h9 f& C8 ~8 a1 m
inet 127.0.0.1/8 scope host lo
4 F# x8 k0 y3 x1 \' I2 S, D7 c' y% U valid_lft forever preferred_lft forever
. k" @. l/ S% r; a5 c: p2 ^ inet6 ::1/128 scope host
, D; A8 H8 w: s valid_lft forever preferred_lft forever# l) a z& q# k7 k: U Q- X
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000" x8 i6 X) W5 M6 s
link/ether 00:0c:29:0c:4e:fe brd ff:ff:ff:ff:ff:ff
1 @/ ?& V( `; H" b! P0 w2 e inet 192.168.93.30/24 brd 192.168.93.255 scope global noprefixroute ens33
7 c% h! U: W+ S6 b* w3 f valid_lft forever preferred_lft forever
6 I0 n9 q5 @( I: [8 w% x inet 192.168.93.100/32 scope global ens33' y0 n: J$ i: p _* o7 S* u
valid_lft forever preferred_lft forever
7 o* Q- z5 J2 @1 N inet6 fe80::7a6c:d06c:ee49:4cd5/64 scope link noprefixroute / R/ } |- S9 F( O/ @6 U
valid_lft forever preferred_lft forever, |! h5 i% E( }8 C
3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
# S: R/ d9 l. I/ k; W7 q0 k link/ether 00:0c:29:0c:4e:08 brd ff:ff:ff:ff:ff:ff
9 X, v8 L7 L+ k4 Q. r inet6 fe80::20c:29ff:fe0c:4e08/64 scope link
. w: C/ d+ _+ @7 i. U4 S$ Q( ~ valid_lft forever preferred_lft forever
2 D! h8 p$ w1 p4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
3 \. \1 L; o+ p0 L8 s; ]" T7 \ link/ether 02:42:2a:d9:93:52 brd ff:ff:ff:ff:ff:ff- C+ o) B4 Z# a% n
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
9 p$ |7 s( O; `" N valid_lft forever preferred_lft forever
9 Q( u8 U2 o3 z( E+ D6 F inet6 fe80::42:2aff:fed9:9352/64 scope link
; N; x) R& d7 t5 e! [ valid_lft forever preferred_lft forever! Q1 }' [ k- [8 k6 h
6: veth0c46c6a@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default ' q, o7 c! ?: H2 t( g: J1 y0 A
link/ether 1a:ce:d7:61:d0:cc brd ff:ff:ff:ff:ff:ff link-netnsid 0
. o: E7 D, H- }- O inet6 fe80::18ce:d7ff:fe61:d0cc/64 scope link
7 B) F0 Z/ u. K& w valid_lft forever preferred_lft forever
; d) L9 \7 B1 h7 m7: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
! l6 Y0 C! z& M: U/ |; \5 G link/ether de:e5:b7:4d:e8:b8 brd ff:ff:ff:ff:ff:ff
+ A# Y' i* Y8 r! O11: br-int: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN group default qlen 1000' `; c+ b7 A3 q3 V
link/ether 52:14:05:ba:ce:4c brd ff:ff:ff:ff:ff:ff y, y5 l5 c+ ^; w
13: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
3 v# d& F% a& f- ^9 }/ i link/ether d2:5b:76:f5:01:49 brd ff:ff:ff:ff:ff:ff
2 M" h/ b+ _# u# a9 k& b5 U4 {14: br-ex: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
W" |& K, a+ w5 m link/ether 00:0c:29:0c:4e:08 brd ff:ff:ff:ff:ff:ff, b2 V+ M0 Y0 ^! a& f
22: qbr2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000) Z1 H" \* ]6 E
link/ether 3a:0d:ad:56:9d:9d brd ff:ff:ff:ff:ff:ff: X- v/ y6 I% {4 k9 u: E% D: {
23: qvo2749f64b-1f@qvb2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master ovs-system state UP group default qlen 1000
, C g) s* v8 o7 k link/ether c2:c5:8b:a6:72:8b brd ff:ff:ff:ff:ff:ff
2 w; W/ {8 e4 }9 s& [8 k inet6 fe80::c0c5:8bff:fea6:728b/64 scope link + h2 f+ X8 {/ U1 S% x1 r' T
valid_lft forever preferred_lft forever
6 J3 K1 P: P5 B/ p. Z# W24: qvb2749f64b-1f@qvo2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master qbr2749f64b-1f state UP group default qlen 1000) ~* f8 a2 T' A' N) z& B
link/ether 3a:0d:ad:56:9d:9d brd ff:ff:ff:ff:ff:ff
8 ` Q P, l/ ~# a" c& K% R$ e inet6 fe80::380d:adff:fe56:9d9d/64 scope link / a- C, {, i8 o( D& z# v R) g
valid_lft forever preferred_lft forever
8 Z3 i ]/ Y1 [0 M25: tap2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master qbr2749f64b-1f state UNKNOWN group default qlen 1000
( g+ e6 B1 Y% a* ^3 M link/ether fe:16:3e:94:b5:71 brd ff:ff:ff:ff:ff:ff) u% o5 J: e' k) c0 T
inet6 fe80::fc16:3eff:fe94:b571/64 scope link
7 _4 f' U1 ?9 M; @* ^8 ]& G valid_lft forever preferred_lft forever2 F" s o* Z5 w) `
26: qbr0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000
: I( |+ z& Y0 s k link/ether 02:f9:32:c0:f4:b7 brd ff:ff:ff:ff:ff:ff" l3 {, c' W; l. b2 V
27: qvo0a14e63d-2e@qvb0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master ovs-system state UP group default qlen 1000: X0 l: a |; b! Y4 ?1 @: I# [
link/ether 76:86:46:4c:4f:61 brd ff:ff:ff:ff:ff:ff+ h; R+ {0 z+ J
inet6 fe80::7486:46ff:fe4c:4f61/64 scope link
. ]+ b: c) ~+ ~% e5 R6 C) u valid_lft forever preferred_lft forever
$ j: V$ f+ |- F, v& C9 y- Z9 o28: qvb0a14e63d-2e@qvo0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master qbr0a14e63d-2e state UP group default qlen 1000* v( z3 ?2 C3 Z$ H
link/ether 02:f9:32:c0:f4:b7 brd ff:ff:ff:ff:ff:ff9 p0 ~6 d1 v% p2 A& p
inet6 fe80::f9:32ff:fec0:f4b7/64 scope link
+ |: R' P$ W2 C1 L8 b valid_lft forever preferred_lft forever4 p7 p' O. u7 h6 T0 Z
29: tap0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master qbr0a14e63d-2e state UNKNOWN group default qlen 10000 i8 v1 b7 Y; ~% Z% `, D
link/ether fe:16:3e:ee:08:6b brd ff:ff:ff:ff:ff:ff, L' F& j! ]" O" q/ s
inet6 fe80::fc16:3eff:feee:86b/64 scope link 9 Q8 `) s4 j* x1 V a
valid_lft forever preferred_lft forever
! J/ X) { `% n# v4 f! c* T1
2 ^: y7 N& f( |# J9 K- w2
6 x: l+ |4 J: m+ c) x3; z: {: y9 u' g& ~
45 V7 S- W* B* s9 e# }/ H I
5
+ A# E; X! n' l. f- O6 `6# l( J ?# h. j) [2 V
7
( A& f9 F& `# w" m' L; V3 A86 ~6 E3 g+ ]4 G2 L# i7 r% j! A, F
9; C& R( R* A, \
10
, m) j# \4 S }' B, {11
0 N% `' l$ f2 W0 _0 Q8 ?# B12. h) ~( v1 G6 O$ F/ {% U
13
, J6 a1 z1 ~) D3 M7 k' Z/ X14+ U# c0 `) e6 n3 a; R
15
: E# X* K0 h" m" {3 k167 ~0 Q' f0 e* R, W
17
3 W; h# N" J7 v3 o) C" e; y7 [% N18
' h9 c n0 H9 @% J19- {3 d5 j4 y% |4 @1 ]2 Q- c2 s
20
5 H8 O2 d5 N+ O0 B; V21
! T! }" z1 h% I) z0 h* {" z% \) e22 w: [7 J( `; M2 P! g" [. r" G
237 C& Z$ \6 f# S( ?) a6 @& r0 _% I
24# ?5 |# l. h+ `! L
25
2 F; b4 D6 }) S# _" d26! t, b. G- |$ p/ f7 N2 j# z/ H* a
275 ~/ `# N3 {7 E) r% M8 {
28
9 [2 F% n5 K- ?! C& A29+ l* N7 f8 }* F+ @: |8 v: x
308 h7 t" ^# I" N0 c: u+ P) E
31' k% {% e! U' w
32- F3 F7 q0 X3 T, I `9 L0 V
33
; }( i. Y P" y# p5 t: o* Z34
7 Z, {6 S" Z, R# n359 g" e8 g" g5 D% p) B1 N
36" Y7 V& A4 l D
37
/ u5 t5 M. o, m; x8 f: Q38
( j L$ x3 H% f+ a0 K. M$ ]2 k+ T. E39# s( `# {6 S6 d j6 d2 u" O
40
# \4 }4 i- m9 |4 g41" N% V9 Z+ u7 B; P: S: t+ c
42
3 K! s' S4 G5 n1 v43
# \; ]$ v! T, m! e" R44
3 ?$ T% W( x0 k45' C( @2 e+ q- ~! S
469 x( s! Q# ~1 K# C4 \4 [0 l
47
9 n5 D- O0 M0 @" \# A a; ~48
, S& Y' b7 u1 l/ M& L+ `49
( F& h. P( z c& J, O50
9 d3 p$ S0 ]0 g3 R0 D Z k518 O' c* N. ^: [9 v
52
* B1 N* |8 O" P- D53
) ]! @" Q3 Y5 Q. D I54
0 d9 x B2 o/ b v; z1 E' S55
" C% O) U; b9 q2 q562 [& n' I; | ?6 f w, L
57
& j6 C) d3 Q4 J) t580 \0 s7 N0 {4 R, C2 V2 w) P7 [( I
592 N) k5 _3 z( ~& F& N3 g4 \2 U
607 x" ]3 ~3 }0 M1 c% ^
614 ?+ T- N# E6 ~* s% j4 J
62
9 n# Y# f9 `4 o3 W- S n2 n63
1 ?" m6 w" }" d64% x% @$ e6 g- M5 |# s4 I% {$ W4 s% d9 u
65 k0 \; p7 N, H/ _
另外需要注意,不要在该节点安装libvirt等工具,这些工具安装后可能会启用libvirtd和iscsid.sock等服务,kolla已经在容器中运行了这些服务,这些服务会调用节点上的sock文件,如果节点上也启用这些服务去抢占这些文件,会导致容器异常。默认kolla在预配置时也会主动禁用节点上的相关服务。; [) e; Y' y% e% g' q0 E
; H# b/ s7 ^; I# u$ J* s$ @0 E
安装OpenStack客户端
" y7 n3 \9 R9 G5 C0 Iyum安装openstack客户端2 F: _$ T/ ]' O; B- m3 h9 t6 t
/ S, @) q$ H9 c% m1 Z6 {#启用openstack存储库
5 F0 {1 z1 H- _2 }+ [' p! W- oyum install -y centos-release-openstack-train1 y9 ?& Z& a* _, Q% Z: h3 N
e# U! I$ Y E7 M, _& Q
#安装openstack客户端+ U% \) _4 @3 q6 R1 a$ Q
yum install -y python-openstackclient2 k! G* A) e* Z' g t+ g1 |
4 f9 I0 z/ M2 N& k* t5 b3 f+ E% ]
#启用selinux,安装openstack-selinux软件包以自动管理OpenStack服务的安全策略& S: ?9 t: L Z' b
yum install -y openstack-selinux
9 u6 F# O; `. J9 h' i& U
' r! A: u0 l/ [; ^; h! Y6 _#报错处理
x+ v: o* b8 `; \pip uninstall urllib39 F3 R0 _, i, T( T3 t3 |
yum install -y python2-urllib3: o- s8 s) a6 J+ P/ h
11 }: Y0 l( m, y7 I6 B# v
2, n& h% p0 X) N/ {
35 K0 Z- g% S- L( u1 J% s
4. R/ c( X* v% I, L( h: x
5
- _9 R3 R5 j7 A6
2 a7 Z! K( O1 S7
9 e4 Z0 m+ e' ]# ]9 b89 z' b6 ^" T5 r/ d
90 ^$ O, G' [& Q5 t
10
3 Y1 G$ i. `# }; R( a. o5 c+ T11
: T* N( v7 Q8 K* T$ h120 m7 i" Q9 E" z* B( E8 m
kolla ansible提供了一个快速创建cirros demo实例的脚本/usr/share/kolla-ansible/init-runonce。! f- T0 @% O7 S" O
0 R$ `7 W4 o W H3 [0 Q% q1 A
脚本需要cirros镜像,如果网络较慢可以使用浏览器下载放在/opt/cache/files目录下:
3 s5 U, H4 F8 E. b% L4 J, b- O Q: k- |0 @1 J9 o3 H
wget https://github.com/cirros-dev/ci ... 4.0-x86_64-disk.img+ C1 D: Z; C$ E% {2 ^. A/ c, L
mkdir -p /opt/cache/files/% J) D! Q. `# c
mv cirros-0.4.0-x86_64-disk.img /opt/cache/files/! C/ X5 A& Y* i# G% r
1$ f6 H0 V0 I1 Y' A# g6 k+ M
2
0 _$ \4 Q# N3 b' U7 |+ A3 e M3: K. U9 g. }7 h* c! v- J1 ]8 i1 x
定义init-runonce示例脚本外部网络配置:& y" o6 v8 H, }; T9 f8 y
+ g' J5 G0 ~4 X& x) C% T#定义init-runonce示例脚本外部网络配置
2 A6 e1 ?; h( z4 texport EXT_NET_CIDR='192.168.1.0/24'
/ H- ^( K8 x0 x- Yexport EXT_NET_RANGE='start=192.168.1.200,end=192.168.1.250'+ q0 @( v7 u; X# S) K5 Y
export EXT_NET_GATEWAY='192.168.1.1'. y S o2 Q* l% s* d
/ G8 x% \- S8 y$ {
#执行脚本,上传镜像到glance,创建内部网络、外部网络、flavor、ssh key,并运行一个实例! S' j {, e; O g; v. `
source /etc/kolla/admin-openrc.sh 4 c J s& G* r! |
/usr/share/kolla-ansible/init-runonce# x& A: n1 Z# G4 _- S6 n3 B3 r# l
1+ \5 f% l" R* G( w' u
2' w5 J# X( O1 b$ L* k- @; |
3: o# _6 l& t4 U0 C/ V0 l
40 e& o- c- L e/ ?" q" K: N
5; ]: Y+ | @; X1 j/ S" H, {- R6 @
6
! t! M9 W1 U1 s; x" S4 r1 b( p7: i: o) q$ j) X& |9 g2 k
8; p' H& `$ p7 U. c' \# z: V
参数说明:$ g2 p2 ^/ R- N/ e5 m- J. L
4 e; w+ [; t" J. ]6 S+ f8 U0 W
EXT_NET_CIDR 指定外部网络,由于使用桥接模式,直接桥接到了电脑的无线网卡,所以这里网络就是无线网卡的网段。) N1 R) c, Y7 z, [
EXT_NET_RANGE 指定从外部网络取出一个地址范围,作为外部网络的地址池7 o2 w' U, C E8 U
EXT_NET_GATEWAY 外部网络网关,这里与wifi网络使用的网关一致$ ]7 R( e$ P2 `, c! M
根据最终提示运行实例0 Q3 E1 [9 n) j, \) i2 m) T
# R3 k1 J6 H8 I2 c9 Kopenstack server create \
8 K5 {1 F. G! p; ?" o) t3 S+ F --image cirros \
0 ~+ G$ J+ q* R --flavor m1.tiny \' D T0 j5 a3 g5 k; z: ]
--key-name mykey \4 O1 C% b9 P7 W* `) q9 {+ X1 z
--network demo-net \
; \, X# M( s2 }+ D& W: u demo1# Z: k% g5 S) Q+ m1 O Q5 H
1
5 U7 r* t. Z3 r7 ~2. k6 ?& U% j7 E1 ~2 K0 m8 t5 L3 }
3
; m) X; V4 u# |) X& s: o* [4, |5 s. k! a0 s. B7 I" P
5( W9 A7 @" y4 C c" T/ K* V
6
$ \% H! f+ \; S) \" w9 o& `' ^也可以使用docker容器作为客户端
4 a, {4 Q8 | S7 i, c
* z {9 R6 n2 Edocker run -d --name client \
7 K2 u' E% b+ I( x1 A --restart always \
, K! \2 S% y A4 g -v /etc/kolla/admin-openrc.sh:/admin-openrc.sh:ro \; W" }3 h3 P" g9 N3 t/ A6 ?2 v$ J; T; {
-v /usr/share/kolla-ansible/init-runonce:/init-runonce:rw \
7 N8 ~# i* m5 P8 t$ m3 w8 p) j registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base:train sleep infinity
( h+ g8 [& e0 B0 ]. S- n. w2 R' T( y4 |8 c. C4 K8 A
docker exec -it client bash; k: \5 j% R& d! Z
source /admin-openrc.sh+ M9 k6 M7 P3 q0 o3 d
openstack service list l- W% i) _3 S8 S- n: ? [
1
5 t% ^1 U$ j* _2
8 L) _2 k& P. R) j3 a O3
' M5 V& g% F; ]7 ] H4 N0 ^4 T4+ U. p5 q4 ?3 k
52 n# A: P3 I }) A
6
' V' G; f7 K: y' `6 O- T76 |( h+ y P7 I6 a
8+ ?0 y. l' C: ]- ]" v$ Z
9! }% A3 W% }$ P* d2 W
访问openstack horizon
0 }/ Q, w# J( h: u P访问openstack horizon需要使用vip地址,节点上可以看到由keepalived容器生成的vip6 J8 H+ q4 [; {/ f& k4 C: S0 U
# B" L6 m5 Q- J/ Z& f[root@kolla ~]# ip a |grep ens33$ h& t' r, \8 o
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000# E- y+ _7 Z: j$ u# u2 E2 _' k1 i
inet 192.168.93.30/24 brd 192.168.93.255 scope global ens33& Q9 E# c0 x3 Q# [# f: A
inet 192.168.93.100/32 scope global ens334 @- o) |2 F% Z- |
1! Y/ w/ K m3 q) U+ Y8 a4 x
2
* O( W; F& [8 g9 G. N* ]3
" }2 g# J9 i( ^) ^, e& s' k0 a4
0 r2 c$ m( N) D; f浏览器直接访问该地址即可登录到horizon) z7 F( S" ^5 I* _
! {5 c" m' h$ K3 P' k2 Zhttp://192.168.93.100" w/ ]# `, Q% k( P
, I: ?, Y5 m: y0 d/ [
我这里的用户名密码为admin/kolla,信息可以从admin-openrc.sh中获取" m) F) {1 W: @- s6 m, _5 {; i
* c9 ^+ m8 \# ]) U1 r4 e
[root@kolla ~]# cat /etc/kolla/admin-openrc.sh, w1 M% Z. i; a& B
# Clear any old environment that may conflict.
1 W1 M; W" N l: j6 X" f) B1 U# O2 Ffor key in $( set | awk '{FS="="} /^OS_/ {print $1}' ); do unset $key ; done$ ^$ u4 p! `2 F9 w' F$ A* _3 ?
export OS_PROJECT_DOMAIN_NAME=Default
, g! Z% Y' R; Z* @' ^ \. d7 T6 ]export OS_USER_DOMAIN_NAME=Default
& W# s5 @$ p8 lexport OS_PROJECT_NAME=admin" i% q2 a4 g" H! u
export OS_TENANT_NAME=admin
9 v5 Q2 j& {8 _: v0 @export OS_USERNAME=admin) ]+ r' Z; A: L n
export OS_PASSWORD=kolla" s, L2 S7 c( M
export OS_AUTH_URL=http://192.168.93.100:35357/v3
1 A+ u$ L/ Z* y, Hexport OS_INTERFACE=internal
; y& C" n7 y& I6 r; B5 j7 Bexport OS_ENDPOINT_TYPE=internalURL
' f- c- D2 ` r/ a3 d* E y+ Dexport OS_IDENTITY_API_VERSION=3
" i6 `/ i/ X' p; f' s4 b3 K3 k: Xexport OS_REGION_NAME=RegionOne
3 \( c5 |& s8 c0 N# Gexport OS_AUTH_PLUGIN=password
3 k% D) T0 k. h# U10 t+ s6 [5 a7 d3 d! i# h$ |9 }3 R/ l
28 \! p" W$ f8 r' ~) X
3, \& b7 l4 r$ d. j5 c
4+ \- H) S: I+ E, D/ C1 h
5
0 l1 y. @* |* z2 X* x) [' p6 E6
z3 h4 q$ F( J* h) l/ o% \. c7
5 L( ^: }" Y. P/ A' C, {: U8
7 {3 g# c, s, L! V4 g- ~9
) L! ]2 r1 s* j2 q8 p9 p' c10
1 @2 U2 f2 j% ^" x8 D8 |% a7 d8 M11
$ A4 ^' Y" s- a4 W9 |12
+ z) j: j# E3 O# K: G; d139 P: e7 @' } c. A* w! j! ~
14
. d, \; o! v) I' _0 z& U; b15# F5 j* e! j F3 t6 [" t# p
默认登录后如下7 B* G, D7 k6 ]/ N1 Q, e9 L2 [
( r; c% S$ Z8 O$ n w
) B) [4 U. w; R: y在horizion查看创建的网络和实例
# Z( p5 s* q7 m* |
$ `$ L7 ~* ~9 b; M+ [: ~登录实例控制台,验证实例与外网的连通性,cirros用户密码在初次登录时有提示:# U/ [0 K, ~( O, v# G
$ A4 u" u- C+ a4 d5 Y为实例绑定浮动IP地址,方便从外部ssh远程连接到实例
6 L) }! B, o( P$ x" J) [ F$ ]1 `* ~/ L1 `* R# _
点击+随机分配一个浮动IP: z% R9 l; }; q" Y0 N& V w0 Q" W
2 e$ D! ?, Q9 S) h- C
& n0 Z8 j% I- e5 u: _3 K2 L6 C
在kolla节点上ssh连接实例浮动IP,cirros镜像默认用户密码为cirros/gocubsgo,该镜像信息官网有介绍:
6 P- K2 V% o9 Q- f3 k0 @/ N) ehttps://docs.openstack.org/image ... es.html#cirros-test( r: f6 `7 P, S% S( @* G' o3 d+ R6 A
+ | m z# q- @4 Y! B* X
[root@kolla ~]# ssh cirros@192.168.1.2480 D( R+ c8 u1 Z$ L% E" O
cirros@192.168.1.248's password:
+ T6 p& _, p5 \3 _3 ~$
2 }0 a% Y/ f* C' q$
" j m; F, F; q1
1 e) Y$ Z* D3 a9 F2
, @) h+ e5 v% ^2 x. `3! n. s" B; m8 Y$ f- o9 y$ z0 B
41 J6 m/ b1 \- z- a6 E/ H7 V5 x
或者在集群外部使用SecureCRT连接到实例。
( F% t4 e4 |& E* A
3 l$ d V1 d% L: M, L
; a& a W# Z' e运行CentOS实例+ h) |1 {7 O$ ]
centos官方维护有相关cloud image,如果不需要进行定制,可以直接下载来运行实例。1 c* w# X( @7 A* G
9 M5 O9 }. [- t0 S; |2 h
参考:https://docs.openstack.org/image-guide/obtain-images.html
, ] w4 p' y1 S; {( s4 p0 s" T$ f2 T# K" x
CentOS官方维护的镜像下载地址:
- o0 N, L& w: d1 r9 J, @http://cloud.centos.org/centos/7/images/
% b( e6 a; u9 e: S0 z, O# V0 w1 f$ t7 c6 ?9 L3 n
也可以使用命令直接下载镜像,但是下载可能较慢,建议下载好在进行上传。以centos7.8为例:) f; R4 B7 B. H* E6 p
1 i2 z2 T: b1 }( pwget http://cloud.centos.org/centos/7 ... icCloud-2003.qcow2c
0 Q8 }% F) F2 X# n1
: c6 M& e0 b6 N4 C' l下载完成后上传镜像到openstack,直接在horizon上传即可。也可以使用命令上传。- Y- h& M4 h! o% O! Z& a
( Z7 _. }" k& M; O4 B. Z) R
注意:默认该镜像运行的实例只能使用ssh key以centos用户身份登录,如果需要使用root远程ssh连接到实例需要在上传前为镜像配置root免密并开启ssh访问。
( Y6 a' L, y, T7 F" a5 f0 a: G/ v# u" x# @9 v* x* y& C, N6 _
参考:https://blog.csdn.net/networken/article/details/106713658
7 d7 k$ t! T/ K6 e8 v; k' N2 r7 d* P: `% _6 I: T t
另外我们的命令客户端在容器中,所有这里有些不方便,首先要将镜像复制到容器中,然后使用openstack命令上传。
6 x" W. Q$ V. S. S3 U9 z/ O$ ^ f
* k" w8 Q, h6 p3 n6 R! u这里复制到client容器的根目录下。: _& t$ P7 f7 f- `+ d
, h6 Q/ y* X8 H5 l[root@kolla ~]# docker cp CentOS-7-x86_64-GenericCloud-2003.qcow2c client:/
4 b8 w- M! N. K8 Y+ a& t
/ |: g7 `( }9 }% X" } `[root@kolla ~]# docker exec -it client bash8 o; H3 T5 N/ |
()[root@f11a103c5ade /]#
0 p; {1 m: m* N()[root@f11a103c5ade /]# source /admin-openrc.sh # f) y& r+ g, C' O$ b
1 C, F1 U# S9 M8 G()[root@f11a103c5ade /]# ls | grep CentOS
; \$ Y: l* Z; ^CentOS-7-x86_64-GenericCloud-2003.qcow2c
5 G) m+ O! m" g8 \ j) C+ |1
6 y6 S* b: E" Q7 i1 X8 z# f2
2 x6 \( w* I1 q) s) S1 t" A& q n& C3
- w8 w' Z4 b9 m" s6 V4 z! n ]& E D4# L: \- A/ q6 B( w
5
8 F7 J' R8 L) Z( @67 j4 v, T+ ^3 }2 c2 l% x0 `3 P
7
2 n( n+ {0 V: p: U+ g# x w7 m4 `80 c, U/ g s/ n6 @: |- `0 n! C7 R
执行以下openstack命令上传镜像
" v6 `0 _: g; p' g" a' N
7 J. k1 r" B. J' b( sopenstack image create "CentOS78-image" \' J7 q- S- U9 q8 z3 s7 }% i' y9 q
--file CentOS-7-x86_64-GenericCloud-2003.qcow2c \
2 T _% h: t8 n6 S --disk-format qcow2 --container-format bare \
0 ?; ?! a1 ]6 B6 B; m3 a. n o --public1 v0 T/ `1 b d3 n. p9 p
1
& |% U5 F$ m8 ]( P2
8 p: Y+ z( Q( p9 |& t9 p) `8 M2 w* C3% L- s9 `& ~* b
4
" o, w) `0 d% X/ z; p; W命令执行结果
+ N1 t# X3 }, {5 O1 g! |5 n4 l0 }7 A! A( F; X3 i
()[root@f11a103c5ade ~]# openstack image create "CentOS78-image" \; N2 f% |* n8 s5 L1 B0 c
> --file CentOS-7-x86_64-GenericCloud-2003.qcow2c \$ G3 Q$ Q0 P( C2 W1 s
> --disk-format qcow2 --container-format bare \& \' @+ x8 x1 E/ I* ^
> --public
9 v* P9 G/ V V+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
! Z9 f9 A7 _" k7 e8 k( a$ x* A| Field | Value |
% |2 u* i! Z/ F9 n$ z4 l. B0 g' w9 h+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+" L. v1 j$ M; N: o
| checksum | 362d1e07d42bcbc61b839fb4269b173b |
' F2 X2 m9 n- L$ y' x p* x; N| container_format | bare |+ Z4 T6 h7 W6 @! j' i2 k4 R
| created_at | 2020-06-13T03:23:16Z |7 G& H1 e: g2 @5 ~7 i) }& \
| disk_format | qcow2 |
; |9 W/ H5 @) c% a| file | /v2/images/2d95d8a0-6fba-4ca8-9dde-8696eb7ebdbf/file | \4 ~% j5 L$ c) |
| id | 2d95d8a0-6fba-4ca8-9dde-8696eb7ebdbf |* }8 k f' z+ y
| min_disk | 0 |+ B, L: J5 c2 Q: }: v# e/ s" \
| min_ram | 0 |
. f/ |* P) r7 r4 o- I6 s+ C| name | CentOS78-image |2 \) v- c8 W1 [- k, a: t7 l% j
| owner | 65850af146fe478ab13f59f7edf838ec |
! m$ r! t- s- k# D+ H5 x U* l| properties | os_hash_algo='sha512', os_hash_value='aefa398f69e1746b420c44e5650f0dcf15926fb6f8c75f746bb2f48a04f7b140fdc745090f3d06b68fa0fe711ded7d822150765414e2a23f351efd2e181eb7b9', os_hidden='False' |
. ^' ?; x+ |: A5 q$ h g8 S5 p3 R| protected | False |$ c3 I; ]% X- r o6 d
| schema | /v2/schemas/image |
5 U/ W& S+ z2 ]0 g: t| size | 385941504 |0 k6 \. f1 V; x, d" \* Z
| status | active |9 R# u" k) ?. V- u) ~& I) K
| tags | |
1 K& s% \7 D4 a' \4 F| updated_at | 2020-06-13T03:23:20Z |4 v. f. c h9 H# R
| virtual_size | None |/ E6 X* e: L% V5 Q: M' T, w; S" l
| visibility | public |& |+ L) I) g8 U
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
" t( B; v7 I- z4 S9 ]11 R( m8 t+ A7 e) ?# U" b" V7 g
2
Q; s$ n: |# S" D9 c- R1 Q% k3. g; }' I& h# @( Q' |: h' H
4
, X, e% O/ p& |5
1 F' I( X7 T% U6 z Z6
! X6 ?3 F3 a/ B2 y" c7
9 N0 j d9 ? Z. o f u81 g, x! |$ a! q0 B
97 a; ^" a5 N0 r; Q4 M
10 @/ E% Q' P$ ]* h. [7 d- P
11
% w) [) U Z2 P' }/ h( i, J12
5 x& j3 V G. y9 M( I+ t4 [13- S0 W% D- j. R$ m) `8 u1 E
14) [0 R# _5 Y7 I" Q) |7 `1 L2 ?! z
15
. m: J( O3 m; m+ }& l16; g7 V; c+ o5 A! L* n) g7 ^. I
178 F/ O( }& Q, c( @: O0 ]3 ]% J
18
+ q" m6 A& N4 K$ H" i19
$ ?' L ?6 s% F) ]5 }. Z, a206 \% U) A7 {9 C# I4 z
21
6 B0 L* q4 Q1 S226 F" Q9 N! ^ k% P* R# X4 n; s% b
238 d# H! L8 b7 B$ Y8 j6 T6 p. ~9 R
24
+ p! s4 _& L! f2 i# l- g; _9 a25
/ f! K+ X7 U+ A: K6 V- j0 g26/ R2 U: {5 P. z
27
* B8 l, v- [' c/ R/ y) ~在horizon中使用该镜像创建实例,其他信息直接使用之前demo创建的资源即可。创建完成后为实例绑定浮动IP。% n& v8 R, r* g& p$ `
; v% S& Q& @/ W; I4 B5 W
如果实例创建失败可以查看相关组件报错日志
1 F {: D9 x$ w$ J: _# z& Z0 z3 Z7 u$ j, O$ P
[root@kolla ~]# tail -100f /var/log/kolla/nova/nova-compute.log 0 t) f6 Z# V( i# J" ]8 @! H
16 R* ?" n) t2 s6 ~
未配置root密码连接实例( Q0 d3 K+ K3 d( e `& T+ w
如果没有提前定制镜像修改root密码,只能使用centos用户及sshkey登录,由于是在容器中运行的demo示例,ssh私钥也保存在容器的默认目录下,在容器中连接实例浮动IP测试( X0 t- q. h% v2 o( q0 |, s# @, P" D
/ u' ~' e O3 ~9 L& m[root@kolla ~]# docker exec -it client bash
* U9 z4 U; K5 g! G+ ]()[root@f11a103c5ade /]# ssh -i /root/.ssh/id_rsa centos@192.168.1.105
. Q/ I. X. n B6 }Last login: Sat Jun 13 05:47:49 2020 from 192.168.1.100
y9 T% _8 o8 L4 f[centos@centos78 ~]$ ' ?5 y9 K6 D# R0 h
[centos@centos78 ~]$ 2 h/ _% ?+ o: ?" L
1
4 z* L V+ m8 R0 N3 w' s24 N: V2 g a& v4 z
3
# ^7 i' b( c1 S6 D, ?( k0 Z4
$ v, Z* P6 d/ ^58 |* t+ s$ v# f
或者取出该id_rsa私钥,使用SecureCRT登录:
' |* c- S9 P) Y' K6 ^
3 Y# M! H" T: X0 I/ _3 s: o配置root密码连接实例/ W$ I* c! \7 a) X3 I+ }/ n
1 L- s$ ]0 @1 J! L+ t7 g6 }如果提前修改了镜像配置root密码,直接使用root用户密码登录实例即可,/ B7 F& Q" }% [$ c5 i5 S
3 |- c% V* i( Q2 D1 x% d/ b' g+ d
[root@kolla ~]# ssh root@192.168.1.105
- o" e' _: v" y% @+ X troot@192.168.1.105's password: - I# t, Q# R% P
Last login: Sat Jun 13 05:51:53 2020 from 192.168.1.100: Y. u/ N( ^, T7 O- X
[root@centos78 ~]# - ^6 n2 P4 W2 P5 F7 a$ H$ |
[root@centos78 ~]# ip a+ ^# M1 M* w S4 c: p( p
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
" r6 r" l% R9 e+ j! M( C C6 z9 ~ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
- J% n, q7 S- s inet 127.0.0.1/8 scope host lo \0 |' c6 X8 l- t8 z
valid_lft forever preferred_lft forever! ?6 H9 l' Z6 f2 Q2 h7 U& X/ X
inet6 ::1/128 scope host
+ p8 ^% |$ f: ]6 U7 h valid_lft forever preferred_lft forever" U- A6 ^ z# a o" r! h
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast state UP group default qlen 10005 Q. s1 o& O9 ~+ e* O" m' x
link/ether fa:16:3e:94:b5:71 brd ff:ff:ff:ff:ff:ff
2 }: ?5 e: s0 J2 N1 R$ x8 a inet 10.0.0.193/24 brd 10.0.0.255 scope global dynamic eth0
% N! T! u! P! M: d valid_lft 84215sec preferred_lft 84215sec5 V+ p4 H+ N' R- @1 M# z4 ]
inet6 fe80::f816:3eff:fe94:b571/64 scope link
a7 Y) h8 T" p. J. p+ I0 G( { valid_lft forever preferred_lft forever' C9 w! A9 y2 r' m# h$ w6 f
[root@centos78 ~]# + e$ k$ ^3 j6 v' }1 v
[root@centos78 ~]# cat /etc/redhat-release
+ D" o/ Y% D2 cCentOS Linux release 7.8.2003 (Core)) E( c0 F' S R
1. C) K5 E. \. P$ r2 U
2& }$ o- h$ S, E3 v2 E
3
( N/ u, i' E0 K1 e& }8 ~1 c4+ D2 F7 D- \( {+ `6 b. K% ?! v5 o0 ]
52 |4 y4 ]- ^4 \
6
# v( f4 t$ V0 I7' a5 p3 R6 c& M5 m
8
2 V B) z5 R" c' D3 C2 l9/ e7 x. Z1 [4 h' ?7 Q
10
2 w1 y& T+ e1 b( Y% T$ {, z11
9 f5 b/ T/ o4 Y& j+ g12
" l: L- c( r, f1 t1 O) G3 x0 V0 [13) h+ D' m' [) i; c
145 j- w; b- f6 E% L7 {% ]% y
15" q z( r# N/ ?0 t% {1 j5 p- f+ x
16 I0 x7 p( I# w% {" O
17
& L% X( B; R; E [ D8 X5 e9 }18
8 b9 i& X5 _% ~: w19
+ l* n+ @( u( e( M' e+ x% b' A0 ?5 l20
( x6 d o! i9 M+ r" O& P运行Ubuntu实例
* S7 t" f% u" F! z+ J" z5 h# N下载镜像. i1 u! L" _2 K* {. K* q$ Q; o, H9 m
! _" P2 Q& P. a; i- Z
wget https://cloud-images.ubuntu.com/ ... -cloudimg-amd64.img! m9 B: `0 w) ]
1; A1 `0 _1 F2 x$ c
上传镜像
8 K- a J/ }! L# e: S7 B, V9 f/ J4 A: J
openstack image create "Ubuntu1804" \
0 o# _; r6 Y2 i+ Y7 A8 m --file bionic-server-cloudimg-amd64.img \
0 V9 Y# q5 u! N6 Z; V, a8 W7 O --disk-format qcow2 --container-format bare \
- r$ @0 l0 t4 L+ N9 e --public9 w9 Q4 ~" L5 N8 _/ x* w* q: v
1
' p, J- H/ ^& ?) E, ~2+ U# ~' _3 c, p! F" k6 E* K9 h
32 O c: u( \+ C" D9 D9 a; x5 }
4
4 R3 K8 X6 b; L' y, J/ G按照正常流程创建实例即可,ubuntu镜像默认用户为ubuntu,首次登陆使用sshkey方式,然后执行以下命令即可直接切换到root用户(centos无法使用该方式)
1 f' Q& w1 Q5 I8 s& X- l h9 Q
5 X; i9 q" _! C" R- L$ sudo -i
" i- ~: O( b* E! H3 U9 q1
) G" J' `4 Z8 B9 ^调整集群配置# y' X. f% n; X# b- P# s7 s
集群部署完成后需要开启新的组件或者扩容,可以修改/etc/kolla/global.yml调整参数。# c8 }% c$ F* p
或者在/etc/kolla/config目录下创建自定义配置文件,例如
/ f0 I* D- j1 Q) \( @# ^" G6 ]. a
# mkdir -p /etc/kolla/config/nova8 }7 }% U @- }, U% S3 ]! ]
3 i$ G! C3 i7 r/ o4 c
# vim /etc/kolla/config/nova/nova.conf
3 i+ J, g8 m7 p- g- C[DEFAULT]
2 L# u2 l( i- e* J3 N% p( rblock_device_allocate_retries = 300
- N6 i& l; p* ?- c# _block_device_allocate_retries_interval = 3' g ^0 g6 \6 G8 V; f8 j8 r# C2 F% s
18 [2 h8 G9 l/ Q2 X+ v
2
2 A; k, W4 O* y3$ M& s" r, T8 `5 K9 \) B
4
& A4 \- c0 f: r; o; J8 A1 R% W' M5% M5 T& Q# k* I3 N! A C* O8 v9 A
6
/ {. q$ S! e& r& N! y2 D重新配置openstack,kolla会自动重建配置变动的容器组件。
+ g8 U" ^, O* Q* c, k* n3 n. a, O& O9 b$ O. m
kolla-ansible -i all-in-one reconfigure -t nova
6 V6 m+ p# o* D1 B1
) q8 K6 W1 c9 w" h l- p% qkolla配置和日志文件
. C; {# q+ A: m/ ~各个组件配置文件目录: /etc/kolla/5 f2 _ f# ~) [! s A. V2 H3 ~
各个组件日志文件目录:/var/log/kolla/
6 f( q$ Q3 X, E- ~+ @' V* L清理kolla ansilbe集群( C# T: c, L" w7 O$ L6 B' r
kolla-ansible destroy --include-images --yes-i-really-really-mean-it
7 u [1 I2 B9 H
$ l) w( B. a* O5 E4 x2 \' _/ T#或者
0 N4 ?" A8 l+ Y' k* |; e[root@kolla ~]# cd /usr/share/kolla-ansible/tools/
. Q2 _7 _7 W' Q8 H! [' X' v[root@all tools]# ./cleanup-containers
0 r" a) e1 P& d$ d: o7 P M[root@all tools]# ./cleanup-host* }, r8 c) I" s; W
9 b6 R6 _3 ~& Q+ i* c
#重置cinder卷,谨慎操作
# R& y8 d- ~3 s$ l5 i* Dvgremove cinder-volume
/ f3 T4 S4 `: N& |# A% [4 Z" D————————————————
; c( ]2 t$ @5 t- J7 @, F: F
: e! S$ O- [7 I8 }8 ^& H |
|