将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

 找回密码
 开始注册
查看: 324|回复: 1
收起左侧

kolla安装openstack

[复制链接]
发表于 2021-4-18 19:55:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?开始注册

x
Quick Start7 B; {8 A3 ?8 ^6 A7 j! m0 _
[url=https://bugs.launchpad.net/kolla-ansible/+filebug?field.title=Quick%20Start%20in%20kolla-ansible&field.tags=&field.comment=%0A%0A%0AThis%20bug%20tracker%20is%20for%20errors%20with%20the%20documentation,%20use%20the%20following%20as%20a%20template%20and%20remove%20or%20add%20fields%20as%20you%20see%20fit.%20Convert%20[%20]%20into%20[x]%20to%20check%20boxes:%0A%0A-%20[%20]%20This%20doc%20is%20inaccurate%20in%20this%20way:%20______%0A-%20[%20]%20This%20is%20a%20doc%20addition%20request.%0A-%20[%20]%20I%20have%20a%20fix%20to%20the%20document%20that%20I%20can%20paste%20below%20including%20example:%20input%20and%20output.%20%0A%0AIf%20you%20have%20a%20troubleshooting%20or%20support%20issue,%20use%20the%20following%20%20resources:%0A%0A%20-%20Ask%20openstack:%20http://ask.openstack.org%0A%20-%20The%20mailing%20list:%20http://lists.openstack.org%0A%20-%20IRC:%20%27openstack%27%20channel%20on%20Freenode%0A%0A-----------------------------------%0ARelease:%209.3.2.dev22%20on%202020-05-28%2020:43:03%0ASHA:%20437c6a1e30182462308903c98c95bbee7b6e001a%0ASource:%20https://opendev.org/openstack/ko ... start.rst%0AURL:%20[/url]][/url]

* l& u( ]1 N+ A2 q# H# H2 ^0 M

7 x: Y) y! Q. r9 r, oTHIS PAGE LAST UPDATED: 2020-05-28 20:43:033 O1 e% V4 u, O$ p% |

9 |5 M) e+ i. X5 r0 n# V$ ]
This guide provides step by step instructions to deploy OpenStack using Kolla Ansible on bare metal servers or virtual machines.
Recommended reading
It’s beneficial to learn basics of both Ansible and Docker before running Kolla-Ansible.

( l# {* `; w% r$ y! uHost machine requirements
The host machine must satisfy the following minimum requirements:
  • 2 network interfaces
  • 8GB main memory
  • 40GB disk space
    . u. i7 ~. Q$ Y; P; _9 L6 s$ Q
See the support matrix for details of supported host Operating Systems.
- }5 Q3 J, w" x0 o/ I+ T
Install dependencies
Typically commands that use the system package manager in this section must be run with root privileges.
It is generally recommended to use a virtual environment to install Kolla Ansible and its dependencies, to avoid conflicts with the system site packages. Note that this is independent from the use of a virtual environment for remote execution, which is described in Virtual Environments.
  • For Ubuntu, update the package index.
    sudo apt-get update& V$ r! r* F: j8 @8 S6 q
    9 x' L- d$ v* ~# \8 n
  • Install Python build dependencies:
    For CentOS or RHEL 7, run:
    sudo yum install python-devel libffi-devel gcc openssl-devel libselinux-python
    3 ?; {8 d& E. v* s! D% H4 M: z3 v) L# Z7 R
    For CentOS or RHEL 8, run:
    sudo dnf install python3-devel libffi-devel gcc openssl-devel python3-libselinux
    ; }; m4 m% ^" `* q
    " ?' M1 Z9 X( b3 v
    For Ubuntu, run:
    sudo apt-get install python-dev libffi-dev gcc libssl-dev python-selinux python-setuptools( R% Y" P2 V# \
    % ^7 m6 l; z( a! L# t: z
    & F6 b6 G0 R- p
Install dependencies using a virtual environment
If not installing Kolla Ansible in a virtual environment, skip this section.
  • Install the virtualenv package.
    For CentOS or RHEL 7, run:
    sudo yum install python-virtualenv6 T% {0 }2 U8 g7 n1 X4 N6 k

    ( r  ?" t; k& ^( R+ d
    For CentOS or RHEL 8, run:
    sudo dnf install python3-virtualenv  n+ I& A2 Q# b7 z
    / {, o( p+ B+ n% o( j) R  y- u
    For Ubuntu, run:
    sudo apt-get install python-virtualenv, i3 S* L% o8 o, V8 }
    ; S7 z* f, x5 K+ W0 f& `1 `* ^+ b
  • Create a virtual environment and activate it:
    virtualenv /path/to/virtualenvsource /path/to/virtualenv/bin/activate
      G4 J; c) l. a- N. s9 A
    0 e4 w8 q$ h) N, `. _
    The virtual environment should be activated before running any commands that depend on packages installed in it.
  • Ensure the latest version of pip is installed:
    pip install -U pip
    ) V4 |$ Y# T, g, o8 ?( i# X  r& O1 m
  • Install Ansible. Currently, Kolla Ansible requires Ansible 2.6 to 2.9.
    pip install 'ansible<2.10'
    & ]% R0 P' t) _. S$ y% n' h5 S9 \, x' N

    4 p) O, v! B& E2 B2 s: O* ]2 y

3 h+ B# B; G) x( K3 nInstall dependencies not using a virtual environment
If installing Kolla Ansible in a virtual environment, skip this section.
  • Install pip.
    For CentOS or RHEL, run:
    sudo easy_install pip; D# S! B& [! D# x' h
    ' n7 v. G( B0 l# f* [" T9 k
    For Ubuntu, run:
    sudo apt-get install python-pip! p: a  s) x0 L; _4 |7 j) s% S( h
    3 d4 ]5 e, `: K/ D# M7 g" s/ n0 Z
  • Ensure the latest version of pip is installed:
    sudo pip install -U pip
    3 T6 r7 I5 O: B6 Q2 b6 ?! a+ I
      U& e; L- }- y* b5 @
  • Install Ansible. Currently, Kolla Ansible requires Ansible 2.6 to 2.9.
    For CentOS or RHEL, run:
    sudo yum install ansible
    0 E5 p9 W' y: n3 {( K& K% O8 [5 B# R! ?$ Z: o) \: b) g
    For Ubuntu, run:
    sudo apt-get install ansible
    ; k! }2 t" F2 T: a* p2 G; B% ]  A9 S8 A; M# N/ ]  i
  • If the version of Ansible provided by the distribution does not meet the above version requirements, install it via pip.
    sudo pip install 'ansible<2.10'
    3 y3 H3 L8 F3 Z: Z3 J: B7 n
    2 l+ V; A+ R5 J1 o4 U" i4 B0 e% W# I! D2 T* l- r# M

