Bootstrap

kolla-ansible 部署一主一计算 openstack环境

原文地址:https://www.cnblogs.com/diantong/p/12010193.html

(1).实验环境

主机名IP地址角色内存网卡CPU磁盘
OpenStack-con192.168.128.110controller(控制)8G桥接网卡ens32和ens334核200G

OpenStack-com

192.168.128.111compute(计算)4G桥接网卡ens324核20G
OpenStack-sto192.168.128.112storage(存储)4G桥接网卡ens324核2个20G

 

(2).准备工作

  三台主机都安装<Tab>键补全软件包和vim软件包

1

yum -y install bash-completion.noarch vim

  三台主机都关闭firewalld和SELinux

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

# vim /etc/selinux/config

SELINUX=disabled

# setenforce 0

# getenforce

Permissive

# systemctl disable firewalld && systemctl stop firewalld

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@OpenStack-con ~]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)

   Active: inactive (dead)

     Docs: man:firewalld(1)

 

12月 27 10:43:55 OpenStack-con systemd[1]: Starting firewalld - dynamic firewall daemon...

12月 27 10:44:01 OpenStack-con systemd[1]: Started firewalld - dynamic firewall daemon.

12月 27 11:03:53 OpenStack-con systemd[1]: Stopping firewalld - dynamic firewall daemon...

12月 27 11:03:54 OpenStack-con systemd[1]: Stopped firewalld - dynamic firewall daemon.

  在OpenStack-con(110)上配置hosts文件,并复制到另两台主机上

1

2

3

4

5

6

[root@OpenStack-con ~]# vim /etc/hosts

192.168.128.110 OpenStack-con

192.168.128.111 OpenStack-com

192.168.128.112 OpenStack-sto

[root@OpenStack-con ~]# scp /etc/hosts 192.168.128.111:/etc/

[root@OpenStack-con ~]# scp /etc/hosts 192.168.128.112:/etc/

  修改OpenStack-con(110)的ens33配置文件


  
  
  1. cat /etc/sysconfig/network-scripts/ifcfg-ens33
  2. TYPE= Ethernet
  3. PROXY_METHOD= none
  4. BROWSER_ONLY= no
  5. BOOTPROTO= static
  6. DEFROUTE= yes
  7. IPV4_FAILURE_FATAL= no
  8. IPV6INIT= yes
  9. IPV6_AUTOCONF= yes
  10. IPV6_DEFROUTE= yes
  11. IPV6_FAILURE_FATAL= no
  12. IPV6_ADDR_GEN_MODE= stable-privacy
  13. NAME= ens33
  14. UUID= 5d75beff-0040-4572-bcda-6e8e1ff9c070
  15. DEVICE= ens33
  16. ONBOOT= yes
  17. IPADDR= 192.168.23.103
  18. NETMASK= 255.255.255.0
  19. GATEWAY= 192.168.23.2
  20. DNS1= 192.168.23.2
  21. pmysqlclient
  22. DNS3= 8.8.8.8

1

2

3

4

5

6

7

8

9

[root@OpenStack-con ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33

//只放以下内容

TYPE=Ethernet

BOOTPROTO=none  //静态获取IP

ONBOOT=yes  //启用网卡

PROXY_METHOD=none

NAME=ens33

DEVICE=ens33

[root@OpenStack-con ~]# systemctl restart network

(3).安装ansible

 1)在OpenStack-con(110)主机上安装并更新pip工具

1

2

3

4

5

6

7

8

9

10

11

12

13

//安装epel源

[root@OpenStack-con ~]# yum -y install epel-release

[root@OpenStack-con ~]# yum -y install python-pip

[root@OpenStack-con ~]# mkdir .pip

//配置pip软件包源

[root@OpenStack-con ~]# tee /root/.pip/pip.conf << 'EOF'

[global]

index-url = http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

EOF

//更新pip

