记录在CentOS上用kolla-ansible部署rocky版本openstack遇到的问题

一些信息

  • topo
192.168.122.150 controller deployer
192.168.122.151 nova01
192.168.122.152 nova02
  • 系统版本
[root@localhost kolla]# cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)
[root@localhost kolla]# 
  • 使用的kolla-ansible版本
[root@controller kolla]# git clone https://github.com/openstack/kolla-ansible -b stable/rocky
  • docker版本
[root@localhost kolla]# docker --version
Docker version 18.03.1-ce, build 9ee9f40
[root@localhost kolla]# 
  • python包
[root@localhost kolla]# pip list 
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support it
Package                          Version
-------------------------------- ----------
ansible                          2.9.9
Babel                            2.8.0
backports.ssl-match-hostname     3.7.0.1
certifi                          2020.4.5.2
cffi                             1.14.0
chardet                          3.0.4
configobj                        4.7.2
cryptography                     2.9.2
debtcollector                    1.22.0
decorator                        3.4.0
docker                           4.2.1
enum34                           1.1.10
funcsigs                         1.0.2
httplib2                         0.9.2
idna                             2.9
iniparse                         0.4
ipaddress                        1.0.23
IPy                              0.75
iso8601                          0.1.12
Jinja2                           2.11.2
jmespath                         0.10.0
kitchen                          1.1.1
MarkupSafe                       1.1.1
monotonic                        1.5
netaddr                          0.7.19
netifaces                        0.10.9
oslo.config                      7.0.0
oslo.i18n                        3.25.1
oslo.utils                       3.42.1
paramiko                         2.1.1
pbr                              5.4.5
perf                             0.1
pip                              20.1.1
ply                              3.4
policycoreutils-default-encoding 0.1
pyasn1                           0.1.9
pycparser                        2.20
pycurl                           7.19.0
pygobject                        3.22.0
pygpgme                          0.3
pyliblzma                        0.5.3
pyparsing                        2.4.7
python-linux-procfs              0.4.9
pytz                             2020.1
pyudev                           0.15
pyxattr                          0.5.1
PyYAML                           5.3.1
requests                         2.23.0
rfc3986                          1.4.0
schedutils                       0.4
seobject                         0.1
sepolicy                         1.1
setuptools                       44.1.1
simplejson                       3.10.0
six                              1.15.0
slip                             0.4.0
slip.dbus                        0.4.0
stevedore                        1.32.0
urlgrabber                       3.10
urllib3                          1.25.9
websocket-client                 0.57.0
wheel                            0.34.2
wrapt                            1.12.1
yum-metadata-parser              1.1.4
[root@localhost kolla]# 
  • 配置文件
[root@localhost kolla]# cat /etc/kolla/globals.yml | grep -v ^# | grep -v ^$  
---
kolla_base_distro: "centos"
kolla_install_type: "source"
openstack_release: "rocky"
kolla_internal_vip_address: "192.168.122.150"
docker_registry: "192.168.122.150:5123"
docker_namespace: "kolla"
network_interface: "eth0"
neutron_external_interface: "eth1"
enable_haproxy: "no"
glance_enable_rolling_upgrade: "no"
nova_compute_virt_type: "qemu"
ironic_dnsmasq_dhcp_range:
tempest_image_id:
tempest_flavor_ref_id:
tempest_public_network_id:
tempest_floating_network_name:
[root@localhost kolla]# 
  • multinode信息
[control]
controller

[network]
controller

[inner-compute]

[external-compute]
nova01
nova02

[compute:children]
inner-compute
external-compute

[monitoring]
controller

[storage]

现象

  • bootstrap-servers报错
[root@localhost kolla]# kolla-ansible/tools/kolla-ansible -i multinode bootstrap-servers -vv
...

TASK [baremetal : Set firewall default policy] **********************************************************************************************************************************************************************************************
skipping: [controller]
skipping: [nova01]
skipping: [nova02]

TASK [baremetal : Check if firewalld is installed] ******************************************************************************************************************************************************************************************
[WARNING]: Consider using the yum, dnf or zypper module rather than running 'rpm'.  If you need to use command because yum, dnf or zypper is insufficient you can add 'warn: false' to this command task or set 'command_warnings=False' in
ansible.cfg to get rid of this message.
changed: [nova02]
changed: [nova01]
changed: [controller]

TASK [baremetal : Disable firewalld] ********************************************************************************************************************************************************************************************************
changed: [nova02] => (item=firewalld)
changed: [nova01] => (item=firewalld)
changed: [controller] => (item=firewalld)

TASK [baremetal : Check which containers are running] ***************************************************************************************************************************************************************************************
ok: [controller]
ok: [nova01]
ok: [nova02]

  SK [baremetal : Install apt packages] *****************************************************************************************************************************************************************************************************