. m& c- b4 d; p9 R7 G  R: L/ C" w9 K# D; M" o, l% n' p
Install Kolla-ansibleInstall Kolla-ansible for deployment or evaluation
  • Install kolla-ansible and its dependencies using pip.
    If using a virtual environment:
    pip install kolla-ansible  a$ G2 Z& L# }) F0 P" F
    ; J' l! O2 `* ?- Q  G. b
    If not using a virtual environment:
    sudo pip install kolla-ansible
    8 t3 \3 P, O" p6 e4 Z' a% e( y$ b* r0 W& u
  • Create the /etc/kolla directory.
    sudo mkdir -p /etc/kollasudo chown $USER:$USER /etc/kolla: O: l& a; U+ L1 _

    ( h, U; i% X- w5 p
  • Copy globals.yml and passwords.yml to /etc/kolla directory.
    If using a virtual environment:
    cp -r /path/to/virtualenv/share/kolla-ansible/etc_examples/kolla/* /etc/kolla7 {" o5 h$ W  S
    9 E- _8 B8 H8 C2 o( t
    If not using a virtual environment on CentOS or RHEL, run:
    cp -r /usr/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
    9 g( n  e$ v9 W0 L* c( l9 a% @, ]3 a- J% h7 a5 h4 A+ Y
    If not using a virtual environment on Ubuntu, run:
    cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla, `3 _+ Q* A$ j; ]" D
    - ]$ ^4 M5 \3 }3 [
  • Copy all-in-one and multinode inventory files to the current directory.
    If using a virtual environment:
    cp /path/to/virtualenv/share/kolla-ansible/ansible/inventory/* .
    # G8 X$ c! B# P2 ?" K+ \& [' F/ E% v" Q( e: ~7 m, @# g. R
    If not using a virtual environment on CentOS or RHEL, run:
    cp /usr/share/kolla-ansible/ansible/inventory/* .2 j) {; r& T7 W& l+ n7 H

      V, H$ a+ O5 L9 r
    If not using a virtual environment on Ubuntu, run:
    cp /usr/local/share/kolla-ansible/ansible/inventory/* .
    ( O, t1 @7 o6 {9 k3 ]- K0 v8 Y/ A0 K/ V: p$ ~

    % u7 J  z+ p$ Y% |/ o- g# ]
' m/ |- ^1 [" [! [2 ]; Y: v4 z
Install Kolla for development
  • Clone kolla and kolla-ansible repositories from git.
    git clone https://github.com/openstack/kollagit clone https://github.com/openstack/kolla-ansible/ J  s4 w$ u: s7 v; v( P
    % |4 }& |' N* ]% J
  • Install requirements of kolla and kolla-ansible:
    If using a virtual environment:
    pip install ./kollapip install ./kolla-ansible/ o& w) S1 m5 B7 X/ s

    $ ?( t6 n4 n! {. B7 a9 m: z
    If not using a virtual environment:
    sudo pip install ./kollasudo pip install ./kolla-ansible
    " M# c5 b. R. ~* [1 E7 I% j5 ?4 Z2 L+ }+ L. p+ \6 L
  • Create the /etc/kolla directory.
    sudo mkdir -p /etc/kollasudo chown $USER:$USER /etc/kolla$ W$ d1 A' a+ y7 }1 f

    4 Q+ J2 W. a7 \. Q6 `$ p
  • Copy the configuration files to /etc/kolla directory. kolla-ansible holds the configuration files ( globals.yml andpasswords.yml) in etc/kolla.
    cp -r kolla-ansible/etc/kolla/* /etc/kolla2 N. x- z$ A9 G0 J) u1 S

    . l* @9 u/ D: U  d  B- }* V5 U
  • Copy the inventory files to the current directory. kolla-ansible holds inventory files ( all-in-one and multinode) in theansible/inventory directory.
    cp kolla-ansible/ansible/inventory/* .
    & k8 t0 h9 w# t( y
      S0 k- D0 h  d0 Y2 U8 i6 `5 U8 }" T% h

- v0 X6 o& [' K, ~7 G" k* d+ P+ U, b6 N! q* I% x
Configure Ansible
For best results, Ansible configuration should be tuned for your environment. For example, add the following options to the Ansible configuration file /etc/ansible/ansible.cfg:
[defaults]host_key_checking=Falsepipelining=Trueforks=100
! H- }) g% Z8 M, P% A
8 L: t2 Z+ s6 g) Z
Further information on tuning Ansible is available here.

' l7 L0 @6 s; L$ T: f: Y1 ?Prepare initial configurationInventory
The next step is to prepare our inventory file. An inventory is an Ansible file where we specify hosts and the groups that they belong to. We can use this to define node roles and access credentials.
Kolla-Ansible comes with all-in-one and multinode example inventory files. The difference between them is that the former is ready for deploying single node OpenStack on localhost. If you need to use separate host or more than one node, edit multinode inventory:
  • Edit the first section of multinode with connection details of your environment, for example:
    [control]10.0.0.[10:12] ansible_user=ubuntu ansible_password=foobar ansible_become=true# Ansible supports syntax like [10:12] - that means 10, 11 and 12.# Become clause means "use sudo".[network:children]control# when you specify group_name:children, it will use contents of group specified.[compute]10.0.0.[13:14] ansible_user=ubuntu ansible_password=foobar ansible_become=true[monitoring]10.0.0.10# This group is for monitoring node.# Fill it with one of the controllers' IP address or some others.[storage:children]compute[deployment]localhost       ansible_connection=local become=true# use localhost and sudo
    # [+ j. }7 k0 m( P2 [) \0 F4 e; ?
    3 t' d; ~  r; s( }
    To learn more about inventory files, check Ansible documentation.
  • Check whether the configuration of inventory is correct or not, run:
    ansible -i multinode all -m ping
    1 K" ?% b1 J) J7 T; v& X, I. [: U) F2 J0 [( B% c7 T
    - e0 q, z# I5 O2 _+ h$ ?

    0 b' I3 N  h; p7 I* }5 gNote; U% u9 f9 A! a  `
    Ubuntu might not come with python pre-installed. That will cause errors in ping module. To quickly install python with ansible you can run ansible -i multinode all -m raw -a "apt-get -y install python-dev"
    / z# o$ K; M  {. C
    ; w8 W4 m% E$ ?- B+ M

/ ]1 a. Q6 \3 n: QKolla passwords
Passwords used in our deployment are stored in /etc/kolla/passwords.yml file. All passwords are blank in this file and have to be filled either manually or by running random password generator:
For deployment or evaluation, run:
kolla-genpwd
+ O  `# t; [1 l
( j6 R$ N- t6 G! v
For development, run:
cd kolla-ansible/tools./generate_passwords.py
4 n2 a0 O5 W1 b  X3 I
$ ~  J6 w9 M8 w9 T$ t
, X* q( A& i3 R5 h/ _Kolla globals.yml
globals.yml is the main configuration file for Kolla-Ansible. There are a few options that are required to deploy Kolla-Ansible:
  • Image options
    User has to specify images that are going to be used for our deployment. In this guide DockerHub provided pre-built images are going to be used. To learn more about building mechanism, please refer Building Container Images.
    Kolla provides choice of several Linux distributions in containers:
    • CentOS
    • Ubuntu
    • Debian
    • RHEL
      1 b2 J9 R: y2 I) ]$ P1 r
    For newcomers, we recommend to use CentOS 7, CentOS 8 or Ubuntu 18.04.
    kolla_base_distro: "centos"+ j* M% y1 T+ n: _
    / I. e/ P1 o. e* \
    Next “type” of installation needs to be configured. Choices are:
    binary
    using repositories like apt or yum
    source
    using raw source archives, git repositories or local source directory

    + M0 V% w3 ?+ {- u' n9 k; b) k$ H6 b, V5 B: g2 W
    Note1 l* f5 U4 R. Z$ V  |# b# N
    This only affects OpenStack services. Infrastructure services like Ceph are always “binary”.
    0 E2 N9 w5 p- E, k% X$ r9 N/ N

    ! f' L) G/ x7 \
    " C, r. j3 G  {3 qNote
    7 ]8 g7 a1 W8 T; s. j
    Source builds are proven to be slightly more reliable than binary.
    . H5 c0 B' Z7 F, E
    kolla_install_type: "source"$ u0 g& |  O3 |/ [, B

    $ d& ~. w3 v, C
  • Networking
    Kolla-Ansible requires a few networking options to be set. We need to set network interfaces used by OpenStack.
    First interface to set is “network_interface”. This is the default interface for multiple management-type networks.
    network_interface: "eth0"! V6 S* S7 z& B6 A+ ~7 _- m  R

    ( _" S7 W) H4 k; j/ D. h
    Second interface required is dedicated for Neutron external (or public) networks, can be vlan or flat, depends on how the networks are created. This interface should be active without IP address. If not, instances won’t be able to access to the external networks.
    neutron_external_interface: "eth1"1 t8 _2 G1 Q; |
    + v: Z4 E! ]! ~) _1 O/ {/ Y( n% \( ~
    To learn more about network configuration, refer Network overview.
    Next we need to provide floating IP for management traffic. This IP will be managed by keepalived to provide high availability, and should be set to be not used address in management network that is connected to our network_interface.
    kolla_internal_vip_address: "10.1.0.250"6 W/ F9 s( f% l! B8 i

    , w' n* M7 V, l7 m; u0 d9 @9 Z/ Q
  • Enable additional services
    By default Kolla-Ansible provides a bare compute kit, however it does provide support for a vast selection of additional services. To enable them, set enable_* to “yes”. For example, to enable Block Storage service:
    enable_cinder: "yes"# _' Z9 d+ d- Z/ g$ l8 @& Z# M

    & i% _7 Y* }3 @9 q# j3 \
    Kolla now supports many OpenStack services, there is a list of available services. For more information about service configuration, Please refer to the Services Reference Guide.
  • Virtual environment
    It is recommended to use a virtual environment to execute tasks on the remote hosts. This is covered Virtual Environments.

    7 u% r/ p$ b* e. C. e7 r" X
$ i& a% A4 r- P  B: ~  E* u
" o( X  g" m- D, v; }' L1 h
Deployment
After configuration is set, we can proceed to the deployment phase. First we need to setup basic host-level dependencies, like docker.
Kolla-Ansible provides a playbook that will install all required services in the correct versions.
The following assumes the use of the multinode inventory. If using a different inventory, such as all-in-one, replace the -i argument accordingly.
  • For deployment or evaluation, run:
    • Bootstrap servers with kolla deploy dependencies:
      kolla-ansible -i ./multinode bootstrap-servers9 p8 q: _  l8 x. M8 a6 E3 ~4 Y0 I! F
      5 ]1 d8 |0 Z& J: F( m; S
    • Do pre-deployment checks for hosts:
      kolla-ansible -i ./multinode prechecks$ S6 T, Z+ o( }% e

      : `: `0 J6 M- ~7 B2 A) U2 g$ Z0 k
    • Finally proceed to actual OpenStack deployment:
      kolla-ansible -i ./multinode deploy& s+ q8 I9 X* G1 L' P: C- j2 X

        t2 t2 U/ g0 H- @& ~6 q0 `# W3 g/ S" l# x! t
  • For development, run:
    • Bootstrap servers with kolla deploy dependencies:
      cd kolla-ansible/tools./kolla-ansible -i ../../multinode bootstrap-servers
        [7 W& |  f; I+ `5 R" {7 D" E" K: y0 e7 s" ?1 Y/ v# [; H$ i
    • Do pre-deployment checks for hosts:
      ./kolla-ansible -i ../../multinode prechecks& L* T' i( f! c8 }; g

      ; A: D% t6 T& ^2 z$ Y
    • Finally proceed to actual OpenStack deployment:
      ./kolla-ansible -i ../../multinode deploy
        y7 b  |4 y  {. w7 B$ i  u) {" h

      0 z3 H: L% m! L6 U0 N

    7 q' c. s/ R3 a, f- {: y
When this playbook finishes, OpenStack should be up, running and functional! If error occurs during execution, refer to troubleshooting guide.

) m' u! \* j  ]+ q& m4 c* bUsing OpenStack
  • Install the OpenStack CLI client:
    pip install python-openstackclient
    ' {9 j' H0 G  b7 i! Y7 R; K6 K" Y. ?
  • OpenStack requires an openrc file where credentials for admin user are set. To generate this file:
    • For deployment or evaluation, run:
      kolla-ansible post-deploy. /etc/kolla/admin-openrc.sh
      3 |% @2 ?2 C& y; a+ a
      + _1 ^$ [. v& M/ ?$ b1 U" Z
    • For development, run:
      cd kolla-ansible/tools./kolla-ansible post-deploy. /etc/kolla/admin-openrc.sh' J/ W( I3 n+ y9 G( a* B- q" M

      4 P0 N  R, L' c: w- x
      * d3 u! }" }: A! }: }0 e
  • Depending on how you installed Kolla-Ansible, there is a script that will create example networks, images, and so on.
    • For deployment or evaluation, run init-runonce script on CentOS or RHEL:
      /usr/share/kolla-ansible/init-runonce( {( c+ W' E8 D) i

      4 R3 E: S5 Y) L8 x- [
      Run init-runonce script on Ubuntu:
      /usr/local/share/kolla-ansible/init-runonce/ c5 T9 a4 T4 W- M! R

      - A" v- e. u2 ]3 o( Q; K0 t6 U
    • For development, run:
      kolla-ansible/tools/init-runonce3 L9 O( p6 T+ l3 S! R

      2 r  W4 y' s( t8 M# X* Y
    • , C: {  L; j' v9 ^& o
      3 f0 m/ n6 q. \4 `" w% a
        N! X& r$ @4 @2 j$ y% b

    # T9 o1 g5 _0 u7 `( i$ P5 ^2 K+ d0 {
, L( F  U; o/ }5 d

  X$ q* A. N5 }! V' A
2 G' A3 {0 p) w! S& ]3 |% ?

6 n$ E: W! B; w2 y" l# C9 B; w
  e8 w# }# w) Q9 a) S- C# \3 c4 ^
/ h) [9 h0 f( ?0 k/ n2 h4 x6 D

) P4 I! F, d, Y/ a3 i
 楼主| 发表于 2021-4-18 19:59:16 | 显示全部楼层
安装环境准备
( d! x: ~: f1 b( H( D官方部署文档:5 ?1 Y8 K$ x5 C  z# T$ C
https://docs.openstack.org/kolla ... ser/quickstart.html
  N  V* O! E! S# V+ M; v3 S2 |+ H. b$ F) V) }& e1 z8 i% I
本次部署train版all-in-one单节点,使用一台centos7.8 minimal节点进行部署,该节点同时作为控制节点、计算节点、网络节点和cinder存储节点使用,同时也是kolla ansible的部署节点。! o/ A5 @0 X7 e$ y" B6 i

# E* j( g' B* j4 Fkolla安装节点要求:$ X) x& i- i: ~4 h4 u# T

) S, G' i+ c2 F5 ~; b- Y" Z" `2 network interfaces, q5 ]% ^  w# i
8GB main memory8 h5 S: ?+ x  J& @) Z& `
40GB disk space2 G6 ?. {" m& v5 u0 R
如果是vmware workstation环境,勾选处理器选项的虚拟化引擎相关功能,否则后面需要配置nova_compute_virt_type=qemu参数,这里选择勾选,跳过以下步骤。3 S  P$ j4 C1 J0 d& I' s, `3 K
" o) ?! ?9 d" q" ~0 |8 A
# cat /etc/kolla/globals.yml' ]7 c  f$ @6 z
nova_compute_virt_type: "qemu". V- ^/ [" C: p

; S2 b' @8 I0 c' u4 ]1 x#或者部署完成后手动调整) [" C6 u% B/ s) L$ l! I* C. z
[root@kolla ~]# cat /etc/kolla/nova-compute/nova.conf |grep virt_type- C$ t7 m8 q/ W5 I* v# @1 U6 ?
#virt_type = kvm
' Y/ b4 z* c6 Tvirt_type = qemu
( h# R& W5 Z' v) Q+ S
7 ~* S0 p4 H) \7 h! H% ~" a: V7 L  L[root@kolla ~]# docker restart nova_compute
2 D; ]3 V! P  }1
. l5 i1 m6 I& n9 ?/ S* Y; M2
6 l4 S5 p5 K! N- i1 ^) O3
/ T" M9 N6 R. X4
6 I% o5 H& b) ^8 l6 h. v0 Z' C5 U) ?5" Q0 j3 Y% c+ \! _* Y
6' z: h7 x3 g# w: [
78 U+ Q  B' m1 c  i. |# L
87 L4 [2 W, E4 ?$ u  h
97 O" }; a5 r1 L0 J' y8 w" }& t
kolla的安装要求目标机器至少两块网卡,本次安装使用2块网卡对应管理网络和外部网络两个网络平面,在vmware workstation虚拟机新增一块网卡ens37:
/ }6 Y2 @/ N4 G3 x! m% j+ }2 O* g+ g, Z
ens33,NAT模式,管理网络,正常配置静态IP即可。租户网络与该网络复用,租户vm网络不单独创建网卡4 [  h8 N8 s+ Z' d. \$ R* F  q8 I, G
ens37,桥接模式,外部网络,无需配置IP地址,这个其实是让neutron的br-ex 绑定使用,虚拟机通过这块网卡访问外网。) u1 e! b2 l4 @  R4 {
ens37网卡配置参考:) ]- O( U# G/ L& l3 C6 J
https://docs.openstack.org/insta ... ing-controller.html
) E! l0 U3 ], ]4 O8 m& H; }- I, \% S" b2 h3 E- X% J1 G
cat > /etc/sysconfig/network-scripts/ifcfg-ens37 <<EOF
* d& L! p2 J- ]3 k' ^/ x. Z% YNAME=ens37; }# Z" i. h! X% k0 a' J- b; \+ a
DEVICE=ens37
* q5 `7 p7 t3 i, kTYPE=Ethernet
9 \) X; J/ K3 q, j8 XONBOOT="yes"
4 X$ S! {+ w3 hBOOTPROTO="none"
& g* K7 O% Q4 [  _& @! fEOF; {4 x: `# d/ e) T
& v  \& y( ~4 g" I. ~1 @4 G& e: N7 w6 k
#重新加载en37网卡设备% A7 m$ i* _% y: e
nmcli con reload && nmcli con up ens37
# ^8 a. }/ T1 d/ u* [4 O16 Z2 ^' Z0 A) j9 d" e: b
2
+ p* _: ]% N8 Q) b3+ g& h9 e. ?0 G! v' r/ b0 T
4- p# K- L- s7 @" q6 z5 n4 L
5* R0 Q) x/ e! w3 ~
6' g8 C- W7 W$ I7 Z
71 y& O% U) R$ T
87 j1 _/ b2 q8 _6 b- m
9: l4 O5 Z5 H# _# h* A; |
10
& T" S3 }$ J# @0 a2 t如果启用cinder还需要额外添加磁盘,这里以添加一块/dev/sdb磁盘为例,创建为物理卷并加入卷组。2 k9 l- ?7 O6 m& k7 y+ C

' ^% q& h8 `) {7 N9 O+ zpvcreate /dev/sdb3 Z) I$ G) Q; f. d+ ]3 @! U
vgcreate cinder-volumes /dev/sdb3 k2 ^6 q4 ^- u+ Q' O4 o) D
1( v- d. |) j+ E0 O$ |! o  v2 e
2
; n9 q6 _% P* R) N* J0 U注意卷组名称为cinder-volumes,默认与后面的globals.yml中定义一致。% e0 R6 k# n) {# v& `7 G  Z* R

, ~. _' a. P) `5 A8 Q9 Q: t[root@kolla ~]# cat /etc/kolla/globals.yml | grep cinder_volume_group
. a- |0 q) p6 D' F#cinder_volume_group: "cinder-volumes"
1 Y% c% r/ h3 P1( W: z" A; p. {
2
  p$ i/ @3 I5 N部署kolla ansible" @  H0 f) m, g4 S; ?$ v; H" R4 C; n
配置主机名,kolla预检查时rabbitmq可能需要能够进行主机名解析
# t* |: B. m& O1 N% R- I& _6 [, J3 ?0 _' L
hostnamectl set-hostname kolla
) u) Z) H2 L* q# O3 u1
, |% P6 O8 M9 m安装依赖
# V. c2 k  n3 p
7 Z3 j& _5 \$ Z1 q+ F, s6 ?! Hyum install -y python-devel libffi-devel gcc openssl-devel libselinux-python
2 Y" Q0 K* L3 w( H$ Q" W1# L8 R0 d* H* p- K& S# A
安装 Ansible,注意版本,默认2.9应该可以满足要求' I! v3 B* U+ C0 o' E+ N, ^( g

* Z& B+ U7 X+ h' e+ [yum install -y ansible: r6 J. I$ K1 ^/ @5 b" L- m
1
" \8 Y( v! y: P' Z配置阿里云pip源,否则pip安装时会很慢1 O  p1 q( l9 r! `/ D2 e* ?9 i
$ O/ }6 S$ U" M5 x6 O  M2 L
mkdir ~/.pip
0 ^& H  Q7 O) [cat > ~/.pip/pip.conf << EOF
' X3 O7 S- U7 |! ~& E" ^( K& \9 L[global]
( f0 O! O6 O- ?! Atrusted-host=mirrors.aliyun.com
; g& i6 P9 |5 C/ ?index-url=https://mirrors.aliyun.com/pypi/simple/
& v4 x% N, T1 V+ F8 |/ jEOF
( n% f4 Z( T4 m5 E' r12 t! M  b) ]" L* v6 N$ e% L
23 o; V2 h' I: r5 R+ V$ F
3
" c/ c! {% s6 _5 L+ V9 L4
6 m6 ~1 c  q* ~2 {/ y" l0 V1 A3 j5# J& W( ^5 G3 ]' p. i: l/ a' B$ h
6
" s- J7 p3 u' p) ^4 o* \安装 kolla-ansible, E& F- h* {0 w# M1 Q

% N- }' v' y; x' \) g- J9 O: dkolla版本与openstack版本对应关系:https://releases.openstack.org/teams/kolla.html
- T6 {4 J) t' ?8 `) @, e% M( P$ ?- @# r8 [4 T' k" ]$ I
yum install -y epel-release" R& h  ~* A+ V1 h3 q8 x
yum install -y python-pip; D! m! d# u2 d% w1 d! z
pip install -U pip
8 \- F9 X/ \' m4 q0 Tpip install kolla-ansible==9.1.0 --ignore-installed PyYAML* N) t+ L' m+ S: d
1
3 p; `, x, J/ W( w2& ?1 u/ L6 z/ `2 W; R. g
35 P& X- k. F& q" |
42 o  F0 x* E. U3 M9 }- P
复制 kolla-ansible配置文件到当前环境
9 u- K. e, M  S! Z% W4 k/ b! y( |5 u- P
mkdir -p /etc/kolla
0 a. }* o# ~" Ychown $USER:$USER /etc/kolla
) v8 `8 N) N- r0 g8 T9 h, C' x8 Y' C' p
##Copy globals.yml and passwords.yml
& w/ P; I: O$ m- @cp -r /usr/share/kolla-ansible/etc_examples/kolla/* /etc/kolla! z" ]) R- Z4 J- n. w# X
% }, }2 S% k# k' i) b3 r
##Copy all-in-one and multinode inventory files
: x/ y$ V5 p2 y/ N. b! \8 `( Acp /usr/share/kolla-ansible/ansible/inventory/* .
8 y: X' ]+ x/ R. O. \8 r13 _; E, T% s. N9 h: i$ ]% l2 `8 R
2. l/ p' O+ _4 J& g  H" Y4 g
3% p: ?* {6 N" ?5 c5 G4 ?. ~
4
0 A; [" M- M+ y& @( j( f) i# x+ N5
' M% v* G4 X6 M5 z6
5 G# o# z& e( y+ q7' E$ e8 |5 Y; C+ t- z8 V9 O7 U
8' b1 o* j( {7 m/ N; P
修改ansible配置文件3 A2 k& M5 d% E& z" z( h' |+ ?

+ a: c3 E5 d# O7 ]cat << EOF | sed -i '/^\[defaults\]$/ r /dev/stdin' /etc/ansible/ansible.cfg
7 M9 U1 ?, d. O* X2 shost_key_checking=False
2 d6 P/ j2 s) Q( K; \6 vpipelining=True6 b5 H% m0 J/ g/ W) D+ M
forks=100
1 ?+ l. V9 C& i0 TEOF
) v2 y; m, p. {% i% K8 h) Y3 e1
7 J; t, \4 B# F6 l3 y+ }$ I2" P4 x, I" ~* `. S- n& B0 I' c
3
+ s2 J2 V( A( n& N6 w4
9 D* K* i7 ~0 z5: v* Z" k% l8 D
默认有all-in-one和multinode两个inventory文件,这里使用all-in-one,来规划集群角色,配置默认即可
3 c9 p$ f8 J3 p* N
3 Q0 C1 B7 a: Z9 X1 G2 Y[root@kolla ~]# cat all-in-one | more
; t. T) Z+ e6 g4 @' X# These initial groups are the only groups required to be modified. The! ?) _# n* d9 y; I8 r5 n
# additional groups are for more control of the environment.+ W, \% ]  K, E0 U( T. c% @" X" C" }
[control]
. o# [$ R1 e7 `5 g2 G6 blocalhost       ansible_connection=local6 Y: ~4 ]6 @1 d$ C% t! x& w

% b' Q" ^- @; Q+ @) \. F, j/ Z[network]
. a- `$ U1 ^( A& F/ U: {localhost       ansible_connection=local
2 i% F7 M$ d9 r  G: H/ O* u/ X. T# Z# |  M( p: d
[compute]9 h/ U% w  A7 u- e" p0 s- d
localhost       ansible_connection=local
$ I6 y- L# s4 b  H; R! L# U; Z& C
[storage]
; J- l5 _9 v7 K2 D5 Ulocalhost       ansible_connection=local. e4 i+ i% ], _& p
1 ?7 B! s, k& z8 M' z& ~* {: U% O
[monitoring]
; q0 ^8 t2 u7 `% W# \0 |5 |localhost       ansible_connection=local
1 t. r. t9 S% I; ~& O5 p3 v$ ^
* K7 T8 O8 i+ t3 {0 X$ Q- _5 K[deployment]
( e: O/ \" B1 k0 Zlocalhost       ansible_connection=local
$ l9 f, y2 c1 {( y; i.... d# G, B# ?- z7 E% ?/ o$ @1 u
1
& a  ~& A9 S3 C$ H- ^  |2
; w, O8 A% U( X$ B2 p% d) R3
1 l. P- d; W$ e( S( _4
7 ]3 c/ J6 V: A/ Q5
% o0 l! r# U" T4 O6 [1 n; t6
" V$ M" h% ]+ c: l, a7
5 r9 `3 H; E; `. Z3 ?! O; u8
: @1 n2 E; g9 C$ e" u90 J& n  L3 O; M
101 O  |% b/ x7 B0 p" g
11* |  {5 B5 b* L& v! o8 x" z) W. t
12
# L0 z& }$ k* V. D* A, }' Q1 J13/ j% H' [, I" s" q! w* i+ U6 B; m
148 l9 l: J$ `1 k; a  b7 b2 G" h7 o
15( j5 o$ s+ S# f# o: Z* P
162 @/ Y- W. U" G3 P+ i* J- E8 G
171 c! b6 h" x- t( s1 P
18
* S) l' O  n4 n( s9 E* c: k19
" G6 o6 s& ^- p$ T& f- N20# x4 D- B# H& S. Z0 j* t, M/ Y+ P9 |. T
214 ~) \" y) [. f
检查inventory配置是否正确,执行:
7 A# j5 J) p) {
% V+ y- _. a! r4 Z- ?5 ^2 h: aansible -i all-in-one all -m ping
. ]0 l- C4 J1 d: |) e/ t+ g: M5 a10 ]& B3 k7 t, @( _7 H
生成openstack组件用到的密码,该操作会填充/etc/kolla/passwords.yml,该文件中默认参数为空。
5 ?) P9 Z) U2 H+ V5 J
( y, [4 U) D7 g& D4 e9 ekolla-genpwd& ]7 L3 {( ~1 g, i
1: x' E9 r8 ?' r, g, L% Y4 m
修改keystone_admin_password,可以修改为自定义的密码方便后续horizon登录,这里改为kolla。
* h$ Q1 Q  G; Z! Y/ |8 G% r+ [. ]; n; M- ?) [* R
$ sed -i 's#keystone_admin_password:.*#keystone_admin_password: kolla#g' /etc/kolla/passwords.yml * ^; u# l: v; D4 m: G
/ D9 A% _0 k- e& C1 c
$ cat /etc/kolla/passwords.yml | grep keystone_admin_password& E) Z* [1 Z7 K+ k2 _, d5 ]
keystone_admin_password: kolla# d5 D( M! |3 G( l: c; F3 ~
1
2 [$ ^6 S1 w0 n) g2
, \. {, o5 t! V" H$ |, Y36 w" h4 {9 R1 u% D$ @5 z  p9 z
4
  d/ V7 W* F' x7 s修改全局配置文件globals.yml,该文件用来控制安装哪些组件,以及如何配置组件,由于全部是注释,这里直接追加进去,也可以逐个找到对应项进行修改。& X9 X9 q, E* j( W+ ]; T
8 f: d  O( P7 w; ^6 n0 H) k
cp /etc/kolla/globals.yml{,.bak}; g' D/ S8 Q. B1 y4 G* ~
/ |- [7 V! E1 F( O6 L
cat >> /etc/kolla/globals.yml <<EOF% ?0 t2 v& K! F
  N/ k; [' h" x5 V6 m- g
# Kolla options
5 d& n+ Q& t6 j/ G" s" `( fkolla_base_distro: "centos"
1 T% s9 E5 f* Z; A1 {kolla_install_type: "binary"  p1 H& w; |# ?. r
openstack_release: "train"
0 T% p* x: \. q1 Jkolla_internal_vip_address: "192.168.93.200"1 M9 [( E% Q8 X7 E% l% Y( m
: x  Q/ Y9 S; e, n. E" ~; I
# Docker options$ X1 C: m$ B. ]# |$ e2 G
docker_registry: "registry.cn-shenzhen.aliyuncs.com"
; Z9 G) I1 l$ N) L* r" }docker_namespace: "kollaimage"
/ d$ p" b6 ], q0 `" H* Z, E
9 f1 f( Z1 m% k- H# Z# Neutron - Networking Options
3 G. X% P* O, h: Jnetwork_interface: "ens33"! d& m6 h+ f/ N0 \6 Z' p5 K
neutron_external_interface: "ens37"+ d# V; l8 Y5 I. A" r/ i
neutron_plugin_agent: "openvswitch"
  ]$ q: o0 i* ~: f0 z' [) Nenable_neutron_provider_networks: "yes"; p3 e3 e9 ?; Q0 p  N
, p+ P( K/ F9 J+ c& v% p
# OpenStack services
/ [, x  H" z4 X' y' O0 Zenable_cinder: "yes"9 l* R" y1 J( R! ^' x; ]. N
enable_cinder_backend_lvm: "yes"
( {7 B. g- L0 s3 R, J- SEOF
- P! \2 F2 h8 O3 g, H! c" s8 K1' P: E) r$ z! P2 T9 q0 v; g
2' Q5 H& o  T1 ~- P9 D( b0 C
3
3 w: `! U; r7 B% }! j1 n6 T4! z  q7 N2 z/ J: H$ }) d
5! P1 j, ?+ i3 v1 I2 L8 P
6! _% a2 g/ g9 @! B
71 D: Z- |4 e( C
8  n! }! |) m- ?8 b
9& k0 c1 D% e; Y0 B' S, y! s, G3 @/ J
10; H2 u' Y9 j! {7 j. T! S) @; o' Q
111 g8 h, V: }$ ~3 [' ^2 _
12
; y# C2 {9 @6 B1 g+ I4 K/ _13' U2 d8 E, z' e! {. F' F0 ?) v: k
14
( D5 U& b. R/ n+ Z! O" G15& K, X$ ~+ j% |4 n2 z$ T/ A% E$ @
16
' Y0 M! A- U4 v7 s/ r/ l17* E) z5 u% L" \0 A' s0 x7 d
18
+ X6 l( n! Z$ J$ ?: w19& O+ g: V+ [6 Y2 i! @
20
0 K, N  X* `9 ~9 l7 O21+ _. f' I; J( p- Q8 n
22
  C( w; w7 x: u. O23$ w: Q2 c6 ?" Z7 B5 P
24; f2 ~$ Y# t! r  m
参数说明:
; z& E0 c; P3 P/ @
# |( k) Z2 i! bkolla_base_distro: kolla镜像基于不同linux发型版构建,主机使用centos这里对应使用centos类型的docker镜像即可。
2 }" z' H& {+ ?* \% t8 {kolla_install_type: kolla镜像基于binary二进制和source源码两种类型构建,实际部署使用binary即可。
2 d5 F4 f- \6 ?& Wopenstack_release: openstack版本可自定义,会从dockerhub拉取对应版本的镜像! _# U5 ]  a) m0 y
kolla_internal_vip_address: 单节点部署kolla也会启用haproxy和keepalived,方便后续扩容为高可用集群,该地址是ens33网卡网络中的一个可用IP。! W6 c% y+ |' e0 W8 n
docker_registry: 默认从dockerhub拉取镜像,这里使用阿里云镜像仓库,也可以本地搭建仓库,提前推送镜像上去。但该仓库目前只有train和ussuri版本的镜像,如何自己推送镜像参考该博客的其他文章。
& Z1 t' z& I" k/ [7 e! odocker_namespace: 阿里云kolla镜像仓库所在的命名空间,dockerhub官网默认是kolla。
8 c8 {- s. t2 O7 d$ m: q6 y4 znetwork_interface: 管理网络的网卡* z9 A+ C( c( a( L
neutron_external_interface: 外部网络的网卡
2 f: h3 ]$ i5 |. C8 Xneutron_plugin_agent: 默认启用openvswitch' o+ z  H# {! z- W4 ?
enable_neutron_provider_networks: 启用外部网络
: q( A" _$ i2 a. l" q* ^6 b' c. lenable_cinder: 启用cinder; a5 ]4 O; Q, _  H9 ]" V+ L2 j
enable_cinder_backend_lvm: 指定cinder后端存储为lvm
. M5 ^# d4 @) K! E修改docker官方yum源为阿里云yum源,另外配置docker镜像加速,指定使用阿里云镜像加速。; v# o* e' v! z! d

3 u' G& A# L5 S; ]' z% e+ Ysed -i 's/^docker_yum_url/#&/' /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml" o9 |/ z5 \' Q5 _; T8 o
sed -i 's/^docker_custom_config/#&/' /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml
$ r' o& l9 ^# z0 G. t2 x
* P6 M+ U# f  Y- ucat >> /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml <<EOF
/ D; m' J) [' S+ z/ V- hdocker_yum_url: "https://mirrors.aliyun.com/docker-ce/linux/{{ ansible_distribution | lower }}"0 a! a2 Z: k8 P* Q2 {
docker_custom_config: {"registry-mirrors": ["https://uyah70su.mirror.aliyuncs.com"]}
1 P+ L1 s3 T4 B: XEOF
& T5 F/ R) f( C15 m3 E% K& `6 c: z# O, ?
2
. f. i7 p% ~3 k* c3
$ i% r# Z# g" M0 O, Y4. C/ N3 Q4 y# ~2 @' Q$ y9 X5 P
5
3 y. p7 G+ h9 |6 ^+ ~0 g  U6
0 l/ ]; F' S# P  x7
7 Z1 z$ V4 S1 _4 m0 K部署openstack组件% W" `% H, X4 C9 Y  g
部署openstack9 r- d4 k( A+ c9 h. o0 p

1 j: u+ f. `1 G/ C) p$ @#预配置,安装docker、docker sdk、关闭防火墙、配置时间同步等
: t) z& F7 g. N4 D, p$ okolla-ansible -i ./all-in-one bootstrap-servers  s, f: h; u  k, C; C

8 S& m& r8 W$ N/ S& r#部署前环境检查$ m' c) o! H0 z, K0 F
kolla-ansible -i ./all-in-one prechecks
% B0 R* i. y- p" A" J
3 q+ y9 [1 C9 u: t" ~. Q7 ]; }2 [, R#拉取镜像,也可省略该步骤,默认会自动拉取
/ Q! M2 _/ t3 z! D3 R; Ykolla-ansible -i ./all-in-one pull
  F% ?; O8 ~' h8 V- f6 G
" m" I. C- l, Z1 |4 k#执行实际部署,拉取镜像,运行对应组件容器4 e/ Q9 j+ v( p+ K6 K8 o
kolla-ansible -i ./all-in-one deploy8 Y9 C  ?5 H3 u

7 O% u0 {6 |6 O! ]3 D7 F" h# A#生成openrc文件
* {& ~( W  I) ckolla-ansible post-deploy1 r( a. ~" C6 P" U9 B
1
. b0 k( O& j/ V, X3 z, u2
. v# ^& O+ x0 }% d8 j3
0 b5 m" t$ G5 v5 G# \3 s+ p. m4
& A# H. r0 M* {1 R& d8 L; r9 O" U5" _! e! J0 H8 _7 L! C
6
- z- |7 ~+ ?" f3 e& r( C7
/ p* Y4 B; |& x! o! d% J: N83 c  B8 d5 `3 m( |
9
- O( R; n# V  p% s( K' z10
# c" e( @3 K# v114 @5 @) f! Y% l! e$ }
128 }# a: K/ P. H8 ^
13
8 m1 I! Y: G) O. b  r/ Q14
0 v8 u# X3 f5 g以上部署没有报错中断说明部署成功,所有openstack组件以容器方式运行,查看容器4 g* [6 r! ^6 h1 c6 x

: D# u* \# b5 z" u+ y, R[root@kolla ~]# docker ps -a
4 E" T0 H5 ^8 \/ TCONTAINER ID        IMAGE                                                                                        COMMAND                  CREATED             STATUS              PORTS               NAMES
& H% H# _, z" d# U+ k1 i' l. R325c17a52c79        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-chrony:train                      "dumb-init --single-…"   36 hours ago        Up 25 hours                             chrony7 T$ m! A8 i5 n8 ^) a6 t
6218d98755ee        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cron:train                        "dumb-init --single-…"   36 hours ago        Up 25 hours                             cron$ K$ R% A. O1 `6 n* x5 b3 |% W# t
02b6598c1089        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-kolla-toolbox:train               "dumb-init --single-…"   36 hours ago        Up 25 hours                             kolla_toolbox; e5 u5 f2 j+ e# R' Z) z  r
8572e445abad        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-fluentd:train                     "dumb-init --single-…"   36 hours ago        Up 25 hours                             fluentd
0 M$ t6 ?7 ]8 \$ y) t  yf11a103c5ade        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             client
9 q* P- Q. L/ g7 z7 S8 r5c91def3c963        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-horizon:train                     "dumb-init --single-…"   44 hours ago        Up 25 hours                             horizon
) e1 f0 R8 w& D) x9 g! m- N9 _9 De024bd4f5dd3        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-engine:train                 "dumb-init --single-…"   44 hours ago        Up 25 hours                             heat_engine  ?8 t, k3 a4 o1 b+ n2 d: C1 ?5 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
9 @* @5 @* T) ^) _6 `5 weeefcfb31a61        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             heat_api
: E, [- k6 e+ x- m  j9b51b53448fc        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-metadata-agent:train      "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_metadata_agent
5 \) M  u9 G# i  I) ^0 q: K9f88a6c0cf31        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-l3-agent:train            "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_l3_agent
8 J3 i* \; O  L/ V, s, e+ O& _a419cb3270a6        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-dhcp-agent:train          "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_dhcp_agent
: l' o/ }- Q1 O3 z9 x959f6faba972        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-openvswitch-agent:train   "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_openvswitch_agent
) l/ n& w( H8 p" ]/ x4 J- Ccc1b081cf876        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-server:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_server$ o. x( F( b7 \1 C
eea1a87feb43        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-vswitchd:train        "dumb-init --single-…"   44 hours ago        Up 25 hours                             openvswitch_vswitchd5 Y9 d9 l  I& w$ [5 ~+ l+ y' t0 v
376f81bf75a2        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-db-server:train       "dumb-init --single-…"   44 hours ago        Up 25 hours                             openvswitch_db
0 P6 s) O5 ]% W# oc68fd9a92d73        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-compute:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_compute" g2 }6 ]3 i! V, {
2492e2a32c80        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-libvirt:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_libvirt5 `9 k, j+ l# i3 c" B3 P
3802d199b29f        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-ssh:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_ssh3 s- f" g4 D: C' `1 h# D- v3 w
1281c311ecd4        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-novncproxy:train             "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_novncproxy" s% H$ f0 {# t% ^3 p
2e8c8478116b        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-conductor:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_conductor
! n: E9 z- o( |0 w; k950feb59b549        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-api:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_api
$ c+ r2 q+ F# ]- o; P+ N3 U49497e664922        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-scheduler:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_scheduler
( t  |! F6 F7 ~; Of5eb37b48f7d        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-placement-api:train               "dumb-init --single-…"   44 hours ago        Up 25 hours                             placement_api7 A3 s  M" z8 W, j
54cd0e3be101        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-backup:train               "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_backup5 A2 L. {1 d7 X/ c+ L
b4efa4449e7f        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-volume:train               "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_volume; E3 J% m# t0 r+ _. [3 Z& x8 i/ W
159b669d2fd3        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-scheduler:train            "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_scheduler
3 k1 c! p  s& f5 O, X' h1 e# _1 X9fc7e6a4cb25        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-api:train                  "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_api
& U+ c% s. y; f# B, C+ b- j1 I; Db3f8f711f2b1        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-glance-api:train                  "dumb-init --single-…"   44 hours ago        Up 25 hours                             glance_api4 W0 Y% a! m  U/ j( w; r
760e92d698e2        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-fernet:train             "dumb-init --single-…"   44 hours ago        Up 25 hours                             keystone_fernet: {' I# I9 T! Y& u3 H* o; B
95f235c4ac10        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-ssh:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             keystone_ssh
( K+ U; P! x( v4 D6 z6 t03306334ce19        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             keystone# x4 l; E: w8 o7 O
5173d4191567        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-rabbitmq:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             rabbitmq
, @- Q5 T, [. l6 f1 ~& Q- o8 x8 Peb6bca26f6ce        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-tgtd:train                        "dumb-init --single-…"   44 hours ago        Up 25 hours                             tgtd
; L: Q% Q2 N9 o! b$ t0 [79fac2ca1b19        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-iscsid:train                      "dumb-init --single-…"   44 hours ago        Up 25 hours                             iscsid4 X. t" Q! I( o) {$ K
4a3fcefc7009        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-memcached:train                   "dumb-init --single-…"   44 hours ago        Up 25 hours                             memcached
! A9 l' g- r5 }- @3 _. }0773eaf446e4        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-mariadb:train                     "dumb-init -- kolla_…"   44 hours ago        Up 25 hours                             mariadb
. A6 I0 U2 U! z8 H, j8 ~# d9 E; H  @77f0beaa28e5        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keepalived:train                  "dumb-init --single-…"   44 hours ago        Up 25 hours                             keepalived
+ H3 y" I+ C* J8 W- S: Nb02b744d2da3        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-haproxy:train                     "dumb-init --single-…"   44 hours ago        Up 25 hours                             haproxy
9 A3 B5 p: N  }: X( ^1; x5 n, T& O% \2 H5 k+ t# {
22 [) `2 l9 t# s6 f
32 X" j* @0 L) L% ~
4
' q$ a) n% r9 u5- f) n. w2 T. ~, [# B
6/ N) B/ T* P& }8 |
77 J( I' S, K  {; B; G0 U
8
, h( A- L+ w* I9 h7 S; z* h7 u9* v7 d3 B. I: U$ F7 I5 Y
10# Q3 l3 s! B: s* g% N# k" {
11
5 ^" x! U4 S5 k" S129 t  n  `) l% W$ h/ f
13
+ E7 u: }0 d- p4 [, T14- M7 H) D( W/ F9 Y. d& P; ?
15) |+ C' Q$ G" G5 E' x) A
16
7 ]" I; L$ C+ e) u* }- l17
$ ~' L; k" d9 \6 W) v' i18' Z) t& Q" x% O  d: U; v" Y
19: T9 e8 X) N) a8 c  r! A
20( D+ E6 C: v$ b3 Z* ~
21( ^1 R1 K/ G3 y' t
22, ]  X$ g) P. Y0 t
235 x+ b, L3 V1 h# @
24
9 m) R& \. d& Z5 l% A8 D5 V" l- C257 d. k  E, @3 T
26
  n) m, Z" F/ \( i276 t) P6 r6 g% u! S
28
! A. ]* p2 g! w! y# p29
8 p" E+ w+ u4 B% [$ t9 W1 [304 \6 m1 r$ |1 X* U
31
- O1 l6 m) S0 t  Z3 p3 L32! q0 e+ h3 K9 k$ Q: O+ d( v% V; X
33
" S! G) Q* v; G' x5 C1 n; e34
* t4 I- t5 T2 x35) S) \8 b6 o' ~. B5 G* J
36
' t- c7 b) m% L+ r* N37
. b2 n: x% Z8 Z; }: \38' p/ h3 G: H1 d- F* w: v* K! U
398 K; ~( p. ~' ?% n% ?9 b6 I
407 X! C/ G- ~: A& v2 F* x
41
( s1 k. {. M& ?* D: v  _确认没有Exited等异常状态的容器5 ]% q6 A0 s/ K4 X) d

) }2 ~5 W* Y" \' t  c2 Z6 O3 t[root@kolla ~]# docker ps -a  | grep -v Up; J6 |: @. @3 D9 D
1! w( R2 F6 ]% _
本次部署运行了39个容器, N/ e- R. x3 ?6 C; S# I5 \
* x" g8 X. h$ ^. e0 }  B, k4 _4 w' k7 h
[root@localhost kolla-env]# docker ps -a | wc -l
+ B' _- C! \' k39
' t- m( y2 G% G- T0 \* w$ d1
" b# o: M. s& W$ W3 f% f: f" G0 @- z2
: l: N# R$ P, N" L1 b' Q查看拉取的镜像,发现镜像数量与容器数量是一致的。
7 {7 y1 ]$ f; J7 c: E) v" Q/ |: x0 C  A  c
[root@kolla ~]# docker images
/ c5 W3 W1 Q3 j- y1 {  Y0 bREPOSITORY                                                                             TAG                 IMAGE ID            CREATED             SIZE
" n& E9 h1 C$ \; [registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-glance-api                  train               aec757c5908a        2 days ago          1.05GB. i6 j; h" m1 t7 ?6 V1 T
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-ssh                train               2c95619322ed        2 days ago          1.04GB; t$ T) |& `: x
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-fernet             train               918564aa9c01        2 days ago          1.04GB
) u0 N/ O$ t) T' O- t( n) pregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone                    train               8d5f3ca2a73c        2 days ago          1.04GB
! ]# B- E! f) s. gregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-api                  train               500910236e85        2 days ago          1.19GB
5 {/ @# C. n: E) ~& yregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-volume               train               f76ebe1e133d        2 days ago          1.14GB; a& W- A$ A2 T1 }
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-backup               train               19342786a92c        2 days ago          1.13GB
0 {6 J/ [% h( X5 kregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-scheduler            train               920630f0ea6c        2 days ago          1.11GB( V* M2 r6 k. c) Q- K
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api                    train               517f6a0643ee        2 days ago          1.07GB
+ a7 S- B0 _* J9 Sregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api-cfn                train               2d46b91d44ef        2 days ago          1.07GB, H4 y4 @. X# v& h( p
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-engine                 train               ab570c135dbc        2 days ago          1.07GB5 @! l  c6 q, Q/ q5 f) d2 G
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-horizon                     train               a00ddb359ea5        2 days ago          1.2GB2 g  m4 I9 C8 D1 F0 _! _6 l
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-fluentd                     train               6a5b7be2551b        2 days ago          697MB
" _+ G1 X  B* y- T' X. U6 Xregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cron                        train               0f784cd532e2        2 days ago          408MB
7 K6 V7 l6 i% wregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-chrony                      train               374dabc62868        2 days ago          408MB
( l7 d  f! H- ~$ X3 c$ Qregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-iscsid                      train               575873f9e4b8        2 days ago          413MB
% g0 G' u7 x# [- e! G1 C7 `% ]; ]registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-haproxy                     train               9cf840548535        2 days ago          433MB: F" s6 r. F! P1 N2 W6 e
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keepalived                  train               b2a20ccd7d6a        2 days ago          414MB8 X& i4 ~1 U, J* n  f& H: M. p  |
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base              train               c35001fb182b        3 days ago          920MB
; `5 ^  e! `; x3 Z5 ]registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-compute                train               93be43a73a3e        5 days ago          1.85GB
* x0 }6 d9 ^0 ]0 s/ ?) D; I* F& mregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-placement-api               train               26f8c88c3c50        5 days ago          1.05GB9 Q; `0 X& l& ^% _% T
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-api                    train               2a9d3ea95254        5 days ago          1.08GB/ i( F) K$ w8 G' N: x5 S
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-novncproxy             train               e6acfbe47b2b        5 days ago          1.05GB
" f; V" _* Y0 E/ D: d; cregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-conductor              train               836a9f775263        5 days ago          1.05GB4 A0 p; J. C5 E/ [
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-ssh                    train               f89a813f3902        5 days ago          1.05GB
) v7 B* Y' H4 N: T  _* K$ u5 ~/ I- rregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-scheduler              train               8061eaa33d21        5 days ago          1.05GB
- v6 X4 T/ Q; ?registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-vswitchd        train               2b780c8075c6        5 days ago          425MB
  k0 q( n, b4 |; E. ^3 z( J* hregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-db-server       train               86168147b086        5 days ago          425MB/ U% O1 s2 d. o' l; C
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-rabbitmq                    train               19cd34b4f503        5 days ago          487MB
2 s8 Y% y1 t; ^; lregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-mariadb                     train               882472a192b5        6 days ago          593MB% N' O. ?# O& h  [, U
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-dhcp-agent          train               a007b53f0507        7 days ago          1.04GB2 i3 s; J' W6 |( |7 ?8 @; v
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-metadata-agent      train               8bcff22221bd        7 days ago          1.04GB
$ l2 d) [$ o# \1 ~& d* O+ |! Q/ dregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-libvirt                train               539673da5c25        7 days ago          1.25GB
$ Q; c4 I/ `" k6 ], n  a6 ?0 fregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-kolla-toolbox               train               a18a474c65ea        7 days ago          842MB
0 l1 I7 I, L# V# D  p; T0 Yregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-tgtd                        train               ad5380187ca9        7 days ago          383MB0 S, R3 ]3 U7 Y
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-memcached                   train               1fcf18645254        7 days ago          408MB; Z% I4 M6 n+ w2 U# W1 Y0 B' ?
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-server              train               539cfb7c1fd2        8 days ago          1.08GB
- x# F" e5 o/ o. K9 n& Tregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-openvswitch-agent   train               95113c0f5b8c        8 days ago          1.08GB
0 A5 P, g9 c  D6 w; F& H6 j4 aregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-l3-agent            train               fbe9385f49ca        8 days ago          1.08GB
/ P- c( M  b0 C1 D0 c1
% {) V- k( B/ D8 }4 v0 M2' p2 Y' H3 R) a) i
36 a% E: R. w& R8 @
4! [* S$ \) T3 g* L# r2 [
5% A6 B7 ]! j) c4 n$ K& p1 u; ]& D3 w
6
2 s4 P+ N+ P- h/ ~7
) [* U7 X2 P$ d1 \4 U6 P8
% B" U4 s( R9 ]& P93 g" D* H+ _7 y+ U$ v
10
: ~/ J' F6 l1 B  x% R! [11' D! J7 ^7 z. _* l5 C2 p) a3 g
12
7 W/ h2 ^  ?- f) t132 J6 A/ ?4 q) g
14  m  P: z; D: {+ T' @) [
156 H8 q2 i: f# l! ~, M
16
! d) z  N7 m& f7 r17
" N" t  {& c: Z- X2 E# S1 E188 Q, J" [( K1 R- a* M4 D6 N
19
* q! B2 g! E& b& e2 x20' P  j3 P1 u( O
21' N" F/ k- v" E7 D" x7 _# T9 o; y, S
22
. X& _. ~1 a3 M5 O" B( f23
) K; E3 v0 [: u! `24
% @: k# l2 k! h. B25
: e0 N* X1 ?  r' ?268 v) H; p: J# m7 h2 n% _
272 D2 Y. o" L4 d% H
28( |: x6 j" G0 L2 D0 J) V
29
" ]5 N) H# c' A/ k/ h! b) K% Z306 c3 I0 v5 X! c3 Z% e( k
313 V5 i( O8 U4 B) W: |8 l, N
32. }: [' z% h7 o$ A
33
2 Q- r' N4 H' x34
% A9 d1 N5 i$ h% j1 ~35
# G* g$ F; m/ r& F9 N4 Y2 C: D36: U9 s" j* [5 }: Q+ U) v" P
375 _/ s0 v- R$ h( L# |3 F5 u" L
38
7 J/ P5 w  s7 m) S$ @# a39% _( P4 ]. ?' a, I
405 h+ i* c/ _! p- R- n0 ]/ Z6 p# R
41. J- Y6 F" f" X% z8 B
查看cinder使用的卷,自动创建了lvm$ x! F$ s6 U/ U3 a

* x4 ^" q1 u  \. ^/ t" ?7 ?& ?[root@kolla ~]# lsblk | grep cinder0 q( K+ ~. E+ d0 p! G; A, J
├─cinder--volumes-cinder--volumes--pool_tmeta 253:3    0   20M  0 lvm  
0 ^$ \& P5 _( W6 [" A- [' f│ └─cinder--volumes-cinder--volumes--pool     253:5    0   19G  0 lvm  " V( X1 }. ~; Z, y
└─cinder--volumes-cinder--volumes--pool_tdata 253:4    0   19G  0 lvm  
0 b/ _" q, b: P. J6 c2 B  └─cinder--volumes-cinder--volumes--pool     253:5    0   19G  0 lvm  
/ k6 l" L( @3 ]3 P, f  m5 [5 i
: ^; z4 V. p7 b2 ^! e, ?( s8 n[root@kolla ~]# lvs | grep cinder
1 Y% V, c# C! M  cinder-volumes-pool cinder-volumes twi-a-tz--  19.00g             0.00   10.550 G+ k" X' {0 U8 u: \3 o1 f
1
+ a! x# k6 J  y: L  ~4 W+ u. c2
/ Z  ^8 B* g1 W, Y5 L3" ?8 F. v( d7 h3 Q% [
4
3 L, M8 f( Q! Z' j3 C! G5
3 }4 v6 ~) \$ R! |: z6
6 P' {2 I0 n9 ]# m7
6 X6 d8 {% {  y- w7 h8 G- D8$ ~) W7 z, O. F! J4 A
查看网卡状态* v, S2 ?. R- Q" p4 k8 }/ {) p6 Y
7 A1 Q: k, A: l0 R
[root@kolla ~]# ip a" Y5 e# I5 k$ q! Q5 C' G0 ~9 x
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
) p3 Q7 B/ _$ A  E' b) v; q! e4 C    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
1 t9 S& y2 h  h; B    inet 127.0.0.1/8 scope host lo% S/ F+ p; M$ f. J7 f) H
       valid_lft forever preferred_lft forever
$ V6 N) w( m8 i8 Q* z  q    inet6 ::1/128 scope host
% U7 b# g. ?7 l! W' l       valid_lft forever preferred_lft forever  m1 e4 R0 r) v( f6 P
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 10006 `5 X3 G- J+ X* b$ h# W
    link/ether 00:0c:29:0c:4e:fe brd ff:ff:ff:ff:ff:ff
& i1 _6 D  I' d: J' W% _* d    inet 192.168.93.30/24 brd 192.168.93.255 scope global noprefixroute ens33
' o# p% a7 i" d$ m' O; L       valid_lft forever preferred_lft forever. y9 N* C3 J& L% Z/ k' M
    inet 192.168.93.100/32 scope global ens33
6 t$ q9 I4 P' Z: |       valid_lft forever preferred_lft forever
) A& P4 @# m' K6 R- l    inet6 fe80::7a6c:d06c:ee49:4cd5/64 scope link noprefixroute 0 C& m, S% Y6 C
       valid_lft forever preferred_lft forever" T8 m  D! ~5 f* s- M& v& C
3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
$ A  O. {9 D6 j. x  ^    link/ether 00:0c:29:0c:4e:08 brd ff:ff:ff:ff:ff:ff
$ `9 ^, I0 z  m0 `/ K. `    inet6 fe80::20c:29ff:fe0c:4e08/64 scope link
/ e* J& Y6 Y. t. |; S% z% j       valid_lft forever preferred_lft forever
  G: W5 P. f# \4 r0 K4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 2 n8 u9 n7 F4 x
    link/ether 02:42:2a:d9:93:52 brd ff:ff:ff:ff:ff:ff9 u3 c! P7 c* M, s& _
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0  [/ M$ ]1 [8 R: B3 c: s8 J
       valid_lft forever preferred_lft forever
: f7 s: z) J6 R6 u% l  m4 ?    inet6 fe80::42:2aff:fed9:9352/64 scope link
! H& n2 g: F/ b6 ^) j* ]1 A3 {       valid_lft forever preferred_lft forever
  F0 a! `" u% N! S) d6: veth0c46c6a@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default : k# [% B0 d9 {
    link/ether 1a:ce:d7:61:d0:cc brd ff:ff:ff:ff:ff:ff link-netnsid 0
2 @2 O9 m+ F6 I    inet6 fe80::18ce:d7ff:fe61:d0cc/64 scope link . Y7 w9 B0 p: @9 }4 \1 E$ t
       valid_lft forever preferred_lft forever& z# C, a  Z$ k7 b. O
7: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000( N1 M: v" Y9 `# }: M) s+ {
    link/ether de:e5:b7:4d:e8:b8 brd ff:ff:ff:ff:ff:ff9 \' w) i% c  j& m4 P& i
11: br-int: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN group default qlen 1000
8 ^3 s  ?. C! t$ G+ b- V; c+ U    link/ether 52:14:05:ba:ce:4c brd ff:ff:ff:ff:ff:ff. _- \, Z* ^4 O
13: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 10008 i" U0 e; M; v* q
    link/ether d2:5b:76:f5:01:49 brd ff:ff:ff:ff:ff:ff
! j9 L0 f2 ]4 T) F" W/ N* G14: br-ex: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000! E6 z- B9 J& R9 ^3 i! P
    link/ether 00:0c:29:0c:4e:08 brd ff:ff:ff:ff:ff:ff
, k4 [: T  |) w# ^& I' `& a1 n/ x22: qbr2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000! `& k( ^, p. ?& p8 ^* T: X& M% [: p
    link/ether 3a:0d:ad:56:9d:9d brd ff:ff:ff:ff:ff:ff6 d8 J% Z6 F# v5 P6 Q
23: qvo2749f64b-1f@qvb2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master ovs-system state UP group default qlen 1000
# h, J) n+ y0 ^9 g( K9 l! ^# B6 d    link/ether c2:c5:8b:a6:72:8b brd ff:ff:ff:ff:ff:ff
. Y6 j/ |# N- F( I1 M. N# X) v. x    inet6 fe80::c0c5:8bff:fea6:728b/64 scope link
9 ~0 X1 E4 E& w$ x       valid_lft forever preferred_lft forever' g5 e/ `# m9 r+ U. R5 W1 |
24: qvb2749f64b-1f@qvo2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master qbr2749f64b-1f state UP group default qlen 1000
6 c. }) \6 Q2 [! q" c6 i    link/ether 3a:0d:ad:56:9d:9d brd ff:ff:ff:ff:ff:ff6 C$ b0 @+ c& ^5 D; V& d. e- Y: ]) U
    inet6 fe80::380d:adff:fe56:9d9d/64 scope link
5 M  }- W# c8 \. B# Q' Z       valid_lft forever preferred_lft forever' W( |  c5 `) o) {1 P4 Q3 t8 @
25: tap2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master qbr2749f64b-1f state UNKNOWN group default qlen 1000
3 w4 @- y7 Z6 E6 O' n    link/ether fe:16:3e:94:b5:71 brd ff:ff:ff:ff:ff:ff
% z( ]/ u- v( G4 U( {* k    inet6 fe80::fc16:3eff:fe94:b571/64 scope link 3 G3 F' }& i8 k7 a
       valid_lft forever preferred_lft forever  Y% O* G3 U" T0 l5 l: {$ L7 [- p% i6 d
26: qbr0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000
4 u9 A* V# l+ I: y2 ~9 J* h    link/ether 02:f9:32:c0:f4:b7 brd ff:ff:ff:ff:ff:ff
' U% P! c0 c  {) h  T  j27: qvo0a14e63d-2e@qvb0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master ovs-system state UP group default qlen 10003 F: B4 r# Q- e0 R6 B2 y
    link/ether 76:86:46:4c:4f:61 brd ff:ff:ff:ff:ff:ff
6 H( k! v! b1 c7 g4 @    inet6 fe80::7486:46ff:fe4c:4f61/64 scope link 5 u5 E* {  N) z& Q' U% L- o, W
       valid_lft forever preferred_lft forever
( f, P4 p' ~, b. o8 T( f28: qvb0a14e63d-2e@qvo0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master qbr0a14e63d-2e state UP group default qlen 1000
- a- F+ E, `) m( Q    link/ether 02:f9:32:c0:f4:b7 brd ff:ff:ff:ff:ff:ff. S# c' R+ T# q9 w
    inet6 fe80::f9:32ff:fec0:f4b7/64 scope link
0 o+ n( C. x& l3 [       valid_lft forever preferred_lft forever
9 y3 ^3 D: V, ]3 H) _1 @29: tap0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master qbr0a14e63d-2e state UNKNOWN group default qlen 1000* G( z5 P4 V0 k: ^: Q
    link/ether fe:16:3e:ee:08:6b brd ff:ff:ff:ff:ff:ff
/ G7 M% L9 c3 l7 u- y! @! F& Z- {    inet6 fe80::fc16:3eff:feee:86b/64 scope link 3 B% Y. O7 v/ S4 ?
       valid_lft forever preferred_lft forever: `+ i# _6 y8 B0 C' a( t  T
1& [  |+ d0 ~- ?
23 q' W! f5 x) w( s  l* I: s6 p
35 C' K9 d; C/ j- A
45 O2 L: Y; i* W: J# W
5- }9 i( c0 x& a' t0 J
6" ?* j+ R; J" E* B3 s6 _4 P
7/ n3 D# v, `. W3 z& W
8
% H- w! H4 [% b9
) A0 J6 G5 A+ A# _10
: X& r! z( k2 s, ?- v11
. i: i. ~  g* [: v( L& O6 ?12
- T8 K' _9 c9 \2 {13* W, d* n$ }9 }6 O! _$ I
147 p1 O0 q. v$ N- ~' B
15/ S8 I7 ~' w6 \
16
* B9 b" x. u/ f* D) S  Z, ^0 F/ p. G4 ?17( j6 s, u  W9 }4 e
18
" C2 d7 P4 e6 [$ U8 b: X: u  j2 ~19
* `7 W7 B3 z* \20: T: u3 f7 d' S0 O1 @! {
21
- B1 P. F$ C$ E$ ?+ x22: D8 Q, K" x' Q1 V
23
- ?" y2 i# g. F' ]249 y6 M) O, M& t/ E- e' ?& _
25
, m3 e$ \  Y$ O$ }: q1 G269 }( g; g- |. u0 P6 @
27* K; N! r+ D. X3 v
28
/ `% ]8 b. ^, p294 Q' {. n1 o% u. B+ }+ j. k* E
30( u& e  R* \% t, Q: o! k% W/ z
31
- B# v0 R7 c% p0 X32' B  j, a. g: I4 c" v( z6 ?$ y, X
33+ `" l, ], H9 [
34
: F( ?% K6 y( q+ ^9 U$ Y35- m9 Q. y/ Y& Y5 G& L
36" o2 g( h7 _: |3 |' A
372 o, i) ]9 @+ o) |) u2 q, J) m
38
0 o0 _1 e4 C& }2 X* a* n39  }! V7 g- N* \- i
40
* F2 s* D4 C7 ?/ Q3 `- B41. g" X" K- [( T% G) g
42
. Q4 Y1 F- l- a" B  c, B43
+ b8 J1 G' F; s, Z/ H! \44. @& G! R6 [- f3 s. ^+ Y' Y% w
451 R& q) M7 m7 g
468 _6 Z; m" `" @; E9 h8 l# T: y
47' C+ S" a: c- v6 y
48
$ A  Q2 X5 U) t  E49. @" ^. T. {5 I: l* j2 w$ t$ q/ L
50/ y, n2 q9 l* K- E% T
51- T! v  e) ^5 G# Q" q
52
3 Z/ S8 A/ e. E) a2 z53
' W& b2 ?% {+ Q) f/ I1 y8 c54' g& \2 G6 }- Y) V8 u4 J  o
55
, t4 [/ R$ J  |1 g9 a; P565 @6 r2 B# t4 H% Z9 H( W
57
  `3 A' `9 d9 l+ Z6 t0 y6 r6 Y3 [58, ~; b" A: b6 v& q- Y( }
59- C; Y" l' T% V9 t+ {$ j' {
60# m' R& a% m, V" k
61" h2 W0 S6 F) J
623 T0 D) Q9 h+ J9 |" {/ H
63% l* _0 y2 t) }, J0 L; K
648 P! n; r* G# `( v
65
& s- @' p6 D1 ?! e: A另外需要注意,不要在该节点安装libvirt等工具,这些工具安装后可能会启用libvirtd和iscsid.sock等服务,kolla已经在容器中运行了这些服务,这些服务会调用节点上的sock文件,如果节点上也启用这些服务去抢占这些文件,会导致容器异常。默认kolla在预配置时也会主动禁用节点上的相关服务。
" x4 Q8 V" Y9 o% N( P; o8 ^+ Z& P4 g8 v
安装OpenStack客户端
& r0 [6 v/ F2 ^2 r+ w* dyum安装openstack客户端
. @; `% u3 A/ S# [  n- ~! u" s0 o! ?1 s' \3 W$ H: H5 Y7 v8 f
#启用openstack存储库
1 V  L* K5 I2 W: Q3 x/ Ryum install -y centos-release-openstack-train! X) B, P) F" W( a2 i* E+ o4 Y6 z/ T
* x" _. v! p" A# [/ O8 J- T
#安装openstack客户端& i  w2 K" v1 _( s1 U3 Q9 X
yum install -y python-openstackclient0 W& X$ u9 V, t- F
& l( ~% E  Z3 ^: ], B
#启用selinux,安装openstack-selinux软件包以自动管理OpenStack服务的安全策略0 t; _# C$ A* L0 N( L  A
yum install -y openstack-selinux8 K, E2 S+ T- t$ X1 K

$ \5 Q* g# }' |% H! @3 C#报错处理
: D4 P* ^% J& V% O" X, mpip uninstall urllib3$ O* _, R2 {  c2 X7 A& K
yum install -y python2-urllib3
6 E" Z+ J: n( q8 j+ i' K10 d( m0 y" h2 b- l: [* N
2
( K5 r5 m' o- U1 p% P& E3& G5 g+ J: S$ V2 b0 l5 l
4( U7 N+ |' n$ X* D
5! j- V3 a4 n9 e# B* S
6
+ I  S# [- [# r3 a$ @  `7
% S# L8 q  c4 z. s86 Q- q4 C7 _9 Y0 ~# d; g9 @
92 p) c  {- }. E; G, j
10
8 x4 ^( c5 _' L0 G9 y11. b" m# \  e* X; h8 B
12% Q' F. i' B) Y) A) Z
kolla ansible提供了一个快速创建cirros demo实例的脚本/usr/share/kolla-ansible/init-runonce。
/ `; N/ X! J- h# y# E8 |5 q
* G' L( d3 G, S! M; i脚本需要cirros镜像,如果网络较慢可以使用浏览器下载放在/opt/cache/files目录下:
& }( ~- {0 m" y& w5 \! w- m% U$ ]- q$ f
wget https://github.com/cirros-dev/ci ... 4.0-x86_64-disk.img3 n3 W' V2 j' \( ]5 v) Y
mkdir -p /opt/cache/files/( ^+ o! b* T( h7 r! p& I
mv cirros-0.4.0-x86_64-disk.img /opt/cache/files/
" ]! c8 ~5 D$ {$ W8 u' _! x% z4 L1
2 X% f9 P8 V5 W# x: p5 C5 L1 `$ e2
5 H- g) V6 [1 ~3 h! l" T" G6 z3! x; U8 G2 o, b9 A& d  }
定义init-runonce示例脚本外部网络配置:# S' c9 d1 o8 r3 i( A; v+ e; K  K
/ W; W% Z8 P, W( q7 t/ E8 s+ d
#定义init-runonce示例脚本外部网络配置
5 Z8 F/ r. L) ?+ ?9 K' uexport EXT_NET_CIDR='192.168.1.0/24': @) T. s5 R, W; o$ ^' P
export EXT_NET_RANGE='start=192.168.1.200,end=192.168.1.250'9 W9 r3 v/ Q: O: ]9 }% P
export EXT_NET_GATEWAY='192.168.1.1'4 f7 i0 M. {4 O/ t9 T

6 i. H4 X, a# h$ U6 J; H7 @1 [#执行脚本,上传镜像到glance,创建内部网络、外部网络、flavor、ssh key,并运行一个实例
& B; _2 o/ p* ^1 C( c. rsource /etc/kolla/admin-openrc.sh & ?& n( a, ?4 M5 f: B2 k0 x
/usr/share/kolla-ansible/init-runonce
/ e- q8 P+ W1 g) N. k10 x' C, B2 d9 |' j, }) W
2
5 D6 f* O9 `& F) L) L. W8 V3
8 o/ m6 a, t) _1 F) y4' h* Y8 e; q1 j- S
5
- T/ v( J8 ~8 V* q1 T' H9 r3 B: F5 O6& ?; h# I6 Q8 T5 G: b; n: C. k
7
, |- H: Q8 g( j) ~3 @& t8 y8
7 Y8 ]6 V: _( {4 _! a参数说明:, z7 ]2 O; A; j: {

6 e% F, y) L( {, PEXT_NET_CIDR 指定外部网络,由于使用桥接模式,直接桥接到了电脑的无线网卡,所以这里网络就是无线网卡的网段。
. d3 J& F) \2 Q) O$ ~& mEXT_NET_RANGE 指定从外部网络取出一个地址范围,作为外部网络的地址池6 B) T) G2 X2 y, ^
EXT_NET_GATEWAY 外部网络网关,这里与wifi网络使用的网关一致
& _  G/ j% R- d7 o根据最终提示运行实例
$ y" H4 p2 v& `7 v) @* {$ X, |+ P
/ ^* i% M* y: Z& }: i3 t1 ]openstack server create \& R# R: b! [% [/ s2 r
    --image cirros \
4 Y/ Y# C+ r/ g+ \    --flavor m1.tiny \
/ U" h8 c3 L9 m0 b' K8 w    --key-name mykey \8 N" P  ]2 S! T* B9 X6 B
    --network demo-net \& `0 X) E/ F) z6 x* k
    demo1
; M6 n: o, ^, O: e" K* \( G+ t7 R16 O7 }) q/ h+ l6 `) H/ V1 j/ u
25 x3 [, f6 C1 Y$ L: c5 ~2 N
3
& g! o  u- [7 Z: H4( u0 i: f" U% |0 X7 T+ }
5/ x7 @3 r0 F" ~
6
9 v8 h5 [3 o/ i; o) @也可以使用docker容器作为客户端
' d3 u. X9 \. B8 a9 ]- Z. e' L; r# v0 k. a5 R, I
docker run -d --name client \. D! \6 Z8 O3 g5 g6 ^: y3 ?
  --restart always \6 t' Z' p" h6 ^' p0 P
  -v /etc/kolla/admin-openrc.sh:/admin-openrc.sh:ro \
6 o5 {: `. A1 j3 K/ |. b  -v /usr/share/kolla-ansible/init-runonce:/init-runonce:rw \
, j' S4 F7 e, P5 Z: [9 d9 c  registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base:train sleep infinity
: W4 y9 r2 x9 p+ V( ^' O3 _/ Z# s
+ b. n$ Q2 _: H3 bdocker exec -it client bash
/ d1 e$ T% A7 V$ u$ l9 Vsource /admin-openrc.sh3 D# o! N  ^/ H$ f: X4 V! G4 `
openstack service list, @5 p+ b1 n1 b* Y7 z, W
1
: M) @  P6 G7 M0 \) |1 k( V$ n" \2! d: q% y9 K: q( `
3
  B9 {9 `( X# K& F( F4; `$ w# m% m$ G& V6 D) |/ ^
5
9 |6 v2 m, M6 P69 a! u) j4 {' J1 P6 Z' C* Y
7+ m* v, O1 {! _4 J
8
2 F0 w, ]- `$ v+ M  _+ L) M% E  I9
7 F3 d/ Z$ P- K7 X, P; a访问openstack horizon
+ ~6 K  L0 i3 U7 U& V访问openstack horizon需要使用vip地址,节点上可以看到由keepalived容器生成的vip3 n" k/ Q4 q2 P" g  ?4 Q
$ O! C, p. f7 y) d2 H) j7 ?) r
[root@kolla ~]# ip a |grep ens332 W. Q" E4 j/ ?" Y  q$ x
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000: _- G( |( e$ _7 y( ^
    inet 192.168.93.30/24 brd 192.168.93.255 scope global ens33
6 q) W3 K$ y- ^) F$ w    inet 192.168.93.100/32 scope global ens33
" V3 {% Q# B$ D5 {/ g1; e4 R0 n9 t1 s/ B4 |3 Q1 u
2
$ i: w0 o( s9 Q1 w- q  o30 _* E4 T! a' ~1 F! {6 b
4
) g+ Q5 h- B4 T# X' y; [浏览器直接访问该地址即可登录到horizon
8 o& [: M6 Z) U) }% G7 W2 a8 d% k' M
http://192.168.93.100
; ^9 ^, Q9 T+ `
/ s3 q$ r. W- ~) r我这里的用户名密码为admin/kolla,信息可以从admin-openrc.sh中获取8 V0 R4 ~& [& {! ^, u% g

3 x3 O; [# |$ Q4 O# e[root@kolla ~]# cat /etc/kolla/admin-openrc.sh2 M: X& p. o, y7 Z% D& d3 k
# Clear any old environment that may conflict.
& K6 D6 N  O" @! S) k. h5 u% Sfor key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset $key ; done
/ `; X0 E  x/ O! h' B& G/ q( o; lexport OS_PROJECT_DOMAIN_NAME=Default* w4 P& b: d% ]6 k; A7 P  `5 y4 H
export OS_USER_DOMAIN_NAME=Default
$ E' d7 _0 V, \1 r) }& z3 r5 K& J0 kexport OS_PROJECT_NAME=admin9 C2 Z/ @) l& \  y8 q" C4 T
export OS_TENANT_NAME=admin
0 |; N* ~2 A0 `2 F4 texport OS_USERNAME=admin  j9 s0 W5 \" P( g) ^: r' Y
export OS_PASSWORD=kolla& y2 V9 ]* A2 ]; A
export OS_AUTH_URL=http://192.168.93.100:35357/v3
" t5 o& P% r8 I' o) ]6 A) l3 \export OS_INTERFACE=internal% Z0 [( W- c- j) X0 h
export OS_ENDPOINT_TYPE=internalURL; R- J/ k; }* x
export OS_IDENTITY_API_VERSION=3! V, Z% ~  A8 A3 ?3 h
export OS_REGION_NAME=RegionOne4 n3 |& f% C+ G1 V+ {
export OS_AUTH_PLUGIN=password3 S! ?7 Y$ F* {# D1 v) k
1" N, W0 d+ g) [8 U& V& Z
2
+ t4 e2 |1 R. f3
! d! s% z# |4 f* x4; J1 u+ G3 T. }
5
& m& }& y& s7 O  A+ ], p6
0 y3 V4 t7 m! j% E4 ?2 U" {7
4 Q8 D; a/ y" b8 m( ?- E8
$ ^+ x" x* \' ?5 @& f9" H0 l8 H: ]) m8 y7 l( I( t2 `
10" v4 e! c" Y- R$ Z* J+ P: l$ O
11
' k* `: I6 |8 \" k: n( A124 C4 d" {# F& m" ?
13" v" l' T& w5 M4 {+ \7 G4 s+ z
148 W2 A: d; w. q9 S
15
7 q7 V; B$ d5 I6 m" e默认登录后如下
" O3 U$ ?* E7 ]% ?( q& ~5 k
- F2 {5 |; \& f: R, V# t% X& p, l8 p2 H9 `8 c
在horizion查看创建的网络和实例4 Y0 K; ?* ~. `  _' }# k) \( _
- Y5 y. ?7 ^. o* L" }  B+ {
登录实例控制台,验证实例与外网的连通性,cirros用户密码在初次登录时有提示:& i1 f3 M% u2 k) o
: ]. m/ i$ c2 |
为实例绑定浮动IP地址,方便从外部ssh远程连接到实例6 O% q: S7 `6 n  a- [8 g& v, K
2 w, x9 _# n* u0 r' k
点击+随机分配一个浮动IP
2 s4 y. F, w# w  q
. h# x) Q, r8 n- S4 K  N5 ~. j. H7 \1 z% M% }
在kolla节点上ssh连接实例浮动IP,cirros镜像默认用户密码为cirros/gocubsgo,该镜像信息官网有介绍:, Q; P3 q  t( \3 M
https://docs.openstack.org/image ... es.html#cirros-test$ K& h: F8 m6 q; j

. F9 r) A: H) H9 G& _( O[root@kolla ~]# ssh cirros@192.168.1.248( D, o7 I# N* @  s& u, R" G
cirros@192.168.1.248's password: ! a: M) c6 H2 @, `: z& U  b
$
  `, v- k0 j/ ?: G  c, o3 F7 P$ 1 T: L+ O0 E& T7 u, P
1
/ O& F& ?2 \0 w+ E/ u2
) c0 y" y- o9 F4 ]' O: ~3* j3 ?1 ~7 y% T+ |6 ~/ b, Z
4
0 Z2 H7 l6 a3 J' L或者在集群外部使用SecureCRT连接到实例。
$ v! C/ Z4 J; b: h' }* `$ H( P9 p# d$ ?
: P/ R% Q* U* X, X9 l3 g5 \( E# w
运行CentOS实例
/ A7 n* s% h: U1 M' ?centos官方维护有相关cloud image,如果不需要进行定制,可以直接下载来运行实例。
& m. }5 [9 ]6 ]4 I
+ d$ [/ B; a* ^5 o; s参考:https://docs.openstack.org/image-guide/obtain-images.html
3 Q: s* H' m, a  c
) W* Y7 M2 {$ `7 D5 TCentOS官方维护的镜像下载地址:
8 A& h  ~- a( V% y% l8 Phttp://cloud.centos.org/centos/7/images/
0 c! `, D6 `3 T! f" y4 a8 x% e) z* [# `2 T" K3 [! p" b- ^
也可以使用命令直接下载镜像,但是下载可能较慢,建议下载好在进行上传。以centos7.8为例:
" S, Q7 z! `- Q) G0 q% u. \3 i5 l9 W0 l4 u
wget http://cloud.centos.org/centos/7 ... icCloud-2003.qcow2c
. V- ~4 n# |$ ~1( ^8 n. o9 [: F1 r
下载完成后上传镜像到openstack,直接在horizon上传即可。也可以使用命令上传。
) D+ n4 q' I  V1 ^
. z! z' F% B, h; r3 j注意:默认该镜像运行的实例只能使用ssh key以centos用户身份登录,如果需要使用root远程ssh连接到实例需要在上传前为镜像配置root免密并开启ssh访问。
2 f% v6 _+ t# o  U3 L' j# l, {2 _7 O: o$ X" z5 }, E9 U# c2 c
参考:https://blog.csdn.net/networken/article/details/1067136582 I+ X6 h* S8 @$ D* T3 O
' p  c  X: P& K; S8 e
另外我们的命令客户端在容器中,所有这里有些不方便,首先要将镜像复制到容器中,然后使用openstack命令上传。
' d# F% K! f/ q* _' N# S
! g0 Z9 @8 l6 }1 Q这里复制到client容器的根目录下。7 e  r% A7 i9 U1 v$ `

" M1 Z( L2 A) C: }9 x/ Q/ A[root@kolla ~]# docker cp CentOS-7-x86_64-GenericCloud-2003.qcow2c client:/
7 v& G8 h( i0 U. ^- h# S
$ c6 g: I5 M+ H8 R+ Y[root@kolla ~]# docker exec -it client bash2 C" u$ I; q6 r% @
()[root@f11a103c5ade /]#
8 P/ Z. G. Q0 \! |8 ]0 Z()[root@f11a103c5ade /]# source /admin-openrc.sh 4 J7 _' a- e0 m  k5 f+ Y- o

+ C" V+ r+ y" D6 S()[root@f11a103c5ade /]# ls | grep CentOS
& u/ D3 L  X5 WCentOS-7-x86_64-GenericCloud-2003.qcow2c
, Q4 Y: Q0 ?3 _  r6 N- J1 q/ ^9 r1; i8 S( Z2 k9 k2 G" X
2
* y" |9 ~+ M& G& Z- h# ?' z3
. @# ?. X% K; e6 W4
5 y( T; L% Y9 T8 z5
" u- r5 P; Y, N, ?6' O# B! L7 s+ |
7( {: i5 b% E2 d6 e1 `. @3 g! E
8
$ k& X5 \9 k8 v  c5 m执行以下openstack命令上传镜像
9 _5 T) M- c$ l( F* R2 m# |4 g% L, m. ~/ C  c8 Z6 }1 q: H
openstack image create "CentOS78-image" \
! V% K. z4 J" |2 c" w  s' Q  --file CentOS-7-x86_64-GenericCloud-2003.qcow2c \9 y5 p# j6 L6 }% h. w8 V
  --disk-format qcow2 --container-format bare \
. ]' s2 s# m$ w( o4 @  --public
* _1 }1 g; Y8 g6 U4 P: j1; y. P, U7 m5 w& s" `: ]9 u  x3 |
2
7 L8 V3 g. L; x4 k) F3
$ E& ]) n' |& _8 W4
/ G) W- P  d3 q/ [* U命令执行结果
0 ^  `4 S3 d" x! }7 _5 |& T
& z! w6 G( M0 F* y/ V3 t# `()[root@f11a103c5ade ~]# openstack image create "CentOS78-image" \
0 I* I/ R5 t, M% z' C>   --file CentOS-7-x86_64-GenericCloud-2003.qcow2c \0 [* f. T: u; [  O! D2 A
>   --disk-format qcow2 --container-format bare \. k! O' i: t0 t, p, o! E
>   --public
6 M0 [- t6 _1 s( M+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+) k# V6 g  a  W$ M* x5 D" Y. [( c
| Field            | Value                                                                                                                                                                                      |
! I" ?0 _+ q* z9 E. k7 X' P+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 U. r! P) |* f8 b# n| checksum         | 362d1e07d42bcbc61b839fb4269b173b                                                                                                                                                           |5 E9 D& {. K/ x9 f
| container_format | bare                                                                                                                                                                                       |
, Q) K( P( d- s" w  H5 e| created_at       | 2020-06-13T03:23:16Z                                                                                                                                                                       |
4 }7 y8 A. d3 |3 U% J  I( I5 g: U6 y6 d| disk_format      | qcow2                                                                                                                                                                                      |/ [. J5 j( W& Y
| file             | /v2/images/2d95d8a0-6fba-4ca8-9dde-8696eb7ebdbf/file                                                                                                                                       |9 m+ N$ h9 L; m' @* f
| id               | 2d95d8a0-6fba-4ca8-9dde-8696eb7ebdbf                                                                                                                                                       |
7 c7 y" P9 n6 q; M- N! \% _( Y| min_disk         | 0                                                                                                                                                                                          |: \( U& o9 K' _. f# D5 @
| min_ram          | 0                                                                                                                                                                                          |
8 C. n7 I9 ], `( B, R; P; X| name             | CentOS78-image                                                                                                                                                                           |
1 I) w2 \. W; y' ]8 w* I+ a| owner            | 65850af146fe478ab13f59f7edf838ec                                                                                                                                                           |
+ M& w; s+ F8 \% x( |# M6 A9 t) b) V| properties       | os_hash_algo='sha512', os_hash_value='aefa398f69e1746b420c44e5650f0dcf15926fb6f8c75f746bb2f48a04f7b140fdc745090f3d06b68fa0fe711ded7d822150765414e2a23f351efd2e181eb7b9', os_hidden='False' |
& o7 C4 T5 I7 v$ |+ k| protected        | False                                                                                                                                                                                      |
! E9 i; O: i' r3 y| schema           | /v2/schemas/image                                                                                                                                                                          |0 N% N/ G% l! C) f- m" t- ^
| size             | 385941504                                                                                                                                                                                  |3 u" I1 }+ |* s* f
| status           | active                                                                                                                                                                                     |6 \- t* [) l* k% v/ F
| tags             |                                                                                                                                                                                            |
+ v2 q' v2 {1 b6 y6 L, ^% l7 ~| updated_at       | 2020-06-13T03:23:20Z                                                                                                                                                                       |% z" [( s9 W% P, G( P
| virtual_size     | None                                                                                                                                                                                       |8 Q- g& u; W' g3 z" H
| visibility       | public                                                                                                                                                                                     |* w" [6 ~" t# S& q( c
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+& P* h9 D6 U/ b: j: a) X; E
1/ _, M& {) O: j( _0 ]: `
2
9 E' s2 {' |* x3
4 h  a/ t- i$ [1 z/ f8 f7 {4
: I' b( K. G  B3 _1 O8 c: B5* b5 {! v; G8 H& n4 y9 ~% q
66 A8 L! i/ _1 n2 n" y
7
; @, y0 H' o, ~1 I& q, I8; |. f0 N4 D% w" u7 e
9" Y& R3 b. N5 n
10
; q8 m$ H' n; I- H11% \8 v4 G+ U( B+ i3 t8 V+ A6 u
12( f; o. Z8 v5 n7 N4 N7 V1 Z3 N# ~
132 t7 m2 \8 B5 g9 z" E. {" _  J
146 ~* U# G( j3 Y" I$ A; ^
15
. `1 H7 S" v) z: y16
8 |( z/ d0 [1 }* L- y17' s7 A$ F5 y5 H- Q% r3 B: V
18/ h/ z* K6 X, O7 K0 c$ }/ L
19# c! x! ]7 A9 }% s3 Q3 I
205 H, g) K) c: b
21
5 J, }- R  G# E# x  U22* V  x, W7 a7 x, F; m: F
23
! G: T3 \$ W; s" r8 U7 L24$ L2 h" q3 i5 J0 x! u* Y* a
25
& G* t. d; n% ~26
1 {& N% ^0 {0 b% S/ d3 P" \  K  ~  g$ ?278 f* \3 N5 H1 B' v- s$ P
在horizon中使用该镜像创建实例,其他信息直接使用之前demo创建的资源即可。创建完成后为实例绑定浮动IP。  D5 v4 h2 |' g7 e, P/ _5 c

9 o' |  v6 \% @5 G: v) W9 ~如果实例创建失败可以查看相关组件报错日志3 Q2 p8 M1 F6 ?2 ^) L# M

& i- R2 |  @/ J" [4 i4 P[root@kolla ~]# tail -100f /var/log/kolla/nova/nova-compute.log   y9 a2 @8 k/ Z
1
: b! j6 n9 z; m- h未配置root密码连接实例
' W' i, w: E% ?& R5 i" E如果没有提前定制镜像修改root密码,只能使用centos用户及sshkey登录,由于是在容器中运行的demo示例,ssh私钥也保存在容器的默认目录下,在容器中连接实例浮动IP测试9 \, L7 Y8 D1 N0 l: J

1 A6 u7 p: t3 _& o[root@kolla ~]# docker exec -it client bash0 M( J6 a; F* B
()[root@f11a103c5ade /]#  ssh -i /root/.ssh/id_rsa centos@192.168.1.105
# t4 C8 u2 ~$ LLast login: Sat Jun 13 05:47:49 2020 from 192.168.1.100
0 R2 \- X+ {4 v5 Y$ ~[centos@centos78 ~]$
$ G& f, T2 e& ~[centos@centos78 ~]$ # U$ Y: D/ B7 {% p
1: M  @* f- W  ?7 M2 R
2: Y( B0 `+ y% B' z6 z
3$ m6 D3 m* L/ a6 y% C% g
4
. x6 m* V5 x1 `: o5 Z2 y  W5
( P1 C; m1 K+ F+ h或者取出该id_rsa私钥,使用SecureCRT登录:. B) Y0 [/ N' d5 Z' K( _0 ]9 V

) P( A9 ~  b: |, A) @5 W配置root密码连接实例
% {+ e3 T" k" i+ P* N' y4 \7 D4 e9 P$ Q8 ^3 ~5 @
如果提前修改了镜像配置root密码,直接使用root用户密码登录实例即可,
( Q) t9 E$ p7 @! E- t! t
4 p8 j' ?' ^' m& r- ~* u" ?4 ][root@kolla ~]# ssh root@192.168.1.105
6 w8 Y8 O2 E- C+ Mroot@192.168.1.105's password:
3 ]9 A) ]: ]* N+ ]9 p2 rLast login: Sat Jun 13 05:51:53 2020 from 192.168.1.100
( w) @1 y; L( k[root@centos78 ~]#
! y. T, M: o+ B. r% U[root@centos78 ~]# ip a% g7 E/ ?3 m+ @6 P* W2 U
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
: ]. J/ C/ t/ X6 w    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:001 F* m, K4 [2 ~( p$ }: I2 e' I
    inet 127.0.0.1/8 scope host lo) I6 A3 M) K% V" X
       valid_lft forever preferred_lft forever
! B  i+ i9 f+ c2 J9 ]    inet6 ::1/128 scope host
4 A9 A, s% f6 u% M/ B8 @& G       valid_lft forever preferred_lft forever" O8 [( O) [( @# }! |( J( a: ^) a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast state UP group default qlen 1000( Y, R3 v4 K5 u% G
    link/ether fa:16:3e:94:b5:71 brd ff:ff:ff:ff:ff:ff
% ?# I1 P  e# s' E8 R$ E- i# C8 ^    inet 10.0.0.193/24 brd 10.0.0.255 scope global dynamic eth0
$ w' S6 [6 I! t# g' L       valid_lft 84215sec preferred_lft 84215sec& h# H% `% p/ p# V
    inet6 fe80::f816:3eff:fe94:b571/64 scope link
9 ^( ]4 x) h/ @4 _' {       valid_lft forever preferred_lft forever% M) W, o1 m$ n) Y# r- K5 ^  J3 r3 w, C
[root@centos78 ~]#
5 J% f, D' e6 f& e0 x2 h$ u[root@centos78 ~]# cat /etc/redhat-release # h1 h7 r( r: B+ a& W. R
CentOS Linux release 7.8.2003 (Core)
9 a) M& p$ U, z  w+ ]1
' b6 o( [! @6 Q& |9 @1 ?5 L$ A2
" B4 y! b& M4 m" ^( a6 `6 ]) m0 A/ i3
3 n$ }% n# w5 m: q# j4( b: |) n+ K8 X9 P, {
5
9 _1 C- c& d5 w6
9 Z- Z6 M: b' ^: V8 J/ Z7
; _2 g. y4 P# K* c/ q/ p* b" B80 t( P: Y# p& E1 `
9+ R# t0 B! p) t, l
105 B' S% g& j! q, F
11
7 O0 m  B* A' a) m4 e12
/ g4 N5 L! X# q& N6 d1 k13
9 g; N) b5 L) x, V14$ @3 r5 C& j7 }7 d7 q
15
5 e' H+ j6 Q' L7 k8 p0 a16- N" v# @, ^- D
17
- {- e. A8 W" R, U/ C5 o  [18
; }# A, D2 }# Z* _% b  `193 x2 q  K/ Q$ R- E( H( S
20! t: K, V5 W5 |5 U6 u
运行Ubuntu实例
3 E/ v( G( k5 R6 b9 w2 N' H1 Q下载镜像
* }- m, q( u1 T# b+ F  T& u6 ]8 w: v7 X  h! w7 x1 e6 J4 ^
wget https://cloud-images.ubuntu.com/ ... -cloudimg-amd64.img/ ~% e# ?6 b9 a
1
" a* Y8 d% F  b" z7 Q- e  U上传镜像9 F; q: t! [# x1 k# W# }! ]# d2 \( K7 y2 I
' u7 ^6 Q5 S3 c9 q; S
openstack image create "Ubuntu1804" \3 j) {. S2 P( a
  --file bionic-server-cloudimg-amd64.img \9 v& R9 g& i9 I6 z7 ]: w! ]
  --disk-format qcow2 --container-format bare \! M  Q" T+ q1 g7 N: g4 f
  --public. R+ A! {; l' b: I. U; E
1! n3 j% Y( U% _" ?. v% w
21 D* s: ?- O2 @* ]
3
9 F# y( Y- r6 f41 R, r2 ]9 B5 G1 m! I7 q$ I5 l4 T. g
按照正常流程创建实例即可,ubuntu镜像默认用户为ubuntu,首次登陆使用sshkey方式,然后执行以下命令即可直接切换到root用户(centos无法使用该方式)
0 A; W7 S. A5 A# D4 V# {: Z; ~& J+ J& z' e9 z- K1 `
$ sudo -i, Y) m( H; g& `2 V' O) I" S* p
1
4 z% U* d1 ?, K% X% f调整集群配置% Y: O: X0 ]/ X8 W/ N- A, Q
集群部署完成后需要开启新的组件或者扩容,可以修改/etc/kolla/global.yml调整参数。
8 h- g5 E0 `1 R6 Z' {或者在/etc/kolla/config目录下创建自定义配置文件,例如
! y* a# N  W5 o" |; w& X% z0 x% k* M1 L
# mkdir -p /etc/kolla/config/nova& [% |, o" ]8 K* Q  {: Z  S4 N

- H7 R/ ]; y' Z9 @1 B4 c& _# vim /etc/kolla/config/nova/nova.conf/ }% t! Y& E& D8 {0 J1 L1 y
[DEFAULT]( H9 ]0 m, W- y# A
block_device_allocate_retries = 300; ^7 {! x! ]  |3 X0 d- [
block_device_allocate_retries_interval = 3
! W& U9 a  W* d6 x" Z1! M$ ^% f# [6 M; J" k) U
2
& v, w9 g2 m( r5 h3
! D5 D5 c% q) G% R" t% j2 K1 P6 _45 O4 N# i" e9 G/ T
5
$ F! c% e- j1 }6
' j. J2 y  S- y! n# W3 w- v$ N, U重新配置openstack,kolla会自动重建配置变动的容器组件。
3 ^0 @3 v1 O9 ~' h+ _! B# n. E" g& D
kolla-ansible -i all-in-one reconfigure -t nova
  X/ H9 m' ~' x) F0 V6 T* j1* ^+ h; T3 l! q* A# s1 H- h( W
kolla配置和日志文件% p) ]& b' K" J
各个组件配置文件目录: /etc/kolla/0 N& q  q& ~' Q  M  a; F
各个组件日志文件目录:/var/log/kolla// r7 P: M- J8 _/ u8 c2 E' N
清理kolla ansilbe集群% s* d" w, @3 l. j( E! C4 G/ h
kolla-ansible destroy --include-images --yes-i-really-really-mean-it
) j) J  ~" u* A" b9 A6 ?' S9 K7 g; L0 i9 g6 Z  \
#或者
* r% I5 k( e, n* ~[root@kolla ~]# cd /usr/share/kolla-ansible/tools/
. f+ O8 J* L$ Z7 R[root@all tools]# ./cleanup-containers* C# P" Q) m% F) ^  W8 O
[root@all tools]# ./cleanup-host
) }0 m) [+ p- _3 Y& W/ t" N2 _; n  a2 A% Q4 I0 k
#重置cinder卷,谨慎操作
' a% d+ M7 H0 dvgremove cinder-volume
3 ^* g' g1 \# F- s7 s7 W————————————————7 q' s* z+ j+ H; f! F
/ Y* L4 ~2 _# Y
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2021-6-20 20:14 , Processed in 0.071354 second(s), 22 queries .

Powered by 龙睿 bbs168x X3.2

© 2001-2020 Comsenz Inc.

快速回复 返回顶部 返回列表