[root@OpenStack-con ~]# pip install -U pip

 2)配置OpenStack-com(111)和OpenStack-sto(112)pip软件包源

  注意:这一步是为了后期安装

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

//OpenStack-com(111)执行一次

[root@OpenStack-com ~]# mkdir .pip

[root@OpenStack-com ~]# tee /root/.pip/pip.conf << 'EOF'

[global]

index-url = http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

EOF

//OpenStack-sto(112)执行一次

[root@OpenStack-sto ~]# mkdir .pip

[root@OpenStack-sto ~]# tee /root/.pip/pip.conf << 'EOF'

[global]

index-url = http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

EOF

 3)在OpenStack-con(110)上安装ansible

1

2

3

//安装依赖包

[root@OpenStack-con ~]# yum -y install python-devel libffi-devel gcc openssl-devel libselinux-python

[root@OpenStack-con ~]# pip install ansible

 4)在OpenStack-con(110)上配置ansible参数

  注意:pip安装的ansible是没有配置文件的,此时需要前往github将默认配置文件拷贝下来。网址:https://github.com/ansible/ansible/blob/devel/examples/ansible.cfg

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

[root@OpenStack-con ~]# ansible --version  //可以看到此时是没有配置文件的

ansible 2.9.2

  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

  ansible python module location = /usr/lib/python2.7/site-packages/ansible

  executable location = /usr/bin/ansible

  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

//生成配置文件

[root@OpenStack-con ~]# mkdir /etc/ansible

[root@OpenStack-con ~]# vim /etc/ansible/ansible.cfg

[root@OpenStack-con ~]# ansible --version  //已经自动加载了配置文件

ansible 2.9.2

  config file = /etc/ansible/ansible.cfg

  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

  ansible python module location = /usr/lib/python2.7/site-packages/ansible

  executable location = /usr/bin/ansible

  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

  然后开始优化

1

2

3

4

5

[root@OpenStack-con ~]# vim /etc/ansible/ansible.cfg

forks           = 10  //第19行,设置并行进程数。如果要管理的主机很多,可以优先尝试增加该值

host_key_checking = False  //第67行,跳过ssh首次连接提示验证部分

pipelining = True  //第403行,开启管道输送。ansible在执行一个模块需要ssh到目的主机多次,开启该模式减少ssh连接次数,缩短ansible执行时间。

//在部署大规模服务器或引用模块非常多时,开启pipelining会给ansible带来显著的性能提升

(4).OpenStack-sto(112)配置cinder(块存储)信息

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

[root@OpenStack-sto ~]# yum -y install yum-utils device-mapper-persistent-data lvm2  //安装相关软件包

[root@OpenStack-sto ~]# pvs  //查看已经存在的pv

  PV         VG     Fmt  Attr PSize   PFree

  /dev/sda2  centos lvm2 a--  <19.00g    0

[root@OpenStack-sto ~]# pvcreate /dev/sdb

  Physical volume "/dev/sdb" successfully created.

[root@OpenStack-sto ~]# vgcreate cinder /dev/sdb

  Volume group "cinder" successfully created

[root@OpenStack-sto ~]# systemctl status lvm2-lvmetad.service  //保证开机自启

● lvm2-lvmetad.service - LVM2 metadata daemon

   Loaded: loaded (/usr/lib/systemd/system/lvm2-lvmetad.service; static; vendor preset: enabled)

   Active: active (running) since 二 2019-12-17 15:26:11 CST; 20min ago

     Docs: man:lvmetad(8)

 Main PID: 11954 (lvmetad)

   CGroup: /system.slice/lvm2-lvmetad.service

           └─11954 /usr/sbin/lvmetad -f

 

12月 17 15:26:11 OpenStack-sto systemd[1]: Started LVM2 metadata daemon.

12月 17 15:26:11 OpenStack-sto systemd[1]: Starting LVM2 metadata daemon...

