KollaOpenstack部署
官方地址:https://docs.openstack.org/kolla-ansible/latest/user/quickstart.html
此部署流程基于 MacBook Air M3 + Vmware Rocky9 部署
时长…………网络不好且问题较多的情况下,有可能是一天的时间
虚拟机要求
- 2 个网口
- 8GB 最少内存
Vmware 安装以及虚拟机安装请自行操作
虚拟机双网口设置
网卡添加


解锁之后点击 + 号

取消以下两个选择

之后添加虚拟机网卡



选择新建的无 DHCP 和 NAT 的网卡

网络显示如图

OpenStack 安装
python 版本
根据:https://governance.openstack.org/tc/reference/runtimes/2025.2.html中显示Python的最低版本为3.10,而 Rocky 9 的版本则为 3.9,所以首先需要更新 Python 版本


DNF 直接安装


将 python 3.11 设置别名为 python 和 python 3
sudo dnf install wget vim -y
vim /etc/profile
# 在尾部追加以下两行
alias python="python3.11"
alias python3="python3.11"
source /etc/profile

开始安装
根据文档中选择 Rocky 安装依赖项

创建并进入 python 的虚拟环境以及升级 pip (不进虚拟环境安装会出现意想不到的 bug 哦)

安装 Kolla-ansible (第一步 pip 会很慢,可能需要……20 min+哦)

需要耐心等待红框的出现 (20 min 左右,视网络情况而定)

安装 Koll-Ansible 依赖项

初始化密码

开始配置 Kolla globals. yml
注意
kolla_base_distro: "rocky"Rocky修改为debiannetwork_interface: "eth0"eth0 修改为ip a显示 ip 地址的(ens160)neutron_external_interface: "eth1"eth1 修改为ip a不显示 ip 地址的(ens192)kolla_internal_vip_address: "10.1.0.250"ip 修改为network_interface同网段但未使用的 ip 地址
配置可以简化为
kolla_base_distro: "debian"
openstack_tag_suffix: "-aarch64"
network_interface: "ens160"
neutron_external_interface: "ensxxx"
kolla_internal_vip_address: "xxx.xxx.xxx.xxx"

部署

常见问题
报错信息: fatal: [localhost]: FAILED! => {"changed": false, "failures": [], "msg": "Failed to download packages: docker-buildx-plugin-0.25.0-1.el9.aarch64: Cannot download, all mirrors were already tried without success", "rc": 1, "results": []} 报错信息:fatal: [localhost]: FAILED! => {"changed": false, "msg": "failed to fetch key at https://download.docker.com/linux/centos/gpg , error was: Request failed: <urlopen error [Errno 104] Connection reset by peer>"}
解决方式:手动下载:https://download.docker.com/linux/centos/gpg并命名为docker.gpg, 使用 sudo rpm --import docker.gpg 进行安装


