找回密码
 注册
查看: 3415|回复: 1

kolla安装openstack

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-4-18 19:55:20 | 显示全部楼层 |阅读模式
Quick Start
7 f3 w9 Y& R2 O4 n  d: S* l
[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]
' W0 d$ ^" F% q2 r8 B, {  z

- Z* [$ n0 C# z! @0 A" T3 ]THIS PAGE LAST UPDATED: 2020-05-28 20:43:03" `0 y0 {" f) M# K
; ?5 d, J1 g4 x' @
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.

( J6 M1 s5 p7 P5 t, JHost machine requirements
The host machine must satisfy the following minimum requirements:
  • 2 network interfaces
  • 8GB main memory
  • 40GB disk space

    % A4 L& s7 @" X9 ?0 Y& y
See the support matrix for details of supported host Operating Systems.
) j: C+ y# d5 T& f# W
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
    & Q( d$ H0 |3 G4 U, N- x( ~  W
      N% z1 M1 B5 r7 S
  • Install Python build dependencies:
    For CentOS or RHEL 7, run:
    sudo yum install python-devel libffi-devel gcc openssl-devel libselinux-python
    5 r6 A$ Q+ N% M5 i) r6 ~
    ! ^0 o8 \& @5 m; R, v  D! F
    For CentOS or RHEL 8, run:
    sudo dnf install python3-devel libffi-devel gcc openssl-devel python3-libselinux; O2 Z! g: V1 I0 E2 d6 z6 ^

    0 V- s' |8 o7 Y
    For Ubuntu, run:
    sudo apt-get install python-dev libffi-dev gcc libssl-dev python-selinux python-setuptools
    , F' A4 j: g* B2 C: l, _% z+ i" k

    , a. Q( V8 i$ w4 J: }. X7 T
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-virtualenv2 I  @! Z' p: D/ P' B' N3 c
    ( M" \, Z0 _7 h- v4 k: y9 z
    For CentOS or RHEL 8, run:
    sudo dnf install python3-virtualenv
      A/ i0 F# v4 g8 q: b( R0 v* j0 Q7 p  g* t+ x) P# i8 w
    For Ubuntu, run:
    sudo apt-get install python-virtualenv
    ; f' ?5 R' @- Q& f) g7 e- |7 T
    3 `7 T! C- ?! F; W3 S
  • Create a virtual environment and activate it:
    virtualenv /path/to/virtualenvsource /path/to/virtualenv/bin/activate( U! K$ X6 x' ]4 d& R

    1 l$ j6 }4 M+ S2 B' }
    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
    ; t& I2 H1 U6 E; N* y9 f$ |' m: o  M" t' y9 p: X7 f# p
  • Install Ansible. Currently, Kolla Ansible requires Ansible 2.6 to 2.9.
    pip install 'ansible<2.10'# A2 e3 L  C2 ~% ]$ @9 q0 L

    4 T/ {7 @/ q5 C) z" E
    + A4 h1 Z- S) w, j
$ i- ^9 a, d+ v% i- W& f
Install 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
    ) h" J) W0 U3 A) K
    9 g  d4 l) [7 c9 M" r2 {! I; }
    For Ubuntu, run:
    sudo apt-get install python-pip
    0 ~4 d" ^/ y: z7 s8 E8 z
    % k6 P1 v& O7 D
  • Ensure the latest version of pip is installed:
    sudo pip install -U pip* d, S9 z3 G( ]7 j# D$ d% Z
    ! F9 |! n7 n. L& H5 `" e
  • Install Ansible. Currently, Kolla Ansible requires Ansible 2.6 to 2.9.
    For CentOS or RHEL, run:
    sudo yum install ansible
    & S4 W9 |) m) e% |3 q$ \) l) Y* b+ M9 `8 F% C# x  v* a( w
    For Ubuntu, run:
    sudo apt-get install ansible- J' M+ g' w* b4 s

    8 T2 K" i2 q- k) B! ^7 c
  • 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'
    9 g5 @1 w& Z- u& \
    ( S3 p# R! v- x; Y$ @, g
    : u! f: o! a/ S5 T5 _& }& O
, L6 r6 U/ `1 ?2 {, r
9 v  w1 F! l* i- X' f! {3 L) a6 l8 Q
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
    & B; [. Z; P: f9 k" o4 D' X0 y7 I  i7 F7 ]
    If not using a virtual environment:
    sudo pip install kolla-ansible
    ; r! P! m  U0 g9 h1 B$ R& }* ]2 A
    , y- s1 j7 Y% Q8 T7 L0 \5 f
  • Create the /etc/kolla directory.
    sudo mkdir -p /etc/kollasudo chown $USER:$USER /etc/kolla1 g. |8 S  r  U1 e

    ( u& f. Q' E1 V; ^
  • 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/kolla
    4 t$ D3 z. E- B9 y2 R2 g4 w1 ]5 V2 U$ K0 I* d3 Z3 B, I
    If not using a virtual environment on CentOS or RHEL, run:
    cp -r /usr/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
    - ]% R- F! j' D9 U8 P) F  y3 ]9 W3 C5 X5 G, U
    If not using a virtual environment on Ubuntu, run:
    cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
    # J8 J2 X, L. I; i6 L/ [( e, [$ V9 a! R+ K# T, @
  • 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/* .5 S' W  s: B/ A' M; G, r$ Q  j, _1 r

    7 g  R7 _& K) L$ D: q& N
    If not using a virtual environment on CentOS or RHEL, run:
    cp /usr/share/kolla-ansible/ansible/inventory/* .
    ( z6 ]8 d5 o# T+ w; m' ~0 }. M: Z( I) R+ T7 I5 e
    If not using a virtual environment on Ubuntu, run:
    cp /usr/local/share/kolla-ansible/ansible/inventory/* .' F$ b, K2 j" M* S- j. ~" c
    $ R/ q" a8 m$ M: F# ?7 g
    & c/ [  d! c- O" T0 g1 ?- W* o! c
2 x2 o; x" l) X7 t9 l
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
    . x* V  A6 ?/ M! R2 M
    8 i+ Q, h$ _2 A) E
  • Install requirements of kolla and kolla-ansible:
    If using a virtual environment:
    pip install ./kollapip install ./kolla-ansible  R; f* A) D; b5 K: O9 A- B

    : R. n5 P/ Z9 j9 u' q2 n
    If not using a virtual environment:
    sudo pip install ./kollasudo pip install ./kolla-ansible
    & d: p$ H* Y- H* W7 _
    - ]# f0 R9 Q7 s7 T1 c" |: b( H
  • Create the /etc/kolla directory.
    sudo mkdir -p /etc/kollasudo chown $USER:$USER /etc/kolla% g1 L1 h  _5 b3 |. f  f( L2 |: E

    5 J8 J  i5 R; ]8 o  n
  • 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/kolla6 G+ L, R* L& ^5 p% o6 w: y4 N
    ) v8 }1 S2 b; s  {
  • 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/* .! c6 Y( Y9 e& o7 Y+ _2 {6 V
    6 q% X2 ?' w* S1 `

    $ l" t& S) _. H

* N2 @+ ?& P% T. t
6 L4 `/ t6 n! g3 EConfigure 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+ m* O; A% H! D' e* Z% q* t
. |4 j5 D: H/ s' ~# C
Further information on tuning Ansible is available here.
& j" n4 r( c1 A
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
    ! m6 c; G5 K' r; b9 {& A  i0 u# T1 u& X. ^( k
    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
    - m  S0 h1 @. C
    $ r- y* E4 X2 k7 T9 D# E4 h
    4 y, {0 V5 q/ A6 y3 P2 s/ p) l3 a3 M1 m
    Note! v: @9 J5 s! w9 d; ~3 L# K6 W
    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"
    ' @0 Y  X" B5 q, N: g! k/ q# `& T' z
    + P# g# B7 D* y" J4 l( o! ^

% S! |" P2 J  M. o# tKolla 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; b. n9 P: N5 i9 ?2 S3 A
) ?7 A  l7 t: C+ E* b
For development, run:
cd kolla-ansible/tools./generate_passwords.py: g' g6 w4 T, f3 B! {$ S8 x
+ c1 v& n- `: t: f9 V7 L

, a3 T5 P  B& P& U, t* P( `+ E4 aKolla 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

      - Z7 s4 |" \9 I. L, M" |' @
    For newcomers, we recommend to use CentOS 7, CentOS 8 or Ubuntu 18.04.
    kolla_base_distro: "centos"2 B( Z: `" P7 B# b& ?3 w& i

    6 N& X3 K" d) d# D" N. \
    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

    . n6 c( N/ N" d% B% W+ U& Q: x8 X! A3 ~5 H: l2 [
    Note0 F7 Z6 K8 s7 _# g$ y+ }' L/ h' s
    This only affects OpenStack services. Infrastructure services like Ceph are always “binary”.

    9 G! U7 w4 w0 S* }- f9 t$ x, @1 `- ~: b/ H; K9 n
    / F) C( x  N8 _& }& I6 w6 t1 d
    Note! h" T* e8 r; }* ^% q" f
    Source builds are proven to be slightly more reliable than binary.
    7 M4 G  Y& r  g4 b! `. G2 ]# Y
    kolla_install_type: "source"
    + G' m! Q" Z, p# _7 `$ S1 C# T# @) c  B' {& _3 \! ?
  • 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"
    2 \" X! Q, Y0 U& B; Y5 [+ T, Z$ y5 m' Z
    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"
    7 ~1 F  u/ |" v, N( R' g" {' V7 B% _8 A' 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", u, h/ R7 d& K8 t8 s
    , m$ p( A/ i1 {& h& W8 \3 J
  • 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"+ R. E  Y1 M( A: c9 z
    ! V  t- O# Q9 C5 n0 b& Y! g% n/ [
    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.
    - o3 t1 F* Z; C5 G2 C1 M/ ]( t$ r
4 Q8 i# |- w1 V. W2 K
5 ?' O! [5 |2 t7 e
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-servers/ Y) B  |2 D' u

      3 n9 e8 R, W6 h3 w5 z. f
    • Do pre-deployment checks for hosts:
      kolla-ansible -i ./multinode prechecks
      5 W! I( A0 @8 G4 I  p# l5 w% e% q
      5 p5 y# W# z4 `+ m7 p6 L
    • Finally proceed to actual OpenStack deployment:
      kolla-ansible -i ./multinode deploy
      ) Q1 |5 e. t, |+ F* N
      % y" }2 W9 h' `% V2 T
      & d* s% ^" h  z. ^' B, K: O% A
  • For development, run:
    • Bootstrap servers with kolla deploy dependencies:
      cd kolla-ansible/tools./kolla-ansible -i ../../multinode bootstrap-servers" b7 z+ t# r' Y+ [3 y" ?
      " n" j- }- \+ P0 h0 `
    • Do pre-deployment checks for hosts:
      ./kolla-ansible -i ../../multinode prechecks
      + T3 t/ @/ Y; O/ s7 c
      & x' L$ j$ N" K8 H
    • Finally proceed to actual OpenStack deployment:
      ./kolla-ansible -i ../../multinode deploy7 O5 i% {) j+ s7 ?8 R6 j

      4 ]8 P1 w+ V3 `$ w/ \' d: t/ A% r
      + _, h; y# h1 i$ n9 V
    8 ~% c9 O% J0 e% y2 c8 M+ z
When this playbook finishes, OpenStack should be up, running and functional! If error occurs during execution, refer to troubleshooting guide.
! [9 z3 p% t  m# ^
Using OpenStack
  • Install the OpenStack CLI client:
    pip install python-openstackclient- F1 Q* i( P8 u5 x! ^1 C

    " s( S5 @$ E7 }% P. 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+ g( K) @( K: j$ M
      ! Y: F+ |% R4 f( `8 M
    • For development, run:
      cd kolla-ansible/tools./kolla-ansible post-deploy. /etc/kolla/admin-openrc.sh5 j. T. R2 ]9 Y1 q. c7 m
      5 K# q+ `, Y, p- @/ W+ L, w- `

      $ M: s6 K7 m1 F2 u
  • 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; b" }) X9 U, i7 f! y
      ) C' d2 ?1 q- I- L( y# [
      Run init-runonce script on Ubuntu:
      /usr/local/share/kolla-ansible/init-runonce  ^) A# W( x4 C4 A, [! A
      : e2 V: w' K" E0 ~" D2 i" i
    • For development, run:
      kolla-ansible/tools/init-runonce
      ; m7 [1 W3 E9 M3 u8 y& t4 L
      8 X' T4 a! X' b9 f& ]+ K2 B
    • # H8 p  \# M* L* \
      1 m4 n' v- i# A$ I( j

      - i% T8 I- y4 V
    * w0 T/ S5 V- N- j/ _  w

8 [: B* _9 W2 K: V* a, n$ p, g1 c5 F/ E: N6 V+ v  @
! z" {$ e1 r( G9 X- R6 g
1 h" v# r) W4 t7 i
4 l5 B& C, T' ^! X$ M" b
! t% z' w5 s7 |

9 [& N# ^% Z! j2 B

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-4-18 19:59:16 | 显示全部楼层
安装环境准备& e+ o  A# q$ W& j/ t
官方部署文档:# A8 e& W" ]$ m8 w
https://docs.openstack.org/kolla ... ser/quickstart.html" }9 X1 a  X7 {" b

9 G+ k( K- L/ W本次部署train版all-in-one单节点,使用一台centos7.8 minimal节点进行部署,该节点同时作为控制节点、计算节点、网络节点和cinder存储节点使用,同时也是kolla ansible的部署节点。. K: Z3 N4 D; L0 E

% z2 N9 p* A: A0 F( _- h! _5 Ekolla安装节点要求:! q4 z9 C" ^! Y' n: m7 _/ t

, t& u$ h9 w" y. W2 network interfaces/ o1 J3 |' C- g
8GB main memory' X) n6 u+ _+ Q
40GB disk space
# @( {/ h- X( @" `) ?如果是vmware workstation环境,勾选处理器选项的虚拟化引擎相关功能,否则后面需要配置nova_compute_virt_type=qemu参数,这里选择勾选,跳过以下步骤。; J8 J- A$ m, H# g$ I

' a9 F* g& k. Y' q# cat /etc/kolla/globals.yml  f: d4 z% ]' g8 r! u* \5 v5 ~3 w
nova_compute_virt_type: "qemu"
* d2 _; ?1 o0 M( j, n; X9 @, D6 o$ b" \/ R" L" K
#或者部署完成后手动调整
& v! t4 {9 t) d" k8 I4 Y. _% n4 D[root@kolla ~]# cat /etc/kolla/nova-compute/nova.conf |grep virt_type8 S% t/ {1 R6 J* a5 W
#virt_type = kvm
) X0 k- h' n- ~' f' Y7 V; Cvirt_type = qemu
; ]. W6 |" |  W
+ M6 g4 U* }! W[root@kolla ~]# docker restart nova_compute: N$ @( f" `) t
1, A6 Y- j% b1 g3 ?: t7 T
22 _; k2 I3 x. p- F
3
5 N; g* e# {1 R1 I$ R- o4
( C* P1 R* `8 R1 J8 K2 e2 N# Z, M5
0 J# ~6 J7 R2 M* x8 }63 @4 H. \/ P7 ^+ l& r. l$ _8 S% r8 w
7
0 {: }8 J5 }( I7 R2 t+ G8
) }1 T% f: \( h+ K! n9: z$ [: ^7 v  W7 I# s+ N# |. s& x
kolla的安装要求目标机器至少两块网卡,本次安装使用2块网卡对应管理网络和外部网络两个网络平面,在vmware workstation虚拟机新增一块网卡ens37:/ e6 J- y0 L% G. T6 P0 ?

! N! y1 S& a1 |3 B- ^, Mens33,NAT模式,管理网络,正常配置静态IP即可。租户网络与该网络复用,租户vm网络不单独创建网卡
, ^: Q& m# q% l% j6 o6 e0 _/ ?! j8 l- Cens37,桥接模式,外部网络,无需配置IP地址,这个其实是让neutron的br-ex 绑定使用,虚拟机通过这块网卡访问外网。& s3 }; c7 C# `# i$ t9 ^4 w' c
ens37网卡配置参考:3 f, y+ l3 n0 }$ l- C
https://docs.openstack.org/insta ... ing-controller.html) u  Z: h( C& Y7 {$ c: S

9 `+ D) P3 o. L7 H' ^1 Kcat > /etc/sysconfig/network-scripts/ifcfg-ens37 <<EOF, S9 U9 Z* X: e  s, s  i
NAME=ens37/ M; Q- L+ u2 C0 p
DEVICE=ens37# ]& R5 h9 z# k- j" @" c* U
TYPE=Ethernet" U1 z  E" K3 K+ d8 o) n' ]
ONBOOT="yes"
' b3 e1 _5 R1 n( y- n0 }0 i! ]BOOTPROTO="none": o  x5 _, O3 P' y) p
EOF
% t$ S4 \- G& o7 m4 B9 L2 M; m" v! R: @* g( W
#重新加载en37网卡设备6 J9 b9 b5 _" Q, Y7 {
nmcli con reload && nmcli con up ens37, L) `2 Z* p0 X9 d/ H' L# l
1
6 N6 I$ x, d% F2; y* ]: f+ N; f9 i% b
3
% I6 B( ~* U5 o5 v4
9 U! w0 B" A, Q- i5' Y6 e" F2 l3 \. w( l
6( D  i1 g3 ~- u5 {4 q
7. _. w) i3 @# C1 K! t
8& Y5 P, v" W( l1 z1 a! C: E
9
5 Q" Z7 p; b$ Z% r) @10
  Z0 m; T- s6 G; e; t* z! ?如果启用cinder还需要额外添加磁盘,这里以添加一块/dev/sdb磁盘为例,创建为物理卷并加入卷组。+ J' \! s6 h; R. {
, f7 D0 N1 v7 p! Y( Y) W7 N
pvcreate /dev/sdb" W( B, n" P! A" E5 o# k8 c
vgcreate cinder-volumes /dev/sdb
1 G. L6 t" L; z3 o& p16 n7 N. Q$ u' e, [2 N
2
& s# |: Y  l! c. `: B( l注意卷组名称为cinder-volumes,默认与后面的globals.yml中定义一致。
, @' B8 l, p9 Q% j# t+ I) d# p
2 M4 @; |4 N% ]& w. N) g8 B% v[root@kolla ~]# cat /etc/kolla/globals.yml | grep cinder_volume_group
  F' \) d, d6 g' U. e5 o* j#cinder_volume_group: "cinder-volumes"
# h/ H, j* i7 k( d1% e2 D6 {& B: ?/ p3 e4 q
2
  F* A& g8 N7 d  ^* ~) t1 u2 d部署kolla ansible6 o! S$ @( r+ F$ [5 U* S9 H
配置主机名,kolla预检查时rabbitmq可能需要能够进行主机名解析& B# x( K- \  s2 l  g! C4 r* F
& y# `) z: T  @( i1 t' f& e  Z" E
hostnamectl set-hostname kolla, T/ H: R$ u1 Q
1) z" Y, b; v# a7 [: v& G5 R, J8 _8 i
安装依赖
/ {7 e; G3 K+ ^' @8 ]# V) E
5 o; X) z$ D' o5 a! B! Oyum install -y python-devel libffi-devel gcc openssl-devel libselinux-python" W/ H8 D( y" V$ `" S/ U
1
  Y* T1 f" ~4 L* Q安装 Ansible,注意版本,默认2.9应该可以满足要求
7 y0 K# ], u6 @, X! B; }7 |, R% w4 X: y1 |$ e
yum install -y ansible% k6 d4 b5 _" p# X; L. ~4 p
1
3 X9 z9 Z( n+ c配置阿里云pip源,否则pip安装时会很慢
' c! ?/ ?$ Q- L1 W; C. Q. O
7 M: J: D0 ~; g5 a# C2 r- Z* Dmkdir ~/.pip
0 z! r# _. |) R4 J4 r+ Icat > ~/.pip/pip.conf << EOF 0 w( t6 S, t1 L( q# i2 q) [. l# m
[global]
  F; T+ o" z2 K$ [1 L( Gtrusted-host=mirrors.aliyun.com- [( y' n5 t& W
index-url=https://mirrors.aliyun.com/pypi/simple/1 P9 \! L! U0 r  Q6 f
EOF! s/ W2 M* |& k% G6 K) c: ?
1
+ q, H" W: [" h) |, q2/ Z& ^( \2 E& \6 k+ c: E; L, H( ]7 ?
3
! ?. t1 |- @9 d& X& C$ e5 n: P46 ?0 H. X: m+ l
50 P- ?1 _7 F6 X: p- G6 W2 m" C0 g3 p
6
. P1 y! ^% I5 U8 E& Q1 h6 S5 X安装 kolla-ansible
/ v  k" r- [/ h6 q: c
) }+ `. ^  P  M3 |; Y4 n3 v' p7 Xkolla版本与openstack版本对应关系:https://releases.openstack.org/teams/kolla.html
9 T  ]! S" H  I  N7 g
, u" s, j! L# p8 Hyum install -y epel-release
5 y# m! A$ c$ b7 o: jyum install -y python-pip, u  Y5 T% t9 K/ p' \1 {% }2 H$ {6 f
pip install -U pip
  l9 V7 p1 _+ v' Q: q$ F7 `pip install kolla-ansible==9.1.0 --ignore-installed PyYAML
0 Q( l! {( V0 \+ @1
, _9 C% P. Y7 O. W2
* C% {0 T( W1 ]" @/ F5 Z/ ]3 [34 I) ^) v( n0 Q% W
4
* X8 ^- ~1 L6 H复制 kolla-ansible配置文件到当前环境
' P! k, e" |% G* d; h3 C% r, X. w( J1 \1 x
mkdir -p /etc/kolla7 p9 n" Q2 ^! e
chown $USER:$USER /etc/kolla/ r) U) a7 {$ M' S* E
8 x; y3 }. \. Q2 v8 }
##Copy globals.yml and passwords.yml' Q6 C1 x* w1 i1 o
cp -r /usr/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
/ O" g7 m1 |7 `6 V) n; D. T# Q  d' y+ B, X4 N6 U4 t
##Copy all-in-one and multinode inventory files
. T( \9 I+ [8 F) y/ u7 f' [3 wcp /usr/share/kolla-ansible/ansible/inventory/* .1 _% K0 K5 t$ J7 z6 Z2 S
1% Z4 G0 W6 M% `
2
7 l1 [2 e: ?7 y+ n/ z3
5 y2 h5 H( ^) E8 p3 H4  |" n1 f' m( A
5
. e* r/ Z" x  i+ A6' p# M& \: K2 M) I1 x% V
7
- Y* K4 i' ?9 U3 P8
8 z/ {$ X  ?9 U# Y6 N* H. H修改ansible配置文件
5 E8 w8 L$ \5 K, I( {
  K+ s; c% p, H1 ^6 a" D% Z- q$ Tcat << EOF | sed -i '/^\[defaults\]$/ r /dev/stdin' /etc/ansible/ansible.cfg
- t2 S4 x: b) X7 i5 c  Vhost_key_checking=False( A. x0 I* b- L( l3 h- s! ]
pipelining=True
- U) M8 c3 E$ v7 [forks=100
0 h7 i& _& C% t+ s$ kEOF
2 r, ^, Y- m3 a5 s1 @1
" w0 @& d( {! J, v1 A2
+ M0 Q/ W" o* I$ c' J3/ y" H/ {# ^" B, f) ^& b0 O
4
! v+ s4 a# @  ~5 _2 X5, K$ \' z/ ?, u* d7 E
默认有all-in-one和multinode两个inventory文件,这里使用all-in-one,来规划集群角色,配置默认即可
+ b# q: G- }- H3 h3 h- m& E) F
3 K  z" g) O2 g( Y[root@kolla ~]# cat all-in-one | more+ h: U0 h. q$ V2 J* A3 W4 p
# These initial groups are the only groups required to be modified. The
" c+ d/ \; O( E  l# additional groups are for more control of the environment.+ t0 w! Z6 G7 N( k! Q
[control]
: Q- H, J5 O7 z, I% wlocalhost       ansible_connection=local0 r9 W4 g# {6 y2 `
  ^' R- y, [  y8 s
[network]1 n/ k, E, ?2 Q8 U/ E. H- z' F
localhost       ansible_connection=local/ @+ ?( `* d$ t6 _/ O0 r
0 A( ^6 s& n- E# k) h1 Y. S5 B8 U! l
[compute]
, E  e, u3 T* g0 V/ o% [7 Q0 y; Z. elocalhost       ansible_connection=local
. e/ N* T$ S+ R6 {! M' }
: D2 b6 o  s% ^4 F* d7 K( H7 R/ ?[storage]
# ^; g" K3 ~2 p3 g  Mlocalhost       ansible_connection=local
4 {0 ?8 M  F" K$ z" g
/ R9 F2 O7 E! O: P. v4 V[monitoring]$ B9 K! @& ^1 x* O
localhost       ansible_connection=local. C9 o3 ?& m1 E- r7 o* \3 q
& g+ o) [: M  l
[deployment]7 N( `; Z! ?$ I- B: z% u# a1 Q
localhost       ansible_connection=local
# x! W8 C  z! w6 e% |4 q7 y- X...
% G* |& a$ h0 Z2 \1
" h& i8 f% K; b6 e3 r- t" x2
4 [- Y5 H8 |- }2 H3 i& s5 E3
; j6 b" i  D/ X! Z6 k# F! ]( r4
) X/ R0 q, n2 B% {- ~6 t' h50 Q8 u' A: w. U+ @
64 A1 {5 E; [8 a6 g$ ?1 m
75 u6 ?* w$ E; y! N; D: z
8
* f8 H) A6 k& P9- B" [* Q6 g* |1 a: h- \3 |
10$ \4 ?+ O: C0 S2 {6 p4 [
11
* c# P8 B! s$ [* x5 r12) m3 k: J+ E& J( L2 Q& O( u8 P8 y7 e/ }4 M
13
2 ^/ d7 t% x7 `; U14
6 h0 G0 D0 Y8 h+ C+ ?) r- P15
; M4 C$ A% B) ^' U0 p% T16
4 u5 Q/ G) C! L4 m# ?; L3 U17: d+ [) }1 b$ ]( l. ~
18- \: ?6 H4 u" m9 K0 y; R) w, Q
19: P+ V' H1 F  ~# J" j' x) b. p
20
; F/ ?$ j" i: W21
1 c/ {' O! [2 B" U: V检查inventory配置是否正确,执行:( ~5 o0 q  W" M( M$ b

0 d+ A* A/ M' kansible -i all-in-one all -m ping
) a6 Q/ Q$ c7 ]9 }1
* w. P* k( j7 l# x, U: @生成openstack组件用到的密码,该操作会填充/etc/kolla/passwords.yml,该文件中默认参数为空。
, o# p! Q" G$ k8 m: V6 r
( b& ~. f" R- H  g1 ?  X2 n9 nkolla-genpwd
8 |5 j1 i! i  Z# U0 F' d* `' ]9 K4 X% y1/ `0 P0 T3 `6 E: T
修改keystone_admin_password,可以修改为自定义的密码方便后续horizon登录,这里改为kolla。
: E0 k: e! i, Z, ?2 l4 n" O: M( |* K
$ sed -i 's#keystone_admin_password:.*#keystone_admin_password: kolla#g' /etc/kolla/passwords.yml
6 o2 |" T' o$ ~+ b" k4 q5 ?8 ~
6 r0 _; z% u( ^$ `, Z! B$ cat /etc/kolla/passwords.yml | grep keystone_admin_password
$ S3 C4 N# [5 E  Kkeystone_admin_password: kolla
& G4 \; s7 M3 H# l1 F6 S1; b, G, C/ {+ N' y  h
2
& M! {! T* y0 l* q0 T3
0 A- f/ H& {$ n: u4
( @2 r" w0 Z. t5 p+ K8 X6 w" X修改全局配置文件globals.yml,该文件用来控制安装哪些组件,以及如何配置组件,由于全部是注释,这里直接追加进去,也可以逐个找到对应项进行修改。
1 ?. h/ Y! h  _2 {) A3 c; N( R& c6 y; b+ X
cp /etc/kolla/globals.yml{,.bak}/ Y* @$ d) ?+ ^, p! W# t+ Y4 T9 c; |

' t- O: O  O: ]% y" l0 n$ ucat >> /etc/kolla/globals.yml <<EOF# }( ~; N  ~: {$ e5 u. h3 F2 h
5 R- ^% |: h+ o+ j. }0 @- o0 r
# Kolla options: e3 ?: p. Q5 H
kolla_base_distro: "centos"
4 L, m" H, l5 @4 P# K' Q8 ]kolla_install_type: "binary"
0 R' K' E. ~' d) M6 k. Popenstack_release: "train"
) z$ r" e1 J* p# W# Z: r/ K. okolla_internal_vip_address: "192.168.93.200"& ]) g% ~9 l2 N( x. J2 ]' {6 J

( Y  r4 A5 ]4 h+ e1 Z1 v% H' G1 s# Docker options
' d  V- N2 e% H0 H5 Bdocker_registry: "registry.cn-shenzhen.aliyuncs.com"
+ ~2 D' \7 m7 y1 X5 G% Sdocker_namespace: "kollaimage"# K; @, m! A1 f

+ c% B- s6 u/ w0 I: H+ p8 S# Neutron - Networking Options# E- }! }9 P$ n+ n/ E) x4 b
network_interface: "ens33"
8 R9 a$ ^, K& E/ a* B% pneutron_external_interface: "ens37"  l* I+ v" n+ e9 h8 c, R3 o
neutron_plugin_agent: "openvswitch"
9 ~' g. V# _  Genable_neutron_provider_networks: "yes"! O5 T5 l- H; m; J

+ b" c' J2 ~% m" E# OpenStack services( J/ p6 n9 R+ G& |
enable_cinder: "yes"
% e, k- s" R+ e" \9 U$ Venable_cinder_backend_lvm: "yes"9 h: x5 _1 Y, @  c  c! q
EOF3 z6 x! N/ K4 q% Z
1$ Z& r0 b5 Y  ^9 M7 K6 S
2, Y  g& s- o& Z" y" g
3
" h( \1 O, y: `* V# _# m4; U! h% z- X$ O9 S
5
/ J. Q8 T7 w3 j! M% i, l7 U60 S# h" }' P( j! M7 m4 g
7: I$ M3 @! b1 C6 @' v' K
8
/ U/ Y2 s6 u: I; @9
2 u: [; b1 i  \5 I10
: _' t8 p+ {' H8 l6 y$ t11
, n1 ^9 X% x/ ?8 u4 t3 N1 n% ]12. V2 h$ b" _7 s# S
13' w: @9 Y( Y, R2 r5 N
14+ y! @7 S2 h% a% x/ p% N) p* C( M5 P5 K
15- _% I& m+ k* g/ M% Q3 V" D+ l
16, A4 c! p  @! M- q2 t. W5 e) x7 Y! ^
17
0 P: T, h2 T2 ]1 c; w18
  a. j$ c' [: e7 v' L6 ~19' J* ]( E, v  t
208 E) C' n% n) G5 r& \; m
21; s$ m" m- a0 Y; u. G8 E) l* `5 b
22
* j: @. U+ l+ p; @: h23  ~! Q% Z0 {! {: S) \
24
% l# }, M) d' e. y& o1 J% P& i参数说明:
7 Y! T) d8 ~; c! j- Z7 p
3 o/ r* ~2 H) l% [( L. U$ ykolla_base_distro: kolla镜像基于不同linux发型版构建,主机使用centos这里对应使用centos类型的docker镜像即可。
8 U- h5 [3 ~/ S3 P7 S( q' bkolla_install_type: kolla镜像基于binary二进制和source源码两种类型构建,实际部署使用binary即可。) f5 L. J2 }3 l) b- C' ~
openstack_release: openstack版本可自定义,会从dockerhub拉取对应版本的镜像
0 J# C+ F  P/ ]7 v9 f+ r6 K+ ^kolla_internal_vip_address: 单节点部署kolla也会启用haproxy和keepalived,方便后续扩容为高可用集群,该地址是ens33网卡网络中的一个可用IP。) t5 ?! K. I% B1 K; K( |
docker_registry: 默认从dockerhub拉取镜像,这里使用阿里云镜像仓库,也可以本地搭建仓库,提前推送镜像上去。但该仓库目前只有train和ussuri版本的镜像,如何自己推送镜像参考该博客的其他文章。# W1 |" N2 v7 G4 E$ d; T; K" t: H. q, r
docker_namespace: 阿里云kolla镜像仓库所在的命名空间,dockerhub官网默认是kolla。
: Y$ Y- b0 I) o0 l8 c. mnetwork_interface: 管理网络的网卡
! l: z. a/ S, x1 jneutron_external_interface: 外部网络的网卡( g  v, h" j5 x- a: t: Z4 x
neutron_plugin_agent: 默认启用openvswitch# f/ G' C$ [' O2 D8 @/ {
enable_neutron_provider_networks: 启用外部网络
1 Z$ T. m. q7 p5 y  ]$ Wenable_cinder: 启用cinder
0 E' O% F) Y6 s# Yenable_cinder_backend_lvm: 指定cinder后端存储为lvm
' }' }! l/ N3 i: p' p$ S+ {! m修改docker官方yum源为阿里云yum源,另外配置docker镜像加速,指定使用阿里云镜像加速。
0 X+ l+ h" B0 z( r
% E. F" K( v& S2 D3 `. qsed -i 's/^docker_yum_url/#&/' /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml+ o0 n1 x: f% N; Q( q
sed -i 's/^docker_custom_config/#&/' /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml3 x* v2 T$ ?! w5 |* R$ N
( D+ X) M6 ~4 t' Z' L
cat >> /usr/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml <<EOF- P4 W: r9 f) i' Y+ T1 u
docker_yum_url: "https://mirrors.aliyun.com/docker-ce/linux/{{ ansible_distribution | lower }}"
" h1 c0 C3 h, R: k! R3 r4 |) Vdocker_custom_config: {"registry-mirrors": ["https://uyah70su.mirror.aliyuncs.com"]}
* x, d9 W7 \. f9 \7 l% g9 ~EOF& s% ?- k# H' v& y
1
' ]2 v6 Q3 L  K2
6 c( G. t, K7 |, c5 W3
$ s& K  Y$ t! b" }& Z( j( F# o4, d' {% r/ R6 c! f$ \6 |. v# W
5
9 R- R, G; ?0 }* G; T& e6
( ^' |  N2 C( }4 |3 D9 y( y0 f7
" |6 t2 u( Z! {部署openstack组件: Y1 V# t$ z4 [; R* \
部署openstack
5 \( B% ?' Y! ~# o$ E# H# A8 h. S* M) M
#预配置,安装docker、docker sdk、关闭防火墙、配置时间同步等
$ [1 r2 H3 A1 d! k4 Z" K* kkolla-ansible -i ./all-in-one bootstrap-servers
0 D2 E3 Z( a9 m3 `" x
! N. q) K. l' P8 s5 P6 r, T4 X( e#部署前环境检查/ c6 P. Y$ w6 A  a; t' p, K
kolla-ansible -i ./all-in-one prechecks# k& E: {5 }5 v- `

* S. {* i+ @4 v#拉取镜像,也可省略该步骤,默认会自动拉取
2 F0 P5 ]0 A% g6 x; y; Qkolla-ansible -i ./all-in-one pull8 C% b( d2 U) _' l! h8 n/ x

) C0 T3 U4 ^1 W. S) A; @! \#执行实际部署,拉取镜像,运行对应组件容器
: s: N2 {7 ^. Z; B( _6 ckolla-ansible -i ./all-in-one deploy
. m( e+ i$ ^6 I, C1 H* t1 j; U% r# G
! g3 i9 ]' L: m" j( |. M#生成openrc文件1 x* R6 ]; P7 D, y+ H- ]
kolla-ansible post-deploy
$ {1 t+ p) l# ]6 |$ q16 O2 M& _/ V' X8 t8 K6 o# F
2
1 x* F" D5 n! H7 R0 T9 ?7 I5 C3+ \9 B/ m" u. N. R$ O) `. W. F* X6 U
4
1 y- L; l! s2 @# A5! \; A* n/ U7 ?; I- W* {  Z
69 f* I1 S4 M+ b3 z& k
7
9 U' F& o- w- L8
9 ?5 L. b& M5 s( }9
2 N- `, {) n+ K5 D: H6 M* t5 a10
- e2 l0 C$ ]5 R3 b: d$ R11+ M7 X" _' Q0 W1 E, Q0 C9 U
12
/ @9 W) }( ^. z13* f# I$ P$ H3 z
143 A, G$ A8 V7 x; F
以上部署没有报错中断说明部署成功,所有openstack组件以容器方式运行,查看容器/ K; z! S, n9 n/ F5 D0 l+ h1 u" R
# H5 I8 I2 a* D
[root@kolla ~]# docker ps -a4 P8 K) C8 c5 h* N4 V
CONTAINER ID        IMAGE                                                                                        COMMAND                  CREATED             STATUS              PORTS               NAMES
% l& F/ d: t( C/ G+ f325c17a52c79        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-chrony:train                      "dumb-init --single-…"   36 hours ago        Up 25 hours                             chrony" d/ x6 U1 T2 g4 K/ F3 V
6218d98755ee        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cron:train                        "dumb-init --single-…"   36 hours ago        Up 25 hours                             cron6 m2 D% j0 T1 |; _1 [+ g
02b6598c1089        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-kolla-toolbox:train               "dumb-init --single-…"   36 hours ago        Up 25 hours                             kolla_toolbox
4 E0 i8 q/ t: ?/ `( ^! x# t2 f8572e445abad        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-fluentd:train                     "dumb-init --single-…"   36 hours ago        Up 25 hours                             fluentd
8 r7 @6 u9 H! n5 E& y  a% Ff11a103c5ade        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             client1 V/ j' O) x) p7 o% e
5c91def3c963        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-horizon:train                     "dumb-init --single-…"   44 hours ago        Up 25 hours                             horizon
/ H2 E6 }' [  [" \& fe024bd4f5dd3        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-engine:train                 "dumb-init --single-…"   44 hours ago        Up 25 hours                             heat_engine
' u( O2 Y5 p$ g% D  N, G2d1491bd9e1a        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api-cfn:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             heat_api_cfn9 V* t! B+ O& i% m5 _, y+ |
eeefcfb31a61        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             heat_api+ K0 t0 i' O2 l. [8 h
9b51b53448fc        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-metadata-agent:train      "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_metadata_agent6 A3 T5 r% j( M
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
9 _4 [" L" M- V" a! 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) E5 }( ~# ?6 i* ]9 S, s8 r. P
959f6faba972        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-openvswitch-agent:train   "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_openvswitch_agent
% T- \3 z' H8 y: K( q, h5 z% Ucc1b081cf876        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-server:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             neutron_server1 S6 g8 J# K7 L1 M0 J( X
eea1a87feb43        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-vswitchd:train        "dumb-init --single-…"   44 hours ago        Up 25 hours                             openvswitch_vswitchd
8 u3 |6 C# ]. ^* u376f81bf75a2        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-db-server:train       "dumb-init --single-…"   44 hours ago        Up 25 hours                             openvswitch_db. A5 g- R1 q$ d5 s
c68fd9a92d73        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-compute:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_compute8 \8 ]8 ~( Q' q( H4 Q
2492e2a32c80        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-libvirt:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_libvirt, B' W8 M5 ]  k
3802d199b29f        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-ssh:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_ssh
7 F4 m+ Y7 W# _$ j) Z, ?1281c311ecd4        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-novncproxy:train             "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_novncproxy* c6 D& s* e3 P! j
2e8c8478116b        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-conductor:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_conductor
6 q. `! ~" b7 E! t. W950feb59b549        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-api:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_api
) i7 O( u* a' ]8 v" l49497e664922        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-scheduler:train              "dumb-init --single-…"   44 hours ago        Up 25 hours                             nova_scheduler% x/ P  F! e3 G4 G6 N
f5eb37b48f7d        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-placement-api:train               "dumb-init --single-…"   44 hours ago        Up 25 hours                             placement_api
3 C% h' U# y7 a54cd0e3be101        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-backup:train               "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_backup
% y! _8 ^# U* ~# Ub4efa4449e7f        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-volume:train               "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_volume( f" n  `0 c3 c3 v
159b669d2fd3        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-scheduler:train            "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_scheduler0 Q) R" p2 S2 P
9fc7e6a4cb25        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-api:train                  "dumb-init --single-…"   44 hours ago        Up 25 hours                             cinder_api
5 x. t+ u4 `( \7 Qb3f8f711f2b1        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-glance-api:train                  "dumb-init --single-…"   44 hours ago        Up 25 hours                             glance_api; G+ L: i- b1 D& ^) q1 J, Q% @" S: R
760e92d698e2        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-fernet:train             "dumb-init --single-…"   44 hours ago        Up 25 hours                             keystone_fernet
0 M1 i; I6 z( E# X' o95f235c4ac10        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-ssh:train                "dumb-init --single-…"   44 hours ago        Up 25 hours                             keystone_ssh1 S. V: Y- Y. ]. }4 f5 z
03306334ce19        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             keystone
3 X8 a" ?; H$ |0 N$ u; V6 y/ h9 }5173d4191567        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-rabbitmq:train                    "dumb-init --single-…"   44 hours ago        Up 25 hours                             rabbitmq. d& h7 w3 l0 t3 k1 a
eb6bca26f6ce        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-tgtd:train                        "dumb-init --single-…"   44 hours ago        Up 25 hours                             tgtd
& u9 u7 H) b7 L8 `& m6 k79fac2ca1b19        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-iscsid:train                      "dumb-init --single-…"   44 hours ago        Up 25 hours                             iscsid
0 G- c% b9 h5 T+ F2 B4a3fcefc7009        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-memcached:train                   "dumb-init --single-…"   44 hours ago        Up 25 hours                             memcached
8 Y: Q: K/ }, m+ Q0773eaf446e4        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-mariadb:train                     "dumb-init -- kolla_…"   44 hours ago        Up 25 hours                             mariadb# |  p% d9 j3 P7 A
77f0beaa28e5        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keepalived:train                  "dumb-init --single-…"   44 hours ago        Up 25 hours                             keepalived- u/ K9 N  p. O: t, ?2 [
b02b744d2da3        registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-haproxy:train                     "dumb-init --single-…"   44 hours ago        Up 25 hours                             haproxy
& t9 j5 z, s8 L: X/ ^$ e; y5 ~' W0 M1
% x3 n  Y1 u  E/ v2 V8 @' f2. x& A; j" ^) \# F$ \8 M
33 l7 o1 D+ x4 g
4
- C* a0 ^  \3 s5
, S8 f7 e$ ?& O& _* J$ o6
$ e7 ]. N$ Z% M* U" P* m7# g( \! C9 P) x6 ?; p
8, D3 W8 X6 ^2 I! p
9, c0 W& S2 s- X0 L5 c, ~2 y
10& v  j# O8 Q5 D6 h4 l0 n
11) d+ K) \8 o. M. }6 g" ^
12
' _* N. z1 I" i' j7 m4 f13
8 U' ~" {8 Q8 t$ k5 P: N142 r2 ], j2 h! @, K! Q+ O! ^% m
150 E2 R6 ~0 L; G$ R0 u
16+ y5 x0 B2 Z! C& a) _$ x
17, J# k% A4 f4 s+ B
181 r7 A+ w$ y  g/ v8 k9 F
190 |7 k, B$ o/ _( W5 E
20
' s: v0 b2 {- l218 W. ]5 f, z2 s9 h7 w
22
% h# k; L: H& d  D$ A1 T6 p23
, y6 x) Q7 k) [* c24
- Z7 q( V. x/ I2 D' {! B' e252 @, q, Q9 V% r6 R9 u0 p/ G0 V
26; i. Z0 D4 [4 l% p$ F
27
9 }5 K2 r( ]3 _282 G! {0 d5 N1 I' q9 t! X7 ]7 u" d
29
) j; J3 c. Y. v( G30
% [. q, E; |1 [% B31+ ~; {7 C6 q" S& o; e7 a
32
1 I1 p; n5 A# Q* J- K33
6 T& {% M6 Q0 w  @34
! P' w+ d+ x6 d) H35
" [# D# Z; J, z- e36
# d! U& c% [/ @6 X1 d37
) e$ S" [. p# o38
4 c* D+ L: P# o. U, E39, \: H' |7 n) d. x$ F) b1 H
40/ ^+ e& Z: r" y% U: m
41
: u* R5 Y: v1 Z- I确认没有Exited等异常状态的容器
9 {6 l& V/ e) Q, i  F7 y8 Q; H3 R3 A4 a; A6 S3 J- y. V
[root@kolla ~]# docker ps -a  | grep -v Up
% m" @8 T2 c; k/ x7 m12 R) I. d' o& f( c
本次部署运行了39个容器
" O9 k9 C% v; T6 \8 d8 U  @* {8 A6 X: s; r1 O3 U  G
[root@localhost kolla-env]# docker ps -a | wc -l/ w( |* u; {; `: U: W$ }1 A  _. [/ `
390 ~8 E9 E* c7 Q$ ?0 K. |8 v
1& a0 A: Z* c0 ~* F! `
2
" a! C" g  a+ w% m# @, E+ z查看拉取的镜像,发现镜像数量与容器数量是一致的。
( q6 E. S' d4 x- Z$ [9 p; K$ b1 {: K: U0 b2 S* N% L
[root@kolla ~]# docker images' k. e& C( U% i) n3 S
REPOSITORY                                                                             TAG                 IMAGE ID            CREATED             SIZE8 j" T# A% d. u! c6 F
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-glance-api                  train               aec757c5908a        2 days ago          1.05GB4 V' ]) `9 H3 D/ d' b
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-ssh                train               2c95619322ed        2 days ago          1.04GB
: N3 c" b, S/ O  |3 wregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone-fernet             train               918564aa9c01        2 days ago          1.04GB3 y( `- y+ a' w& h+ t, b, \& {8 _
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keystone                    train               8d5f3ca2a73c        2 days ago          1.04GB
% O" q8 J' `9 U; xregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-api                  train               500910236e85        2 days ago          1.19GB
( _, c7 v5 u% `0 eregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-volume               train               f76ebe1e133d        2 days ago          1.14GB4 g; S' v2 h( L" w1 |( V  P; c8 X
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-backup               train               19342786a92c        2 days ago          1.13GB; d& N: D/ e' Z. A5 M. I
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cinder-scheduler            train               920630f0ea6c        2 days ago          1.11GB$ ?0 Y4 [) R3 T) N
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api                    train               517f6a0643ee        2 days ago          1.07GB
5 h8 C5 }. ?0 X" n+ i/ p3 C  C- Tregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-api-cfn                train               2d46b91d44ef        2 days ago          1.07GB3 N' O) h( g8 W# `6 _, U
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-heat-engine                 train               ab570c135dbc        2 days ago          1.07GB
7 y2 ~% n7 P1 p9 vregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-horizon                     train               a00ddb359ea5        2 days ago          1.2GB3 l5 c/ @* M4 m1 M/ e2 r
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-fluentd                     train               6a5b7be2551b        2 days ago          697MB( N- Z0 S0 H% r& B" e
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-cron                        train               0f784cd532e2        2 days ago          408MB
; K( [) T$ _, E0 Bregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-chrony                      train               374dabc62868        2 days ago          408MB
, K" I, K* S; a. X$ lregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-iscsid                      train               575873f9e4b8        2 days ago          413MB
$ N( B( T* H' N6 o" X6 ]2 @8 p- [registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-haproxy                     train               9cf840548535        2 days ago          433MB' w4 N6 h# s/ e1 a; U& I; U) y5 z8 o) u
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-keepalived                  train               b2a20ccd7d6a        2 days ago          414MB
9 P- n" P' x) c( S. C7 l$ ^registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base              train               c35001fb182b        3 days ago          920MB& a) r$ Q" y$ V- t$ E0 v
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-compute                train               93be43a73a3e        5 days ago          1.85GB
: s4 c# u8 q- C# P9 x, C3 uregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-placement-api               train               26f8c88c3c50        5 days ago          1.05GB: u) Y' g- q! l( C
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-api                    train               2a9d3ea95254        5 days ago          1.08GB- D9 y; {8 @% y7 \
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-novncproxy             train               e6acfbe47b2b        5 days ago          1.05GB
- `, }: J: {$ K: Y  O. Kregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-conductor              train               836a9f775263        5 days ago          1.05GB
3 u6 \2 c: K2 u9 C* r0 L0 f) N  Sregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-ssh                    train               f89a813f3902        5 days ago          1.05GB9 z0 E  R- ?" B" |8 b% Y
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-scheduler              train               8061eaa33d21        5 days ago          1.05GB
! ^3 f" g0 ~: v7 W) E" ]registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-vswitchd        train               2b780c8075c6        5 days ago          425MB4 z. z. q( ~" ?* J0 l
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openvswitch-db-server       train               86168147b086        5 days ago          425MB
7 n% z+ i( o+ X" C8 B) yregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-rabbitmq                    train               19cd34b4f503        5 days ago          487MB
0 c- J2 }0 H, u) F. `+ B0 I! R- Q: `registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-mariadb                     train               882472a192b5        6 days ago          593MB
+ A3 N1 t. s9 o  U) `* j! Jregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-dhcp-agent          train               a007b53f0507        7 days ago          1.04GB
0 X. w7 g9 T) h, X! d" Kregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-metadata-agent      train               8bcff22221bd        7 days ago          1.04GB- A" M3 ]' h6 B* {" y% e
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-nova-libvirt                train               539673da5c25        7 days ago          1.25GB- ~3 |' D: ?- w
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-kolla-toolbox               train               a18a474c65ea        7 days ago          842MB
4 g+ ?7 z' K5 [  I" {$ C# u9 cregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-tgtd                        train               ad5380187ca9        7 days ago          383MB
7 I5 P! n4 ~8 t8 ?registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-memcached                   train               1fcf18645254        7 days ago          408MB+ e: g) y6 @& K( o) L9 B# d" l
registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-server              train               539cfb7c1fd2        8 days ago          1.08GB
6 h/ o' i! t; C8 W9 v0 aregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-openvswitch-agent   train               95113c0f5b8c        8 days ago          1.08GB
' ]  B* }) Y7 [5 T9 ?0 |. T0 e6 Jregistry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-neutron-l3-agent            train               fbe9385f49ca        8 days ago          1.08GB8 j8 n5 m1 g, E9 b9 v. `6 N
1& i; y, q0 g' ?, @
2- u  L$ m  B+ Q8 p) a9 N& t
36 f- z  F- E( r/ y6 }
4# r$ V5 j' _/ s; X7 C, u9 V1 ?
5
& R8 N! V5 i; A: G3 w& Q61 P% K7 l, L' z7 L0 F$ b2 W7 S0 t
7
9 ^- q* B# c  e1 t# D3 |8$ j- t( U5 s( X/ d7 H/ V6 v
9
! p9 {( H+ ?; b. ^4 m2 v10
( o$ H% P* H( K0 x! t' {: ~11
9 F1 M+ i: T) _; M& w0 J+ f12+ J, `" T) g4 Y% u& K0 r1 r* S: p- l
13: O6 r4 a! v/ M1 F1 {/ k2 Y
14
% g9 {6 Z' @1 ~& S1 G2 Y15! j& R+ d& P/ T$ q6 g
16
  q( G3 k" z, r  G* P! [17- b/ x* ?# Z" {8 N
18
% \6 |5 M) L* s8 ~19
. G/ {9 l- h5 `3 `) d6 x20
6 L- R" F* {7 Z2 f# Z215 G/ C6 Z% ?4 O' H$ N' [, L
22
' c! A/ P+ m$ r! R5 y232 X& v9 N* K5 [4 }5 _! |. i! w) E
24
! |+ q2 n& T4 u* ~9 T: t25+ H) I2 Z; V) N
26
# \7 x8 A3 A: S9 }* h" l27
# a7 m# F0 q. {- X7 a28) P0 c' k, A/ w. I2 `& N
29, f! I: F. |6 {% j0 d+ P$ }
308 I' }2 s' F1 d& t: b; h; {; A' S8 \
31& V3 l* X0 o: t% F, |. H
321 Q* t+ n) e% I9 [9 U$ k6 j
338 f+ B+ b; I6 X& f9 F3 a3 {8 q
34
9 x7 ]% [4 b% N" E& X$ A  v: ^35
' G$ N4 y% O! |$ v  Y7 M1 d3 w+ `36
4 D7 J5 J/ F6 e37: J) k' a" v, V' x% ?( \$ [5 e
38
' I0 l* d$ T% x2 V5 k' H4 p. c; L1 i& z. m39- l" O# M0 G2 c0 m6 j( l  f8 g
404 F. p3 G7 }+ W; }. R8 G
41
* ?0 P% O- r1 z4 D4 _  Z, r- R查看cinder使用的卷,自动创建了lvm
# K- z8 n7 [2 F. [
3 S9 N3 O4 a& `[root@kolla ~]# lsblk | grep cinder; I  p9 Y* @7 C7 ]6 [* h% ^
├─cinder--volumes-cinder--volumes--pool_tmeta 253:3    0   20M  0 lvm  
9 `5 N# J8 Y2 H% I│ └─cinder--volumes-cinder--volumes--pool     253:5    0   19G  0 lvm  
4 W. {! r( F$ \/ l$ O# H└─cinder--volumes-cinder--volumes--pool_tdata 253:4    0   19G  0 lvm  
6 I$ u! e' l0 R9 C; T$ M  └─cinder--volumes-cinder--volumes--pool     253:5    0   19G  0 lvm  
6 |  F  a# q3 ~  u+ g
( I& I& K0 O* D# L4 t[root@kolla ~]# lvs | grep cinder
5 `6 v0 e: I) }& R- L- Z  cinder-volumes-pool cinder-volumes twi-a-tz--  19.00g             0.00   10.55
7 H( x) {. [6 ]1
3 v+ U  Y' R+ _  R  x: {4 T2
9 _* |$ j/ p9 M' N9 k3. m( D0 {6 {  X$ M* h
4
; D. a0 d/ G7 ~2 k5
- H3 x* F$ @3 k0 @3 Q6
/ P3 `3 b% ^3 k8 K) c7
$ E5 K- T, w9 r. ~+ a" r+ f' S8
% ?% f' I) v" x1 i8 C+ N& t查看网卡状态! [* q1 |: {, }& L' \3 Q
8 q! U7 Z& R+ [5 A9 b* T
[root@kolla ~]# ip a
( C. b4 g0 v0 t1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
* L, K5 `# _) c3 B' |    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
. Z8 o# v- |1 V5 E" w6 @    inet 127.0.0.1/8 scope host lo
9 R: e* R2 o2 f* V8 i7 v       valid_lft forever preferred_lft forever
9 D* T9 `" @+ `    inet6 ::1/128 scope host % K  R3 I) V% l- U
       valid_lft forever preferred_lft forever, n# [$ K9 G" _3 j! \
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000+ H: c' N* D1 Z4 L+ ^8 f# z
    link/ether 00:0c:29:0c:4e:fe brd ff:ff:ff:ff:ff:ff4 \, u+ S& |5 K+ K- ~4 j
    inet 192.168.93.30/24 brd 192.168.93.255 scope global noprefixroute ens33
; C6 @7 C2 K# v9 m* n  L9 r       valid_lft forever preferred_lft forever# ]9 }- Z1 {8 l: [' M) \3 t
    inet 192.168.93.100/32 scope global ens33
6 f4 I4 k. _. Q% p: b% T       valid_lft forever preferred_lft forever9 V! g, o9 V7 u4 C( Z7 A1 X$ @3 G
    inet6 fe80::7a6c:d06c:ee49:4cd5/64 scope link noprefixroute * T4 \* ?( z* _2 F
       valid_lft forever preferred_lft forever
2 b! a2 m- W; A& l5 w3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000! u- {5 Z, {; p4 Y( o
    link/ether 00:0c:29:0c:4e:08 brd ff:ff:ff:ff:ff:ff
4 H7 k$ n* I4 }; d    inet6 fe80::20c:29ff:fe0c:4e08/64 scope link
: b" J0 A5 }6 \& P: }$ w) p* V       valid_lft forever preferred_lft forever
) j0 }2 G8 i, D1 F3 h7 o4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
! A# |; ]+ Z+ [2 A9 k. o    link/ether 02:42:2a:d9:93:52 brd ff:ff:ff:ff:ff:ff' f( W2 n* \  m, L0 i4 u2 b
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
( G+ G; P5 C+ C       valid_lft forever preferred_lft forever
+ K; g  i9 g3 _" V, _# r    inet6 fe80::42:2aff:fed9:9352/64 scope link ; u3 l' s4 A. d' O3 ?/ \: D+ \6 j
       valid_lft forever preferred_lft forever
. H- [$ W' e  `6: veth0c46c6a@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default & G# N: \! b( {: ~( o
    link/ether 1a:ce:d7:61:d0:cc brd ff:ff:ff:ff:ff:ff link-netnsid 0
7 Y) O* `1 |! H4 |8 A4 V$ g    inet6 fe80::18ce:d7ff:fe61:d0cc/64 scope link
) |$ \, A! I: E/ s  t* [$ N: h       valid_lft forever preferred_lft forever  W! @" `/ i/ d- j* S6 Z4 N
7: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
  M& V) C4 B3 z7 Y% P: }6 T  o    link/ether de:e5:b7:4d:e8:b8 brd ff:ff:ff:ff:ff:ff
5 j6 P% r& Y  @4 f6 I11: br-int: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN group default qlen 10006 U3 e; d8 Y4 q7 J/ h4 T$ s& }1 J
    link/ether 52:14:05:ba:ce:4c brd ff:ff:ff:ff:ff:ff
) |6 G' m3 _2 u) L0 d8 j$ p  V13: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
: H. a5 `) z" L    link/ether d2:5b:76:f5:01:49 brd ff:ff:ff:ff:ff:ff% ]+ w# M5 {7 q' L3 H
14: br-ex: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
! o! t" H6 E" W* U    link/ether 00:0c:29:0c:4e:08 brd ff:ff:ff:ff:ff:ff
. o5 G+ Z! U% ^2 G% x22: qbr2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000
: C: a8 q' P- f9 g    link/ether 3a:0d:ad:56:9d:9d brd ff:ff:ff:ff:ff:ff
, T) G; ]: v; ]! k+ `23: qvo2749f64b-1f@qvb2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master ovs-system state UP group default qlen 1000# W+ {0 q3 L# l% c5 m/ n
    link/ether c2:c5:8b:a6:72:8b brd ff:ff:ff:ff:ff:ff' X. V" P8 @  F4 |* T5 g  z0 ^: v9 M
    inet6 fe80::c0c5:8bff:fea6:728b/64 scope link
5 q/ O3 w/ r) d0 v  B& I2 k) x6 p" q       valid_lft forever preferred_lft forever: y4 \5 Y1 M) u/ D, ^! f0 R8 V
24: qvb2749f64b-1f@qvo2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master qbr2749f64b-1f state UP group default qlen 1000
4 a: P$ Z+ S' F; D    link/ether 3a:0d:ad:56:9d:9d brd ff:ff:ff:ff:ff:ff
* r. {5 R& {1 e& P7 H/ Q; X% ~6 _    inet6 fe80::380d:adff:fe56:9d9d/64 scope link
2 N* Y0 h; k2 P, E  {2 Y- X       valid_lft forever preferred_lft forever
; j- Q7 l8 d4 a8 v' F# j25: tap2749f64b-1f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master qbr2749f64b-1f state UNKNOWN group default qlen 10006 X) y+ |; R; b3 x1 [- C  e
    link/ether fe:16:3e:94:b5:71 brd ff:ff:ff:ff:ff:ff; W" e* Z2 U' b1 }. x% s
    inet6 fe80::fc16:3eff:fe94:b571/64 scope link
, Z$ j' @4 E0 f6 b       valid_lft forever preferred_lft forever# u) j- |7 X/ t; L" o5 k
26: qbr0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000
# n7 \& R6 L' c$ \- F' @; Q% [    link/ether 02:f9:32:c0:f4:b7 brd ff:ff:ff:ff:ff:ff. W4 {' M7 [  s+ `2 M3 u2 [
27: qvo0a14e63d-2e@qvb0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master ovs-system state UP group default qlen 1000
7 V0 ]4 x9 f* o( n    link/ether 76:86:46:4c:4f:61 brd ff:ff:ff:ff:ff:ff0 P& t) J) l# L3 T( p7 x# M* E
    inet6 fe80::7486:46ff:fe4c:4f61/64 scope link 4 Q( \0 d& K. j9 n6 W
       valid_lft forever preferred_lft forever
) @: ^, y; D5 N28: qvb0a14e63d-2e@qvo0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master qbr0a14e63d-2e state UP group default qlen 1000
" s7 x1 |# |3 E, x9 T    link/ether 02:f9:32:c0:f4:b7 brd ff:ff:ff:ff:ff:ff# C2 J7 L! N/ u- |
    inet6 fe80::f9:32ff:fec0:f4b7/64 scope link
& _2 {2 g* x9 F9 |       valid_lft forever preferred_lft forever
7 J* m" Y& Q+ i( M/ {% O29: tap0a14e63d-2e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast master qbr0a14e63d-2e state UNKNOWN group default qlen 1000* S$ E0 g' S- U. U4 P$ o; }
    link/ether fe:16:3e:ee:08:6b brd ff:ff:ff:ff:ff:ff
: u. i/ h% Y6 q; @    inet6 fe80::fc16:3eff:feee:86b/64 scope link
/ Z7 w3 A, p' C! V- h       valid_lft forever preferred_lft forever( E2 \: D' e- k' ~0 j3 V" P
1' E+ t; a& N# E1 t* _, x
2$ F; I# |- d& A' B
31 }0 u; x" m9 y7 h5 r6 A
4
) A8 ]% \  B' p5 q& W5
# ~9 c# A  }. ]' U1 N; k6
: l& H( h) m, U8 ]7
( S; r' s& c2 d+ X6 _. x8
& Z7 T, W, _6 K9
- P, V5 Y6 ]% G$ `% C- _10) v' z6 Y+ q+ l' U
11- E6 ]& s1 Z1 o
12
( D3 m: n; p' r/ j* ^* z13$ @1 E& K+ _. ~1 J
14
2 t* |1 C, f8 b, ^8 M# Y15' r& S; f/ \  D" {' N( W
16
/ I; V2 Y1 v$ {* V, @* |: x171 D/ H4 f  P( t
18* j0 H$ {+ ]2 z' `% `2 }1 y) [) Z* E
19
* A7 U4 w8 N1 A/ W; Z20! z  U( x, z- X" ~& z+ Q
21
7 n$ v. p2 F$ `) J0 _221 j2 x- C) e, P# L
23' r8 @" s' Z" U( s, z! ]; G4 }1 c
24
, z% ^/ S0 O0 S4 D0 C! Z" S$ s2 f25
# \8 w4 S, u  O2 I/ O26
! F  g  S5 V% J279 L/ [9 V; ?$ [
28
8 L% w- w  W! _29
* Q: X# n+ i9 @( k7 T' x7 E308 s1 Z8 R: S. y8 Y3 G
31/ V* ]9 v- E. p7 m
32: E5 _- s% q+ j# X. j8 r
33) F; v! D" K. r3 ~! M9 C
345 _0 @- b& Q2 i, I! G; D3 @
35( x  H6 _9 a: U7 X  M
36
8 ?9 ~9 F# N- ?4 v$ _& D376 T/ c; n* X0 W
38; p: o4 z% d+ A$ {+ V; h2 \
394 f* ]( c& v" A" n4 p. \
404 K$ v; O. S4 V; y4 n1 ?
41
/ ^% t7 F; |% M7 D8 D! O( L422 n, n& B! O& n' N$ T1 C
43
% }7 ]+ D% w! G3 U446 s/ r! u. _) p2 m; C5 P8 E/ Z
45
' N! E7 ]" ^7 O7 E+ `; f46" w) h+ b% I: \) ]# e! L1 [1 v1 H. r
47
& s) a( q; w% a3 r! y4 U' ]1 g48& m8 k" V- {+ y* J' w
494 p: ^8 J+ @2 z; S
505 T$ r8 ^- c  o3 m) m" p' r+ B5 D
51* l) l! _) ~* v$ t
52+ ~  L2 `6 {+ [; y1 ?+ l& a! I
53
' T2 i0 y- ^9 r4 Q! ^54
" K+ x7 c& h. w0 t3 I' W6 _: j55
5 |: o* W3 ?" D4 B- A: {9 q56' W7 ^# {! k% d+ ]+ R) M# s
57
% j8 {6 c' G& S! ?3 j! B  `+ i586 h( _, Q) u& O6 f( y' a
59
7 _1 D9 A8 Q, A) U6 p! {60; T0 `$ b0 q5 n& G' {5 T
61" `. L; f4 X  c) ~% @6 E
62$ k: ]* F; i" b8 F
63% T( ~' y% s9 p3 s) |6 [& W1 S/ L( F
64, |* z; r# O1 e& E
65& e/ o! _! }' }* f7 M2 p
另外需要注意,不要在该节点安装libvirt等工具,这些工具安装后可能会启用libvirtd和iscsid.sock等服务,kolla已经在容器中运行了这些服务,这些服务会调用节点上的sock文件,如果节点上也启用这些服务去抢占这些文件,会导致容器异常。默认kolla在预配置时也会主动禁用节点上的相关服务。
5 r( H' H2 ^6 @6 n; q# b4 o3 q4 h# j# i. G9 x/ V2 y
安装OpenStack客户端
/ i" }7 ?6 E' z" A, T* [5 myum安装openstack客户端
! _5 m1 _( D( ~6 M8 e0 R% M( e
5 B  Z& f3 w! I  b! T$ R# u#启用openstack存储库6 i' j, t: r9 Y1 L- m
yum install -y centos-release-openstack-train
* f* ]# }* O3 C8 E. I! k6 u, \. v+ L1 d* v1 M
#安装openstack客户端
$ A; K2 U8 w7 @; yyum install -y python-openstackclient
2 m" Q# w5 c" e" V& g3 A( @7 c6 \/ U8 ?8 p3 |$ j  C8 Q6 v+ H
#启用selinux,安装openstack-selinux软件包以自动管理OpenStack服务的安全策略: x( X4 V# w0 l0 u& s+ B: Q( k  F
yum install -y openstack-selinux- H3 x2 z% a9 U2 ]

$ x) O) e/ l/ y! ^) p& {5 v#报错处理
5 P* b5 i# _, apip uninstall urllib3
7 g( E, Z6 z* e) j& Eyum install -y python2-urllib36 G, y: j' M; Z
1( S- |. H9 L2 h1 [4 `
2
& b( A. f4 Y2 I  E5 h* ~3 v3
: l$ W* M9 N' P; m" a9 i; }4
$ f" o, Q& S5 G5 Y1 Z50 T( n) J1 Q* V; Y% C7 Q
6
2 z8 D! l: Q9 |5 P" w' J74 R1 z! N/ U9 P$ s
8
# d. a, t1 l" R95 t/ s; g1 H! m- v. |4 u
10
) p4 Z4 D/ D! }3 d7 s( \( \1 d6 G11
# u. P. A. m& X* ~6 k, B- ?12
7 o( f4 @: z0 M  G3 E' H4 O8 {kolla ansible提供了一个快速创建cirros demo实例的脚本/usr/share/kolla-ansible/init-runonce。. h9 A' k1 ~, u
/ j: b* g; c) T
脚本需要cirros镜像,如果网络较慢可以使用浏览器下载放在/opt/cache/files目录下:
/ ^$ i3 O$ D5 k! C$ D' I' R6 R' E& j- L. ?
wget https://github.com/cirros-dev/ci ... 4.0-x86_64-disk.img
* {* {, g; z+ l+ t" D% \9 f5 Q/ Q& dmkdir -p /opt/cache/files/& X2 x8 F1 O+ Z# r+ P( O0 d6 X
mv cirros-0.4.0-x86_64-disk.img /opt/cache/files/( R4 F! j; G( j  N/ B
1
3 z! f6 e! H9 O: d2% B- Q% M7 Z. e* ~) e  l! S
3$ L+ ]) l' Q7 K3 R  y( E4 G1 D
定义init-runonce示例脚本外部网络配置:5 n3 r. ]  o/ v6 ^) [. }

. n9 [; z2 ^5 W#定义init-runonce示例脚本外部网络配置
# h. U2 V3 e: V  K5 texport EXT_NET_CIDR='192.168.1.0/24'
+ \$ N9 V6 X2 I! Sexport EXT_NET_RANGE='start=192.168.1.200,end=192.168.1.250'( m' @( p& x, P# G
export EXT_NET_GATEWAY='192.168.1.1'
! B+ T: v% `$ ^) i
" E5 }5 W' r! F" l2 b3 A: A#执行脚本,上传镜像到glance,创建内部网络、外部网络、flavor、ssh key,并运行一个实例" I# K% x$ X, @& P
source /etc/kolla/admin-openrc.sh ' @6 [; I. P' U- q1 W
/usr/share/kolla-ansible/init-runonce
+ p2 s- j6 x" [5 s10 d+ s$ }3 \6 q# g/ Z/ E) e: Y. h
2
3 p. U" S! [" V7 m: L1 G$ P! z$ F3
+ y0 c- j8 Q2 C1 o0 x! [; U' }( @" u4
5 E, J; q9 C% F3 L5
# U! N& L- @1 t" F0 Y1 l6
& M6 z! h9 }, q7/ y/ `: a8 [) W2 }8 v4 O
8, T) K- J) C7 O3 F
参数说明:5 ?; _: S/ D3 \3 M+ d% [

2 G+ g5 }9 k7 d! T% m- G& e) BEXT_NET_CIDR 指定外部网络,由于使用桥接模式,直接桥接到了电脑的无线网卡,所以这里网络就是无线网卡的网段。
- n. b: Z+ X) {' ~4 ^* A% [7 XEXT_NET_RANGE 指定从外部网络取出一个地址范围,作为外部网络的地址池
( F" q$ Y/ E6 y. f' @EXT_NET_GATEWAY 外部网络网关,这里与wifi网络使用的网关一致
0 y5 S/ r' P% h) {) T根据最终提示运行实例( A6 P4 \# X& c! ?, d

* {6 O' Q. d) X1 w2 N+ J: ]openstack server create \" M) N* Q# R+ }
    --image cirros \
6 L7 m% c; x, N& s    --flavor m1.tiny \3 J! R5 _" R9 ~, p1 y
    --key-name mykey \
2 e" P9 F+ n9 ~/ z; i3 r/ s    --network demo-net \1 j) K, [) P( O, U
    demo1
- e6 O( R) c. N7 d9 e  n12 M; X' R) f- Z$ L
2
6 Z9 H. p2 U! {* \8 M39 s* b' E4 ]7 f* I3 R2 y! ^
4* }. c  C& d1 l5 [' \; u$ {0 X
5
" \$ _! N1 `  N6( X& v# D9 p$ j2 x# B) g
也可以使用docker容器作为客户端
1 N2 e$ \+ y/ b2 k# ]# a" d0 M6 c
% L/ L5 d. C+ M9 B" w# adocker run -d --name client \
) X2 I" Z' K/ c& }+ i  --restart always \, ^" |$ c* c5 K* m0 z9 c
  -v /etc/kolla/admin-openrc.sh:/admin-openrc.sh:ro \
/ [; G9 j- Y: F7 R  ?  -v /usr/share/kolla-ansible/init-runonce:/init-runonce:rw \
  X. ^/ h, j7 \0 D! ~  registry.cn-shenzhen.aliyuncs.com/kollaimage/centos-binary-openstack-base:train sleep infinity
0 M' R* `  P/ i6 J2 t" P7 m4 S& I0 H7 f7 c
docker exec -it client bash( [. j; O' v* X! }( l! g3 W8 B
source /admin-openrc.sh
' i7 t2 K8 o% S: n) j% Z/ J2 t! n* yopenstack service list
9 r# @4 [5 Z1 W4 m1
$ L% G( q1 m8 f# l8 ?2" g7 b1 h) `  ]2 L# _7 g8 B
3
7 L9 r5 p$ H0 y4
1 m5 h; O$ a0 d- v- N7 O  C: u4 f) Z5+ K4 y2 x% Z5 ?" j& }, t
6" w; }4 o5 K! b9 r' `0 K
7
" L; ]4 O  V& u/ f8& p- `8 E: P8 u8 H$ a3 Q9 Q
9
8 n# r; E' w2 V+ T  v9 E访问openstack horizon# D, m& I( R8 ~
访问openstack horizon需要使用vip地址,节点上可以看到由keepalived容器生成的vip
+ m2 m! Y$ S- G9 l  ?' W4 T1 C, q7 v
[root@kolla ~]# ip a |grep ens33- Q* n+ \, i( l
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
/ D; W9 q2 {( N8 b/ M/ B" B* Z    inet 192.168.93.30/24 brd 192.168.93.255 scope global ens33, v+ C  x0 Z3 b0 X
    inet 192.168.93.100/32 scope global ens332 S* P6 {- a$ i/ Y, x# Y
1$ h2 b7 y- R, `( H4 c
2
2 G% h; ]4 |8 Y) N# }3 ^3+ |# F* H* ^; \$ y
4: h  K; V  \8 p+ |- X7 U
浏览器直接访问该地址即可登录到horizon
  V( I$ Z6 C& I. ~3 A8 S3 o$ h* A" \7 W% B9 r
http://192.168.93.100
5 K, n) z7 @7 R, p0 g
2 o2 q( Q! s% m0 d5 ^$ G$ z1 g我这里的用户名密码为admin/kolla,信息可以从admin-openrc.sh中获取' J; c& q7 b7 x4 X7 E0 _, b* L

- v  P: l  A+ d7 h[root@kolla ~]# cat /etc/kolla/admin-openrc.sh
% M8 i8 u$ d+ N  Y+ [9 G, t9 P+ j! a# Clear any old environment that may conflict.
+ ?' \: h6 g9 H% J, Wfor key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset $key ; done. k$ w3 i  U9 k* l6 H
export OS_PROJECT_DOMAIN_NAME=Default
: D# M/ V4 Y4 a4 ~export OS_USER_DOMAIN_NAME=Default
8 `7 z3 A: u3 w6 [: M: j: ]export OS_PROJECT_NAME=admin$ [" U7 ]1 _( o7 ]0 n( F) M
export OS_TENANT_NAME=admin
5 Q% Z9 y' R7 \7 D* ^3 T8 a7 T5 hexport OS_USERNAME=admin( F2 P8 B, y& \/ g3 s+ `7 G
export OS_PASSWORD=kolla
0 }, U; [3 h1 q' C/ t% |  W' q1 yexport OS_AUTH_URL=http://192.168.93.100:35357/v3
4 I% N  A3 K/ n" p# D$ h8 b2 ?export OS_INTERFACE=internal9 w5 H" }& o6 L' c9 s
export OS_ENDPOINT_TYPE=internalURL
* F1 i, S0 r& l& {( ?  h, S! s  V; Iexport OS_IDENTITY_API_VERSION=3; o  Q3 j3 }$ I
export OS_REGION_NAME=RegionOne
# i  W4 y  U" f" r7 _5 Z; ?4 x/ Oexport OS_AUTH_PLUGIN=password4 L6 ^8 ~! H0 {4 L% G
10 b9 p1 g7 a& I( v" w6 O+ _/ P
2
4 y6 w8 r. _4 e7 h* e3
' @$ |( P8 Z+ @, @' s2 U" Q4
  s+ u7 B& d4 }/ n56 x2 F& j5 b* @5 b! t( s& D
6
: b0 ~% e" d, J; F7
1 C. n6 p% @, }6 X) V, m85 i( E, p. J6 [3 K; z  V
9
7 ^2 b1 A# R. \9 S10" d' ^4 [9 _4 @
11; v$ O' b/ X0 s  a
12
* Q+ b$ A9 g+ ~( O" j- T13* ?3 G- \8 ]! B( A9 S
14
' g. k+ I" @" ~0 U15( ^5 ~( u0 m8 K2 {% j
默认登录后如下
: U. E# b. K6 S0 V4 I! p! _8 D' W) b2 w4 j( U
" {9 I8 X! W" Q" f6 W
在horizion查看创建的网络和实例
4 }% K( U# Z. V4 F
* T5 B8 I  c: U( c: f7 D登录实例控制台,验证实例与外网的连通性,cirros用户密码在初次登录时有提示:
+ m# s1 R9 C5 a( h3 S
: T% x; F" U7 Q4 x* ]为实例绑定浮动IP地址,方便从外部ssh远程连接到实例( ?( y& j$ x' L% o1 E  w8 j- j

6 p; E8 o' M/ |* Q点击+随机分配一个浮动IP  W# y$ |+ K( C7 }: p( j; U& V* Y
" e3 |$ b5 l( D3 S0 s* s+ Q
4 b7 }0 y2 |9 A+ X
在kolla节点上ssh连接实例浮动IP,cirros镜像默认用户密码为cirros/gocubsgo,该镜像信息官网有介绍:
; A! `5 I/ C! N9 }, \  yhttps://docs.openstack.org/image ... es.html#cirros-test7 H+ ^- Y  B7 ?; I- j
, v/ N. h% A/ ^4 @- U  |: `
[root@kolla ~]# ssh cirros@192.168.1.2484 K# C3 j0 v5 u1 r2 Y  |- H
cirros@192.168.1.248's password: 0 O: R9 A$ o" Q1 n$ E* |
$ / k7 q- ^5 H5 P7 L
$ 2 f: U8 B1 J: e. u) A$ C
1
% c/ s" U! m3 n* ~4 [/ U25 m3 _" c5 y* S+ D. C+ @
3% q; z' d/ l# i: ~$ @
4
+ y( M3 P. K" A9 f, E6 r或者在集群外部使用SecureCRT连接到实例。
2 e( z5 C' B+ B/ c" X7 r6 s! @' {1 Y/ j0 H  @! Q
4 q* [' z! w' M* Q' \
运行CentOS实例
/ b6 e' T' ~. `( j, wcentos官方维护有相关cloud image,如果不需要进行定制,可以直接下载来运行实例。
( m" S* B' K# |1 w" [+ B+ H
' Q3 F" x/ q, p8 l$ _. `' a参考:https://docs.openstack.org/image-guide/obtain-images.html
8 r! J0 m: x; w6 ?& ~
1 B( }+ D' h3 g, A! R& LCentOS官方维护的镜像下载地址:: O- A3 T" q% K/ V+ _9 o+ H- G  ^" ?
http://cloud.centos.org/centos/7/images/2 |/ Q3 l4 h- ~
# q3 R3 }2 I& P$ s6 z: D
也可以使用命令直接下载镜像,但是下载可能较慢,建议下载好在进行上传。以centos7.8为例:$ \3 e2 H" H  L; d1 {
+ Z; F, \+ A& d+ Q/ ^" w/ R& y
wget http://cloud.centos.org/centos/7 ... icCloud-2003.qcow2c5 k( ?2 m" b( [9 K/ W  ^
1& z5 |% h, _# K
下载完成后上传镜像到openstack,直接在horizon上传即可。也可以使用命令上传。6 A& I7 |. o( O3 i
  [9 r/ k2 i" P+ Y8 z" [
注意:默认该镜像运行的实例只能使用ssh key以centos用户身份登录,如果需要使用root远程ssh连接到实例需要在上传前为镜像配置root免密并开启ssh访问。: a' V9 d7 I  S/ i5 x3 y. S# S
# }8 }3 L( Q' ]2 o% t7 l; d5 s
参考:https://blog.csdn.net/networken/article/details/106713658, E/ P5 ?5 b7 l7 N8 I* b: h2 v
2 S; P8 j& X9 ]& d
另外我们的命令客户端在容器中,所有这里有些不方便,首先要将镜像复制到容器中,然后使用openstack命令上传。/ B: F* ~& W' ?( f: ?- h" P0 A4 d
8 e; }$ h$ [; I
这里复制到client容器的根目录下。
8 O9 a  @7 d" b% i) y
/ [. l  a2 Y; @# o/ f[root@kolla ~]# docker cp CentOS-7-x86_64-GenericCloud-2003.qcow2c client:/. Y/ x7 R2 X" [5 |
) r6 f* J: m) p
[root@kolla ~]# docker exec -it client bash* _8 z% T) Q+ v
()[root@f11a103c5ade /]#
- }1 B  ~! ]+ h! Z5 j, e0 \()[root@f11a103c5ade /]# source /admin-openrc.sh
6 m8 @1 [3 I3 @' J9 z4 s  G8 @) U' h0 v5 ^# g& c' C
()[root@f11a103c5ade /]# ls | grep CentOS, H# U8 g5 e7 @1 O
CentOS-7-x86_64-GenericCloud-2003.qcow2c  j* N  z) N. T+ ]8 U9 c+ ]0 K
1$ q5 R% w, f4 Q
2
* l" Y) L8 x* R5 y+ `1 f" ^/ [8 @38 F6 x8 m9 q; @5 ]1 D" }
4
9 u, Q  e+ X$ d" f; K5, J+ a' P( P2 f" \0 f( [
6# k2 S. U3 w0 E8 i
79 ?, z$ d$ k% P: Z- ^* |, z9 u) C+ W1 k
8
2 q7 s, G& D3 d执行以下openstack命令上传镜像& J% M: d' A- z& r, O
1 ?- p, p! O7 R6 S) k* p
openstack image create "CentOS78-image" \9 U  f' I; i( v+ {8 n! R  r, }% C: u
  --file CentOS-7-x86_64-GenericCloud-2003.qcow2c \
) k+ M' s( Q6 U3 e% u- r  --disk-format qcow2 --container-format bare \) K3 ~: q+ P. {/ [
  --public
0 v( k; A, A& l1
/ T" Q- c+ W) R( `6 i6 `2" E) b  q. K, `0 a" F' c$ B( }4 B0 \5 c
3
  C% j! S! M8 U0 U- o4
$ n9 g' m, I% ?# E命令执行结果
; Y! Q2 }) {! N; e: y9 y$ J
4 R; k* }7 O3 L6 K( O()[root@f11a103c5ade ~]# openstack image create "CentOS78-image" \
: d$ [& _2 m7 G' j>   --file CentOS-7-x86_64-GenericCloud-2003.qcow2c \
! P8 M; f" h; O/ q/ |+ M( \. S) K& M>   --disk-format qcow2 --container-format bare \6 K( E& X. c/ D) J0 d4 Y
>   --public; F6 X1 O8 P/ C; H6 r; s
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+0 n3 s* I: l. f5 w* i8 @, q" _
| Field            | Value                                                                                                                                                                                      |- D3 L; M' Z" P' `; H' b: J- T9 L
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++ M$ S' h) ]3 W, _
| checksum         | 362d1e07d42bcbc61b839fb4269b173b                                                                                                                                                           |4 u; C2 P; `% Z' c
| container_format | bare                                                                                                                                                                                       |7 b7 q( V& U2 `; i  R
| created_at       | 2020-06-13T03:23:16Z                                                                                                                                                                       |% \3 ^/ ^1 v5 ?' l2 x- \
| disk_format      | qcow2                                                                                                                                                                                      |+ x: s, }1 d* N7 I
| file             | /v2/images/2d95d8a0-6fba-4ca8-9dde-8696eb7ebdbf/file                                                                                                                                       |
7 P3 j) v9 T% m1 A0 K| id               | 2d95d8a0-6fba-4ca8-9dde-8696eb7ebdbf                                                                                                                                                       |( p! R- M$ P1 g. w( R" Q: j" u
| min_disk         | 0                                                                                                                                                                                          |" }$ c* ]8 F, o5 T! p
| min_ram          | 0                                                                                                                                                                                          |
  k" }8 ?4 f: k) D| name             | CentOS78-image                                                                                                                                                                           |
$ C6 I( u+ z" B# E| owner            | 65850af146fe478ab13f59f7edf838ec                                                                                                                                                           |
9 t0 A0 @* f9 v9 U. I| properties       | os_hash_algo='sha512', os_hash_value='aefa398f69e1746b420c44e5650f0dcf15926fb6f8c75f746bb2f48a04f7b140fdc745090f3d06b68fa0fe711ded7d822150765414e2a23f351efd2e181eb7b9', os_hidden='False' |
" J2 d. q9 F3 ]' n0 T# E| protected        | False                                                                                                                                                                                      |% }" ]# X& B$ X7 _) N
| schema           | /v2/schemas/image                                                                                                                                                                          |9 Q3 b5 h: L* d
| size             | 385941504                                                                                                                                                                                  |
0 c0 x0 `! w- Z% ~5 z3 \( Y. `% U- O| status           | active                                                                                                                                                                                     |
' v( I( X% f' S6 |4 x| tags             |                                                                                                                                                                                            |
' y0 p7 t1 w. M1 X) V! E  I| updated_at       | 2020-06-13T03:23:20Z                                                                                                                                                                       |
: p: V- S& e7 Z2 A9 c| virtual_size     | None                                                                                                                                                                                       |, m0 v% N# j) Q" m) ^8 ~
| visibility       | public                                                                                                                                                                                     |: ?, U* q* w% k. u& U! ?
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+2 M8 E% d) j/ Q! S( k: K* n
1
. s% j$ V; j; l" [$ ]/ L6 ]2 p2# Y1 m# m" z( M7 V" R
3
7 F! G" o( g# n4+ n$ N& O; |; ?2 j" Z
5
. H# b- m/ e, a66 W( |, j3 ]* J
75 [$ f' j# w7 ]& V/ Y
8
7 P' Q$ j. ^( n0 U3 B: }9
9 W( N& {  O! j# O103 Q/ [2 C+ ^+ X. h. ^/ e$ I
11
1 }; h; T4 ^0 C1 D12
9 [! l5 n* ^, G% F. g2 W$ F9 C+ |13! _. u8 y; a9 w6 r$ ]8 Q/ T
14
( a& s( a. ?5 T/ G( |$ W0 S& ]15% P' O1 D+ I6 m9 x
16
& H  b7 |6 c6 p17
# A% |7 ]: ~! f) J" ?, P18
6 \( A' n% y2 {; x/ i! J+ @19& J$ z5 o5 p) u
20
. [. F8 _% @" W3 J5 f21
6 n) L9 G# M. a( E% P  ~& ^228 X8 o- h0 x9 U5 l. ]
23
; n1 _! I" I' `3 e7 Z! L24
- ]# Q2 M5 [! \% C, Y! t* v9 Q, w25
* W( H3 _7 a5 E2 Z: |6 q" s26& v( G3 S0 p. Z! b$ z
27
$ Y# F# I2 p$ F0 _# T  n在horizon中使用该镜像创建实例,其他信息直接使用之前demo创建的资源即可。创建完成后为实例绑定浮动IP。
) H$ m2 Y' ], @; d+ P9 Y5 X# y
7 \8 V1 O6 H( e# y如果实例创建失败可以查看相关组件报错日志
' {/ K' t, m- C+ L  _9 i* S3 g0 s# S
[root@kolla ~]# tail -100f /var/log/kolla/nova/nova-compute.log - i$ |) b" S5 o5 j6 }/ ]1 n
1
* a9 t: U% w6 W- D6 J未配置root密码连接实例* I! m3 u/ T9 ]% G' m' t! q4 L
如果没有提前定制镜像修改root密码,只能使用centos用户及sshkey登录,由于是在容器中运行的demo示例,ssh私钥也保存在容器的默认目录下,在容器中连接实例浮动IP测试
( z3 }& _- R* o% |$ e* v1 D- f
' t1 M' L! E. V[root@kolla ~]# docker exec -it client bash
/ `6 S/ `1 @8 G& I6 h6 R()[root@f11a103c5ade /]#  ssh -i /root/.ssh/id_rsa centos@192.168.1.105
7 V; R, U9 W# R  a: P- v! BLast login: Sat Jun 13 05:47:49 2020 from 192.168.1.1001 e4 h; y4 {0 g+ {
[centos@centos78 ~]$ 6 b% v3 H; a% W) l+ }8 G
[centos@centos78 ~]$ ! H/ [; x+ J. ]5 A+ E6 A
1& j" ^. Y9 S3 m" G' m3 `( F
2
. X" F; Y: d5 a/ t( A7 z3$ V: Z9 x* m7 P. g
40 o+ o6 D7 Q' M1 z5 U" @9 w$ u
5% g6 O$ E) Z; N5 H0 v0 l9 N
或者取出该id_rsa私钥,使用SecureCRT登录:
+ O& t6 _) \+ z, {& t" b) Y/ u( Z6 v
配置root密码连接实例, N8 b$ E( K; l2 a6 x

; E. I+ b5 L6 R如果提前修改了镜像配置root密码,直接使用root用户密码登录实例即可,3 P8 a& i1 h. w
; x+ x  [' J3 r* s% ?0 o8 h
[root@kolla ~]# ssh root@192.168.1.105
8 }% \% K! c8 a! ]9 C8 @root@192.168.1.105's password:
( ?3 z* t. E: D# `/ _Last login: Sat Jun 13 05:51:53 2020 from 192.168.1.100
: I! H0 ]$ K6 t, m8 N! h[root@centos78 ~]#
- c, T& c2 [9 L[root@centos78 ~]# ip a* A' o0 @  b6 G5 n# s5 I
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000& M- ~# A" B( ^0 T
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00% @  a/ `5 |1 e! Z- |
    inet 127.0.0.1/8 scope host lo
% A4 `8 k# l: a9 J4 u5 `# Z3 E6 t       valid_lft forever preferred_lft forever+ S- O2 a6 L4 b7 I& B7 E
    inet6 ::1/128 scope host
! }* K7 r$ m1 _/ h; |  o       valid_lft forever preferred_lft forever
4 Z: L( i! p! W0 Q& n, V, c2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast state UP group default qlen 10002 f" [8 }. z& s
    link/ether fa:16:3e:94:b5:71 brd ff:ff:ff:ff:ff:ff0 ?' M: u3 e  f
    inet 10.0.0.193/24 brd 10.0.0.255 scope global dynamic eth05 c; l. H$ S4 w% Q5 m- a
       valid_lft 84215sec preferred_lft 84215sec# j# {* C1 ^3 H! n" J, P
    inet6 fe80::f816:3eff:fe94:b571/64 scope link
5 e+ P2 K% I- h+ ]  i/ B       valid_lft forever preferred_lft forever
3 o  }# R; g- O5 c[root@centos78 ~]#
0 @1 P) e6 l& p% O: G[root@centos78 ~]# cat /etc/redhat-release ) K' e6 j4 H9 T3 T
CentOS Linux release 7.8.2003 (Core)$ Z, g4 A2 e2 S5 b* X3 n) K$ @! w
1
/ `3 W" n! v, T# `+ }% W' _2
8 Z9 p5 ?/ ]6 I# R& n( W3
+ j# |: B* w- {0 B: b7 J0 N4
7 d( S. ?: m& v' W5, r4 V: l( i7 k: c( K: C/ i7 D
6
: q9 S% ]' b/ J. ]1 [: n+ p5 w0 B- S. j7
0 q  r* d  h, U4 E7 j2 d8
+ n8 {6 v$ F: A. d9+ y" T. W6 n9 N; S5 M* R: W3 i
10
9 ?& l$ E0 k8 \* v* N% R7 _11
; Q5 Q7 ~. ?3 Y0 w0 K$ S125 l7 t8 Z$ \! B" r( @  N
13
/ l. @: E% ^* Q4 W$ y14
+ |, }. P  U& {15
: H- Q- {- O/ l16& q  e$ Y  @. [5 z/ g
17$ e$ E# b- A2 _* l# G
187 ~$ s/ p, w* H
19
8 u! L1 s3 T# E4 C3 ~" L/ ]  {7 l# f20
) I+ t7 f: Q: K# k0 P5 @% w. T运行Ubuntu实例' C' |8 y( ]- W; T' j: {; e; `" j
下载镜像
5 @- D' D9 q, b$ d  k4 K* _' }" I" G7 s. h* J
wget https://cloud-images.ubuntu.com/ ... -cloudimg-amd64.img
. Y  j/ J" x9 Z! Y- |  I% E17 K8 m( }# H6 ~7 m$ f4 }
上传镜像" E1 |6 P  V% w1 d& b, D

- K7 X( D) \# z8 [openstack image create "Ubuntu1804" \0 c$ Y6 }4 F! t' n( _
  --file bionic-server-cloudimg-amd64.img \: |8 d; {) a" V/ _7 P2 j6 P
  --disk-format qcow2 --container-format bare \* Z. l* }, S2 M+ q9 j2 @4 T
  --public2 o! c( b5 C0 [3 @4 N- i+ {2 f( U; }
1- O+ Y8 N" J1 S7 X3 ]
2) p0 R0 D7 E* V$ q1 p/ O
3
7 M$ Y# o( Y& C- j4
3 ^8 m! J5 [0 T4 w7 Q: M4 N按照正常流程创建实例即可,ubuntu镜像默认用户为ubuntu,首次登陆使用sshkey方式,然后执行以下命令即可直接切换到root用户(centos无法使用该方式)! @$ [* C) {# z$ G/ U" m
# A+ }4 k& {% d( T# K6 y8 B: G' [
$ sudo -i. Q8 O: }: o, [6 W
1* }. [# W3 Q5 x% P
调整集群配置4 O" ^( R$ Z& b! C1 E5 Z
集群部署完成后需要开启新的组件或者扩容,可以修改/etc/kolla/global.yml调整参数。& v. d2 ]8 z, U
或者在/etc/kolla/config目录下创建自定义配置文件,例如
0 d8 j# Y" o5 R  @( ], O# x2 T" y2 a' ]  x3 `
# mkdir -p /etc/kolla/config/nova8 `9 a# }  ]" }: }  o$ p, u

: U9 a" w+ }4 m- _4 H. W; ~# vim /etc/kolla/config/nova/nova.conf
4 q0 H6 y* |9 J0 f[DEFAULT]# ~3 A& F- B$ X
block_device_allocate_retries = 300  K! \2 t+ _9 o
block_device_allocate_retries_interval = 3
( h4 k$ {2 N$ p* E* k. n7 O14 C( M+ `5 H0 v- M7 i. V( I5 H
2
- e. L' }; y" ^2 A$ V& @3: {3 N+ T/ c7 R, a( N/ {2 D
4
" ~8 L) W+ B9 Y6 s  d5 }) j5
4 c, w$ B2 E7 u6- g" J( v( R2 {, q% e+ R% R2 D
重新配置openstack,kolla会自动重建配置变动的容器组件。6 Y# x# S- H& m3 X
( N/ b, y. n0 l" n/ Z" A' r* a
kolla-ansible -i all-in-one reconfigure -t nova
0 h$ G; j. _. `9 w& G1
- `8 Y+ k7 P  \5 t! P) w9 [kolla配置和日志文件
/ F. U8 c5 q# |( H2 u! b各个组件配置文件目录: /etc/kolla/
$ [9 a- }- l( g1 _1 w# s: G# p5 c各个组件日志文件目录:/var/log/kolla/
2 s, b+ _/ J. R清理kolla ansilbe集群5 C, R! z7 A' {& l) _, W( x* k/ P
kolla-ansible destroy --include-images --yes-i-really-really-mean-it
) l+ k! w  k+ F+ _, H0 S" D7 f* q/ f
3 c9 n; d7 D% N1 ?6 @& D8 ^- y: d. K#或者) {( j' U9 r4 r1 v
[root@kolla ~]# cd /usr/share/kolla-ansible/tools/4 M. c/ Y9 D# G. N6 C8 C
[root@all tools]# ./cleanup-containers
- i2 y' b% r2 K* b[root@all tools]# ./cleanup-host
9 w- a8 K, F$ k7 E6 s0 m) `; U- ~3 v2 l& S9 U' K9 X% P
#重置cinder卷,谨慎操作
; I; X( f4 ?4 h) d4 B& ivgremove cinder-volume6 L3 P' m4 B! m1 G, A* u7 I
————————————————
& Y5 x4 v% M; R
" \/ o* {; a6 W- Q3 {
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 02:03 , Processed in 0.025492 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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