(5).在OpenStack-con(110)上安装kolla-ansible并自定义OpenStack的相关配置文件

 1)安装kolla-ansible

  注意:最新的版本需要指定,否则报错

1

2

3

4

//stein版本采用如下命令,我这里就是使用的stein版本

[root@OpenStack-con ~]# pip install kolla-ansible==8.0.1 --ignore-installed PyYAML

//train版本采用如下命令

[root@OpenStack-con ~]# pip install kolla-ansible==9.0.1 --ignore-installed PyYAML

  提供错误用于对比

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

//在部署高可用mysql用户时,提示无法解析内部模块

[root@OpenStack-con ~]# kolla-ansible deploy -i /etc/kolla/multinode

......

TASK [mariadb : Creating haproxy mysql user] ***********************************************************************************************************************************

fatal: [192.168.128.110]: FAILED! => { "changed"false"msg""Can not parse the inner module output: localhost | SUCCESS => {\n "changed": false, \n "user": "haproxy"\n}\n"}

//查看kolla下的mariadb日志文件,没有error或ERROR

[root@OpenStack-con ~]# cat /var/log/kolla/mariadb/mariadb.log | grep fail

2020-01-03 10:29:58 0 [Warning] WSREP: access file(/var/lib/mysql//gvwstate.dat) failed(No such file or directory)

2020-01-03 10:29:58 0 [Note] WSREP: restore pc from disk failed

2020-01-03 10:30:13 0 [Warning] WSREP: access file(/var/lib/mysql//gvwstate.dat) failed(No such file or directory)

2020-01-03 10:30:13 0 [Note] WSREP: restore pc from disk failed

2020-01-03 11:11:29 0 [Warning] WSREP: access file(/var/lib/mysql//gvwstate.dat) failed(No such file or directory)

2020-01-03 11:11:29 0 [Note] WSREP: restore pc from disk failed

//查看kolla下的ansible日志文件

[root@OpenStack-con ~]# vim /var/log/kolla/ansible.log

2020-01-03 13:33:25,107 p=127 u=ansible | localhost | SUCCESS => {

"changed"false,

"user""haproxy"

}

//另外mariadb实例可以进入,密码可以正常登录

 2)复制kolla-ansible的相关配置文件

1

2

3

4

[root@OpenStack-con ~]# cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/

[root@OpenStack-con ~]# cp /usr/share/kolla-ansible/ansible/inventory/* /etc/kolla/

[root@OpenStack-con ~]# ls /etc/kolla/

all-in-one  globals.yml  multinode  passwords.yml

  文件说明:all-in-one是安装单节点OpenStack的ansible自动安装配置文件;multinode是安装多节点OpenStack的ansible自动安装配置文件;globals.yml是OpenStack部署的自定义配置文件;passwords.yml是OpenStack中各个服务的密码文件。

 3)生成密钥,并授权三台主机

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

[root@OpenStack-con ~]# ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:MlEHvdjHadF+ydFC80Gg0u/sKcP+hvC8gDpvHTOGuL4 root@OpenStack-con

The key's randomart image is:

+---[RSA 2048]----+

|        oo.  +=o.|

|       . .o o o+o|

|      .  + = +..+|

|       .. + * .o.|

|      + S  o . . |

|     . +.*  o    |

|      ..o.O .o   |

|     o.. ..B...  |

|    .E=.  .o*+   |

+----[SHA256]-----+

[root@OpenStack-con ~]# ssh-copy-id -i .ssh/id_rsa.pub root@OpenStack-con

[root@OpenStack-con ~]# ssh-copy-id -i .ssh/id_rsa.pub root@OpenStack-com

[root@OpenStack-con ~]# ssh-copy-id -i .ssh/id_rsa.pub root@OpenStack-sto

 4)配置multinode多节点主机清单文件

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

[root@OpenStack-con ~]# vim /etc/kolla/multinode  //修改模块名不带:chilldren的部分

# These initial groups are the only groups required to be modified. The