报错信息:
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/path/to/venv/bin/pip3.11", "install", "docker>=7.0.0", "requests", "dbus-python"], "msg": "stdout: Collecting docker>=7.0.0\n Downloading docker-7.1.0-py3-none-any.whl.metadata (3.8 kB)\nRequirement already satisfied: requests in /path/to/venv/lib64/python3.11/site-packages (2.32.4)\nCollecting dbus-python\n Downloading dbus-python-1.4.0.tar.gz (232 kB)\n Installing build dependencies: started\n Installing build dependencies: finished with status 'done'\n Getting requirements to build wheel: started\n Getting requirements to build wheel: finished with status 'done'\n Preparing metadata (pyproject.toml): started\n Preparing metadata (pyproject.toml): finished with status 'error'\n\n:stderr: error: subprocess-exited-with-error\n \n × Preparing metadata (pyproject.toml) did not run successfully.\n │ exit code: 1\n ╰─> [101 lines of output]\n + meson setup /tmp/pip-install-cla9g86l/dbus-python_7ad9975efa124f489b287d23f1270416 /tmp/pip-install-cla9g86l/dbus-python_7ad9975efa124f489b287d23f1270416/.mesonpy-5tnz3d1g -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-cla9g86l/dbus-python_7ad9975efa124f489b287d23f1270416/.mesonpy-5tnz3d1g/meson-python-native-file.ini\n The Meson build system\n Version: 1.8.2\n Source dir: /tmp/pip-install-cla9g86l/dbus-python_7ad9975efa124f489b287d23f1270416\n Build dir: /tmp/pip-install-cla9g86l/dbus-python_7ad9975efa124f489b287d23f1270416/.mesonpy-5tnz3d1g\n Build type: native build\n Project name: dbus-python\n Project version: 1.4.0\n C compiler for the host machine: cc (gcc 11.5.0 \"cc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5)\")\n C linker for the host machine: cc ld.bfd 2.35.2-63\n Host machine cpu family: aarch64\n Host machine cpu: aarch64\n Compiler for C supports arguments -fno-common: YES\n Compiler for C supports arguments -Wno-missing-field-initializers: YES\n Compiler for C supports arguments -Wno-declaration-after-statement: YES\n Compiler for C supports arguments -Wno-inline: YES\n Compiler for C supports arguments -Wno-redundant-decls: YES\n Compiler for C supports arguments -Wno-switch-default: YES\n Compiler for C supports arguments -Wno-write-strings: YES\n Compiler for C supports arguments -Wcast-align: YES\n Compiler for C supports arguments -Wdouble-promotion: YES\n Compiler for C supports arguments -Wduplicated-cond: YES\n Compiler for C supports arguments -Wfloat-equal: YES\n Compiler for C supports arguments -Wformat-nonliteral: YES\n Compiler for C supports arguments -Wformat-security: YES\n Compiler for C supports arguments -Wformat=2: YES\n Compiler for C supports arguments -Winit-self: YES\n Compiler for C supports arguments -Wlogical-op: YES\n Compiler for C supports arguments -Wmissing-declarations: YES\n Compiler for C supports arguments -Wmissing-format-attribute: YES\n Compiler for C supports arguments -Wmissing-include-dirs: YES\n Compiler for C supports arguments -Wmissing-noreturn: YES\n Compiler for C supports arguments -Wnull-dereference: YES\n Compiler for C supports arguments -Wpacked: YES\n Compiler for C supports arguments -Wpointer-arith: YES\n Compiler for C supports arguments -Wshadow: YES\n Compiler for C supports arguments -Wswitch-enum: YES\n Compiler for C supports arguments -Wundef: YES\n Compiler for C supports arguments -Wunused-but-set-variable: YES\n Compiler for C supports arguments -Wjump-misses-init: YES\n Compiler for C supports arguments -Wmissing-prototypes: YES\n Compiler for C supports arguments -Wnested-externs: YES\n Compiler for C supports arguments -Wold-style-definition: YES\n Compiler for C supports arguments -Wpointer-sign: YES\n Compiler for C supports arguments -Wstrict-prototypes: YES\n Configuring _dbus-python-config.h using configuration\n \n Executing subproject dbus-gmain\n \n dbus-gmain| Project name: dbus-gmain\n dbus-gmain| Project version: undefined\n dbus-gmain| C compiler for the host machine: cc (gcc 11.5.0 \"cc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5)\")\n dbus-gmain| C linker for the host machine: cc ld.bfd 2.35.2-63\n dbus-gmain| Compiler for C supports arguments -fno-common: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wno-missing-field-initializers: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wcast-align: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wdouble-promotion: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wduplicated-branches: YES\n dbus-gmain| Compiler for C supports arguments -Wduplicated-cond: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wfloat-equal: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wformat-nonliteral: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wformat-security: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wformat=2: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Winit-self: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wlogical-op: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wmissing-declarations: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wmissing-format-attribute: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wmissing-include-dirs: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wmissing-noreturn: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wnull-dereference: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wpacked: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wpointer-arith: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wredundant-decls: YES\n dbus-gmain| Compiler for C supports arguments -Wshadow: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wswitch-default: YES\n dbus-gmain| Compiler for C supports arguments -Wswitch-enum: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wundef: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wunused-but-set-variable: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wwrite-strings: YES\n dbus-gmain| Compiler for C supports arguments -Wdeclaration-after-statement: YES\n dbus-gmain| Compiler for C supports arguments -Wjump-misses-init: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wmissing-prototypes: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wnested-externs: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wold-style-definition: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wpointer-sign: YES (cached)\n dbus-gmain| Compiler for C supports arguments -Wstrict-prototypes: YES (cached)\n dbus-gmain| Found pkg-config: YES (/usr/bin/pkg-config) 1.7.3\n dbus-gmain| Run-time dependency dbus-1 found: YES 1.12.20\n dbus-gmain| Run-time dependency glib-2.0 found: YES 2.68.4\n dbus-gmain| Run-time dependency gthread-2.0 found: YES 2.68.4\n dbus-gmain| Program dbus-run-session found: YES (/usr/bin/dbus-run-session)\n dbus-gmain| Build targets in project: 1\n dbus-gmain| Subproject dbus-gmain finished.\n \n Program python found: YES (/path/to/venv/bin/python3.11)\n Dependency dbus-1 found: YES 1.12.20 (cached)\n Run-time dependency python found: NO (tried pkgconfig, pkgconfig and sysconfig)\n \n ../meson.build:175:11: ERROR: Python dependency not found\n \n A full log can be found at /tmp/pip-install-cla9g86l/dbus-python_7ad9975efa124f489b287d23f1270416/.mesonpy-5tnz3d1g/meson-logs/meson-log.txt\n [end of output]\n \n note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: metadata-generation-failed\n\n× Encountered error while generating package metadata.\n╰─> See above for output.\n\nnote: This is an issue with the package mentioned above, not pip.\nhint: See above for details.\n"}
解决方法:sudo dnf install python3.11-devel