fatal: [controller]: FAILED! => {"msg": "An unhandled exception occurred while templating '[u'{{ docker_apt_package }}', u'git', u'{% if not easy_install_available %}python-pip{% endif %}', u'python-setuptools', u'{% if enable_host_ntp }
fatal: [nova01]: FAILED! => {"msg": "An unhandled exception occurred while templating '[u'{{ docker_apt_package }}', u'git', u'{% if not easy_install_available %}python-pip{% endif %}', u'python-setuptools', u'{% if enable_host_ntp | bo}
fatal: [nova02]: FAILED! => {"msg": "An unhandled exception occurred while templating '[u'{{ docker_apt_package }}', u'git', u'{% if not easy_install_available %}python-pip{% endif %}', u'python-setuptools', u'{% if enable_host_ntp | bo}

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
controller                 : ok=19   changed=8    unreachable=0    failed=1    skipped=8    rescued=0    ignored=0   
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
nova01                     : ok=19   changed=8    unreachable=0    failed=1    skipped=8    rescued=0    ignored=0   
nova02                     : ok=19   changed=8    unreachable=0    failed=1    skipped=8    rescued=0    ignored=0   

Command failed ansible-playbook -i multinode -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=bootstrap-servers /root/kolla/kolla-ansible/ansible/kolla-host.yml 
[root@localhost kolla]# 

让人困惑的是,我用的是CentOS(redhat系),为什么会有apt的报错?

  • precheck报错
[root@localhost kolla]#  kolla-ansible/tools/kolla-ansible -i multinode prechecks -vv
...

TASK [prechecks : include_tasks] ************************************************************************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/prechecks/tasks/main.yml:6
included: /root/kolla/kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml for controller, localhost, nova01, nova02

TASK [prechecks : Checking Docker version] **************************************************************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml:2
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
fatal: [nova01]: FAILED! => {"msg": "The conditional check 'result | failed or result.stdout | regex_replace('.*(\\\\d+\\\\.\\\\d+\\\\.\\\\d+).*', '\\\\1') | version_compare(docker_version_min, '<')' failed. The error was: template erro}
fatal: [nova02]: FAILED! => {"msg": "The conditional check 'result | failed or result.stdout | regex_replace('.*(\\\\d+\\\\.\\\\d+\\\\.\\\\d+).*', '\\\\1') | version_compare(docker_version_min, '<')' failed. The error was: template erro}
fatal: [controller]: FAILED! => {"msg": "The conditional check 'result | failed or result.stdout | regex_replace('.*(\\\\d+\\\\.\\\\d+\\\\.\\\\d+).*', '\\\\1') | version_compare(docker_version_min, '<')' failed. The error was: template }

TASK [prechecks : Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails] *******************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml:13
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'result.stdout | regex_replace('(.*ssh_key.*)', '') | search(\":\")' failed. The error was: template error while templating string: no filter named 'search'. String: {% if re}

NO MORE HOSTS LEFT **************************************************************************************************************************************************************************************************************************

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
controller                 : ok=4    changed=0    unreachable=0    failed=1    skipped=6    rescued=0    ignored=0   
localhost                  : ok=3    changed=0    unreachable=0    failed=1    skipped=4    rescued=0    ignored=0   
nova01                     : ok=4    changed=0    unreachable=0    failed=1    skipped=6    rescued=0    ignored=0   
nova02                     : ok=4    changed=0    unreachable=0    failed=1    skipped=6    rescued=0    ignored=0   

Command failed ansible-playbook -i multinode -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=precheck /root/kolla/kolla-ansible/ansible/site.yml  --verbose --verbose
[root@localhost kolla]# 
  • deploy报错
[root@localhost kolla]# kolla-ansible/tools/kolla-ansible -i multinode deploy -vv
...

TASK [mariadb : Creating temp file on localhost] ********************************************************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/mariadb/tasks/lookup_cluster.yml:8
ok: [controller -> localhost] => {"changed": false, "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "dest": "/tmp/kolla_mariadb_cluster", "gid": 0, "group": "root", "md5sum": "d41d8cd98f00b204e9800998ecf8427e", "mode": "0644", "}

TASK [mariadb : Creating mariadb volume] ****************************************************************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/mariadb/tasks/lookup_cluster.yml:14
changed: [controller] => {"changed": true, "result": false}

TASK [mariadb : Writing hostname of host with existing cluster files to temp file] **********************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/mariadb/tasks/lookup_cluster.yml:22
fatal: [controller]: FAILED! => {"msg": "The conditional check 'not mariadb_volume | changed' failed. The error was: template error while templating string: no filter named 'changed'. String: {% if not mariadb_volume | changed %} True {}

RUNNING HANDLER [mariadb : restart slave mariadb] *******************************************************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/mariadb/handlers/main.yml:64

RUNNING HANDLER [mariadb : restart master mariadb] ******************************************************************************************************************************************************************************************
task path: /root/kolla/kolla-ansible/ansible/roles/mariadb/handlers/main.yml:109

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
controller                 : ok=53   changed=30   unreachable=0    failed=1    skipped=32   rescued=0    ignored=0   
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=7    rescued=0    ignored=0   
nova01                     : ok=32   changed=20   unreachable=0    failed=0    skipped=15   rescued=0    ignored=0   
nova02                     : ok=32   changed=20   unreachable=0    failed=0    skipped=15   rescued=0    ignored=0   

Command failed ansible-playbook -i multinode -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e kolla_action=deploy /root/kolla/kolla-ansible/ansible/site.yml  --verbose --verbose
[root@localhost kolla]# 

你可能感兴趣的:(OpenStack)