# additional groups are for more control of the environment.

[control]  #控制模块

# These hostname must be resolvable from your deployment host

OpenStack-con  #给110主机

 

# The above can also be specified as follows:

#control[01:03]     ansible_user=kolla

 

# The network nodes are where your l3-agent and loadbalancers will run

# This can be the same as a host in the control group

[network]  #网络模块

OpenStack-con  #给110主机

 

[compute]  #计算模块

OpenStack-com  #给111主机

 

[monitoring]  #监控模块

OpenStack-con  #给110主机

 

# When compute nodes and control nodes use different interfaces,

# you need to comment out "api_interface" and other interfaces from the globals.yml

# and specify like below:

#compute01 neutron_external_interface=eth0 api_interface=em1 storage_interface=em1 tunnel_interface=em1

 

[storage]  #存储模块

OpenStack-sto  #给112主机

 

[deployment]  #部署模块

OpenStack-con  #给110主机

 5)检测所有主机是否正常通信

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

[root@OpenStack-con ~]# ansible -i /etc/kolla/multinode all -m ping

[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to

allow bad characters in group names by defaultthis will change, but still be

user configurable on deprecation. This feature will be removed in version 2.10.

 Deprecation warnings can be disabled by setting deprecation_warnings=False in

ansible.cfg.

[WARNING]: Invalid characters were found in group names but not replaced, use

-vvvv to see details

 

OpenStack-con | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python""/usr/bin/python"

    },

    "changed"false,

    "ping""pong"

}

OpenStack-com | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python""/usr/bin/python"

    },

    "changed"false,

    "ping""pong"

}

OpenStack-sto | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python""/usr/bin/python"

    },

    "changed"false,

    "ping""pong"

}

 6)自动生成OpenStack各服务的密码文件

1

2

3

[root@OpenStack-con ~]# kolla-genpwd

[root@OpenStack-con ~]# vim /etc/kolla/passwords.yml

keystone_admin_password: 123456    //第165行,修改网页登录密码

 7)编辑/etc/kolla/global.yml自定义OpenStack中的部署事项

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

[root@OpenStack-con ~]# vim /etc/kolla/globals.yml

//第14行和第15行,选择下载的基础镜像,5选1

# Valid options are ['centos', 'debian', 'oraclelinux', 'rhel', 'ubuntu']

kolla_base_distro: "centos"

  

//第17行和第18行,选择的安装方法,2选1。binary二进制安装,source源码安装

# Valid options are [ binary, source ]

kolla_install_type: "source"

  

//第20行和第21行,选择OpenStack的版本标签,详细请看:https://releases.openstack.org/

# Valid option is Docker repository tag

openstack_release: "stein"  //注意版本必须小写,后期下载的OpenStack相关的docker镜像标签也为stein。我是train版本失败,才换成stein

  

//第23行和第24行,存放配置文件的位置

# Location of configuration overrides

#node_custom_config: "/etc/kolla/config"  //默认存放地址

  

//第31行,OpenStack内部管理网络地址,通过该IP访问OpenStack Web页面进行管理。如果启用了高可用,需要设置为VIP(漂移IP)

kolla_internal_vip_address: "192.168.128.110"

  

//第87行,OpenStack内部管理网络地址的网卡接口

network_interface: "ens32"

 

//第92~94、97~98行去除注释,使内部通信网络都走ens32

api_interface: "{ { network_interface }}"

storage_interface: "{ { network_interface }}"

cluster_interface: "{ { network_interface }}"

tunnel_interface: "{ { network_interface }}"

dns_interface: "{ { network_interface }}"

  

//第105行,OpenStack外部(或公共)网络的网卡接口,可以是vlan模式或flat模式。

//此网卡应该在没有IP地址的情况下处于活动,如果不是,那么OpenStack云平台中的云主机实例将无法访问外部网络。(存在IP时br-ex桥接就不成功)

neutron_external_interface: "ens33"

  