报错信息:过于长,简略说明是关于 Rabbitmq 的
解决方法:禁止源地址验证,主机名不使用 localhost
echo "net.ipv4.ip_nonlocal_bind=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
sudo hostnamectl set-hostname Rocky-OpenStack

报错信息:
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["docker", "exec", "rabbitmq", "rabbitmqctl", "wait", "--timeout", "60", "/var/lib/rabbitmq/mnesia/rabbitmq.pid"], "delta": "0:01:16.912666", "end": "2025-07-26 22:27:49.587223", "msg": "non-zero return code", "rc": 75, "start": "2025-07-26 22:26:32.674557", "stderr": "Error: operation wait on node rabbit@Rocky-OpenStack timed out. Timeout value used: 60000", "stderr_lines": ["Error: operation wait on node rabbit@Rocky-OpenStack timed out. Timeout value used: 60000"], "stdout": "Waiting for pid file '/var/lib/rabbitmq/mnesia/rabbitmq.pid' to appear", "stdout_lines": ["Waiting for pid file '/var/lib/rabbitmq/mnesia/rabbitmq.pid' to appear"]}
解决方法:内存低于 8 GB

报错信息:
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["docker", "exec", "rabbitmq", "rabbitmqctl", "list_policies", "--silent"], "delta": "0:00:52.596597", "end": "2025-07-26 22:38:39.969023", "msg": "non-zero return code", "rc": 69, "start": "2025-07-26 22:37:47.372426", "stderr": "Error: unable to perform an operation on node 'rabbit@Rocky-OpenStack'. Please see diagnostics information and suggestions below.\n\nMost common reasons for this are:\n\n * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)\n * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)\n * Target node is not running\n\nIn addition to the diagnostics info below:\n\n * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more\n * Consult server logs on node rabbit@Rocky-OpenStack\n * If target node is configured to use long node names, don't forget to use --longnames with CLI tools\n\nDIAGNOSTICS\n===========\n\nattempted to contact: ['rabbit@Rocky-OpenStack']\n\nrabbit@Rocky-OpenStack:\n * connected to epmd (port 4369) on Rocky-OpenStack\n * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic \n * can't establish TCP connection to the target node, reason: timeout (timed out)\n * suggestion: check if host 'Rocky-OpenStack' resolves, is reachable and ports 25672, 4369 are not blocked by firewall\n\nCurrent node details:\n * node name: 'rabbitmqcli-925-rabbit@Rocky-OpenStack'\n * effective user's home directory: /var/lib/rabbitmq\n * Erlang cookie hash: zwBNyWu6O11SUOK2WnZs8w==", "stderr_lines": ["Error: unable to perform an operation on node 'rabbit@Rocky-OpenStack'. Please see diagnostics information and suggestions below.", "", "Most common reasons for this are:", "", " * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)", " * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)", " * Target node is not running", "", "In addition to the diagnostics info below:", "", " * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more", " * Consult server logs on node rabbit@Rocky-OpenStack", " * If target node is configured to use long node names, don't forget to use --longnames with CLI tools", "", "DIAGNOSTICS", "===========", "", "attempted to contact: ['rabbit@Rocky-OpenStack']", "", "rabbit@Rocky-OpenStack:", " * connected to epmd (port 4369) on Rocky-OpenStack", " * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic ", " * can't establish TCP connection to the target node, reason: timeout (timed out)", " * suggestion: check if host 'Rocky-OpenStack' resolves, is reachable and ports 25672, 4369 are not blocked by firewall", "", "Current node details:", " * node name: 'rabbitmqcli-925-rabbit@Rocky-OpenStack'", " * effective user's home directory: /var/lib/rabbitmq", " * Erlang cookie hash: zwBNyWu6O11SUOK2WnZs8w=="], "stdout": "", "stdout_lines": []}
解决方法:
docker stop rebbitmq
sudo setenforce 0
# 编辑 SELinux 配置文件
sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/confi
# 或者使用以下命令:
sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

报错信息:docker 连接超时
解决方法:docker 配置镜像加速

解决方法:输入密码,出现这个就代表即将成功 (虽然可能还需要十来分钟)

使用 OpenStack
友情提醒:kolla-ansible post-deploy 可能有的时候需要输入 kolla-ansible post-deploy -i ./all-in-one 才行哦

账号密码请查看:/etc/kolla/clouds.yaml


浙公网安备 33010602011771号