//第190行,关闭高可用

enable_haproxy: "no"

 

//第213行,启用cinder(块存储)

enable_cinder: "yes"

 

//第218行,cinder(块存储)后端启用lvm

enable_cinder_backend_lvm: "yes"

 

//第421行,cinder(块存储)的卷组名称,需要和OpenStack-sto主机上的一致

cinder_volume_group: "cinder"

 

//第443行和第444行,指定nova-compute守护进程使用的虚拟化技术。(kvm好像有点问题,大家可以试试,看看你们能不能过nova下载)

//nova-compute是一个非常重要的守护进程,负责创建和终止虚拟机实例,即管理虚拟机实例的生命周期

# Valid options are [ qemu, kvm, vmware, xenapi ]

nova_compute_virt_type: "qemu"

 8)通过kolla-ansible安装OpenStack所需依赖包

  注意:此时会对三台主机都进行操作,请保持网络畅通。报错不用担心,请重新运行命令语句。

1

2

3

4

5

[root@OpenStack-con ~]# kolla-ansible -i /etc/kolla/multinode bootstrap-servers

PLAY RECAP *********************************************************************

OpenStack-com              : ok=40   changed=23   unreachable=0    failed=0    skipped=32   rescued=0    ignored=0  

OpenStack-con              : ok=40   changed=21   unreachable=0    failed=0    skipped=32   rescued=0    ignored=0  

OpenStack-sto              : ok=40   changed=23   unreachable=0    failed=0    skipped=32   rescued=0    ignored=0

9)编辑docker volume卷挂载方式,并指定docker加速器

  注意:三台主机都需要进行设置,设置方法一样

1

2

3

4

5

6

7

8

9

10

11

12

13

//由于不存在docker卷挂载配置文件,所以需要手动生成

# mkdir -p /etc/systemd/system/docker.service.d/

# vim /etc/systemd/system/docker.service.d/kolla.conf

[Service]

MountFlags=shared

//指定加速器,这里使用阿里云的加速器

# tee /etc/docker/daemon.json << 'EOF'

{

  "registry-mirrors": ["https://a5aghnme.mirror.aliyuncs.com

"]

}

EOF

# systemctl daemon-reload

# systemctl restart docker && systemctl enable docker

 10)拉取OpenStack的镜像

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

[root@OpenStack-con ~]# kolla-ansible -i /etc/kolla/multinode pull

PLAY RECAP *********************************************************************

OpenStack-com              : ok=18   changed=6    unreachable=0    failed=0    skipped=11   rescued=0    ignored=0  

OpenStack-con              : ok=37   changed=15   unreachable=0    failed=0    skipped=52   rescued=0    ignored=0  

OpenStack-sto              : ok=14   changed=4    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0

[root@OpenStack-con ~]# docker images | grep kolla |wc -l

59

[root@OpenStack-con ~]# docker images

REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE

kolla/centos-binary-keystone-fernet             stein               72f0bae505fe        20 hours ago        1.04GB

kolla/centos-binary-keystone-ssh                stein               fb8fc703d9eb        20 hours ago        1.04GB

kolla/centos-binary-keystone                    stein               2d17d726f53d        20 hours ago        1.04GB

kolla/centos-binary-heat-api                    stein               afed025af3c4        20 hours ago        1.02GB

kolla/centos-binary-heat-api-cfn                stein               d0afede64c55        20 hours ago        1.02GB

kolla/centos-binary-heat-engine                 stein               05028ad12780        20 hours ago        1.02GB

kolla/centos-binary-cinder-api                  stein               46be58e7f676        20 hours ago        1.19GB

kolla/centos-binary-cinder-scheduler            stein               e8243fedab80        20 hours ago        1.1GB

kolla/centos-binary-nova-api                    stein               111d2392bf8e        20 hours ago        1.08GB

kolla/centos-binary-nova-novncproxy             stein               e717e391a9b6        20 hours ago        1.05GB

kolla/centos-binary-nova-conductor              stein               17f5ec108ffa        20 hours ago        1.04GB

kolla/centos-binary-nova-scheduler              stein               b6d8a40ae9ac        20 hours ago        1.04GB

kolla/centos-binary-glance-api                  stein               d2249e1a4935        20 hours ago        1.04GB

kolla/centos-binary-neutron-l3-agent            stein               1d32dc99e8a2        20 hours ago        1.08GB

kolla/centos-binary-neutron-openvswitch-agent   stein               647ef07fc6ae        20 hours ago        1.08GB

kolla/centos-binary-neutron-server              stein               dc2362806d50        20 hours ago        1.08GB

kolla/centos-binary-neutron-dhcp-agent          stein               0fab1de92d76        20 hours ago        1.04GB

kolla/centos-binary-horizon                     stein               f1aa61435a02        20 hours ago        1.21GB

kolla/centos-binary-placement-api               stein               03d91d2015d8        20 hours ago        1.05GB

kolla/centos-binary-openvswitch-db-server       stein               afa614377634        20 hours ago        423MB

kolla/centos-binary-openvswitch-vswitchd        stein               504bac87dc3a        20 hours ago        423MB

kolla/centos-binary-mariadb                     stein               faa1ccc316bb        20 hours ago        594MB

kolla/centos-binary-chrony                      stein               bce4d6909cb3        20 hours ago        407MB

kolla/centos-binary-cron                        stein               a87749b5addd        20 hours ago        406MB

kolla/centos-binary-memcached                   stein               044390c82ab2        20 hours ago        407MB

kolla/centos-binary-kolla-toolbox               stein               20cb6d293506        20 hours ago        697MB

kolla/centos-binary-fluentd                     stein               8bf3269af141        20 hours ago        540MB

kolla/centos-binary-rabbitmq                    stein               a8d8b0865dac        20 hours ago        486MB

kolla/centos-binary-nova-consoleauth            stein               41f28ce37a48        7 days ago          1.04GB

kolla/centos-source-horizon                     stein               fd11d967a930        8 weeks ago         1.04GB

kolla/centos-source-cinder-api                  stein               a7a9dd3a1fbc        8 weeks ago         1.09GB

kolla/centos-source-neutron-server              stein               94084ae4da8f        8 weeks ago         1.03GB

kolla/centos-source-cinder-scheduler            stein               78d79bd7a6c1        8 weeks ago         1.02GB

kolla/centos-source-heat-engine                 stein               92dd229552db        8 weeks ago         895MB

kolla/centos-source-heat-api                    stein               f14709856b5e        8 weeks ago         895MB

kolla/centos-source-heat-api-cfn                stein               0c68cf4fa817        8 weeks ago         895MB

kolla/centos-source-keystone-ssh                stein               459b6fef664a        8 weeks ago         922MB

kolla/centos-source-keystone-fernet             stein               b8151b6c6fa9        8 weeks ago         921MB

kolla/centos-source-keystone                    stein               e524b963dcbe        8 weeks ago         921MB

kolla/centos-source-neutron-l3-agent            stein               9bef84e9a9c2        8 weeks ago         1.04GB

kolla/centos-source-neutron-openvswitch-agent   stein               22abae3cc055        8 weeks ago         1GB

kolla/centos-source-neutron-dhcp-agent          stein               f3127a4eed62        8 weeks ago         1GB

kolla/centos-source-neutron-metadata-agent      stein               84570a9474b5        8 weeks ago         1GB

kolla/centos-source-glance-api                  stein               847137510938        8 weeks ago         911MB

kolla/centos-source-nova-api                    stein               8054ea5b26a8        8 weeks ago         1.09GB

kolla/centos-source-nova-novncproxy             stein               70443bcd9875        8 weeks ago         1.06GB

kolla/centos-source-nova-scheduler              stein               128505029c6e        8 weeks ago         1.03GB

kolla/centos-source-nova-conductor              stein               4fa117f0c54a        8 weeks ago         1.03GB

kolla/centos-source-placement-api               stein               e07c6cd6ad27        8 weeks ago         920MB

kolla/centos-source-openvswitch-db-server       stein               3105bdab8aad        8 weeks ago         424MB

kolla/centos-source-mariadb                     stein               726aed6cb178        8 weeks ago         594MB

kolla/centos-source-rabbitmq                    stein               e6a3b5157ec9        8 weeks ago         486MB

kolla/centos-source-memcached                   stein               72ed677d49f8        8 weeks ago         407MB

kolla/centos-source-chrony                      stein               5b073a8c3ca2        8 weeks ago         407MB

kolla/centos-source-cron                        stein               c19e735f5b76        8 weeks ago         406MB

kolla/centos-source-openvswitch-vswitchd        stein               757c347670f1        8 weeks ago         424MB

kolla/centos-source-fluentd                     stein               7b946e0d6253        8 weeks ago         540MB

kolla/centos-source-kolla-toolbox               stein               1fdf021874ba        8 weeks ago         688MB

kolla/centos-binary-neutron-metadata-agent      stein               8fbad310e219        2 months ago        1.04GB

 

[root@OpenStack-com ~]# docker images | grep kolla | wc -l

22

[root@OpenStack-com ~]# docker images

REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE

kolla/centos-binary-nova-compute                stein               1301444e4ce4        20 hours ago        1.81GB

kolla/centos-binary-nova-ssh                    stein               67b810ba9fd4        20 hours ago        1.05GB

kolla/centos-binary-neutron-openvswitch-agent   stein               647ef07fc6ae        20 hours ago        1.08GB

kolla/centos-binary-openvswitch-db-server       stein               afa614377634        20 hours ago        423MB

kolla/centos-binary-openvswitch-vswitchd        stein               504bac87dc3a        20 hours ago        423MB

kolla/centos-binary-nova-libvirt                stein               a8914e748a56        20 hours ago        1.21GB

kolla/centos-binary-chrony                      stein               bce4d6909cb3        20 hours ago        407MB

kolla/centos-binary-cron                        stein               a87749b5addd        20 hours ago        406MB

kolla/centos-binary-kolla-toolbox               stein               20cb6d293506        20 hours ago        697MB

kolla/centos-binary-fluentd                     stein               8bf3269af141        20 hours ago        540MB

kolla/centos-binary-iscsid                      stein               ec09ef36eb84        20 hours ago        411MB

kolla/centos-source-nova-compute                stein               e18a50090933        8 weeks ago         1.85GB

kolla/centos-source-neutron-openvswitch-agent   stein               22abae3cc055        8 weeks ago         1GB

kolla/centos-source-nova-ssh                    stein               f8583c071c07        8 weeks ago         1.06GB

kolla/centos-source-openvswitch-vswitchd        stein               a939df78a335        8 weeks ago         424MB

kolla/centos-source-openvswitch-db-server       stein               3105bdab8aad        8 weeks ago         424MB

kolla/centos-source-nova-libvirt                stein               77836fa773c8        8 weeks ago         1.2GB

kolla/centos-source-kolla-toolbox               stein               4a67f40cdd71        8 weeks ago         688MB

kolla/centos-source-chrony                      stein               5b073a8c3ca2        8 weeks ago         407MB

kolla/centos-source-iscsid                      stein               fa88a664b28c        8 weeks ago         411MB

kolla/centos-source-cron                        stein               c19e735f5b76        8 weeks ago         406MB

kolla/centos-source-fluentd                     stein               7b946e0d6253        8 weeks ago         540MB

 

[root@OpenStack-sto ~]# docker images | grep kolla | wc -l

16

[root@OpenStack-sto ~]# docker images

REPOSITORY                          TAG                 IMAGE ID            CREATED             SIZE

kolla/centos-binary-cinder-volume   stein               e5903d4118f9        20 hours ago        1.14GB

kolla/centos-binary-cinder-backup   stein               3778ba53a0af        20 hours ago        1.13GB

kolla/centos-binary-chrony          stein               bce4d6909cb3        20 hours ago        407MB

kolla/centos-binary-cron            stein               a87749b5addd        20 hours ago        406MB

kolla/centos-binary-tgtd            stein               c10e8a22cd18        20 hours ago        405MB

kolla/centos-binary-kolla-toolbox   stein               20cb6d293506        20 hours ago        697MB

kolla/centos-binary-fluentd         stein               8bf3269af141        20 hours ago        540MB

kolla/centos-binary-iscsid          stein               ec09ef36eb84        20 hours ago        411MB

kolla/centos-source-cinder-volume   stein               937e4592e1f3        8 weeks ago         1.1GB

kolla/centos-source-cinder-backup   stein               717e08a70bdf        8 weeks ago         1.09GB

kolla/centos-source-kolla-toolbox   stein               4a67f40cdd71        8 weeks ago         688MB

kolla/centos-source-chrony          stein               5b073a8c3ca2        8 weeks ago         407MB

kolla/centos-source-iscsid          stein               fa88a664b28c        8 weeks ago         411MB

kolla/centos-source-cron            stein               c19e735f5b76        8 weeks ago         406MB

kolla/centos-source-tgtd            stein               7d4895d43472        8 weeks ago         406MB

kolla/centos-source-fluentd         stein               7b946e0d6253        8 weeks ago         540MB

  拉取时,如果报错,可以尝试重新拉取。检查配置文件是否有问题,没有问题的前提下可以尝试换版本进行操作。

 

11)对主机进行预部署检查

1

2

3

4

5

[root@OpenStack-con ~]# kolla-ansible -i /etc/kolla/multinode prechecks

PLAY RECAP *********************************************************************

OpenStack-com              : ok=30   changed=0    unreachable=0    failed=0    skipped=22   rescued=0    ignored=0  

OpenStack-con              : ok=70   changed=0    unreachable=0    failed=0    skipped=77   rescued=0    ignored=0  

OpenStack-sto              : ok=23   changed=0    unreachable=0    failed=0    skipped=11   rescued=0    ignored=0

 

 12)部署OpenStack

  部署OpenStack

 

1

2

3

4

5

[root@OpenStack-con ~]# kolla-ansible -i /etc/kolla/multinode deploy

PLAY RECAP ***********************************

OpenStack-com              : ok=80   changed=38   unreachable=0    failed=0    skipped=54   rescued=0    ignored=0  

OpenStack-con              : ok=292  changed=161  unreachable=0    failed=0    skipped=144  rescued=0    ignored=0  

OpenStack-sto              : ok=51   changed=20   unreachable=0    failed=0    skipped=23   rescued=0    ignored=0

 

 13)验证部署

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

[root@OpenStack-con ~]# kolla-ansible -i /etc/kolla/multinode post-deploy

PLAY RECAP *********************************************************************

localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

[root@OpenStack-con ~]# cat /etc/kolla/admin-openrc.sh  //会生成该文件,查看一下

# Clear any old environment that may conflict.

for key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset $key ; done

export OS_PROJECT_DOMAIN_NAME=Default

export OS_USER_DOMAIN_NAME=Default

export OS_PROJECT_NAME=admin

export OS_TENANT_NAME=admin

export OS_USERNAME=admin  //网页的账号

export OS_PASSWORD=123456  //网页的密码

export OS_AUTH_URL=http://192.168.128.110:35357/v3

export OS_INTERFACE=internal

export OS_IDENTITY_API_VERSION=3

export OS_REGION_NAME=RegionOne

export OS_AUTH_PLUGIN=password

 14)使用内网的Windows测试

 

分类: OpenStack

;