Step-by-Step Guide to Deploying an OpenStack Cloud with Kolla (All‑in‑One)
This article walks you through building an OpenStack Stein cloud on a single host using Kolla, covering environment preparation, Docker and Ansible setup, configuration files, password generation, deployment commands, and final login verification, all with detailed code snippets and images.
1 Introduction
We set up an OpenStack cloud platform for a friend using the Kolla project to deploy the Stein release.
Kolla automates OpenStack deployment with Docker and Ansible; Docker handles image building and container management, while Ansible manages environment provisioning.
2 Experiment Environment
Because of limited laptop resources, we use an all‑in‑one mode where all services run on a single host.
Mastering the all‑in‑one deployment makes multi‑node setups much easier.
2.1 System Preparation
2.2 Logical Topology Diagram
3 Deployment Steps
3.1 Linux System Configuration
Configure host network interfaces
Disable firewalld, SELinux and libvirtd services
[root@qll251 ~]# systemctl stop firewalld
[root@qll251 ~]# systemctl disable firewalld
[root@qll251 ~]# vim /etc/selinux/config
# change SELINUX=enforcing to SELINUX=disabled
[root@qll251 ~]# systemctl stop libvirtd.service
[root@qll251 ~]# systemctl disable libvirtd.service
[root@qll251 ~]# reboot # apply changesInstall EPEL repository yum -y install epel-release Install common CentOS utilities
yum install -y vim net-tools bash-completion-extras gitQuestion: What does the bash-completion-extras package provide?
Set hostname and /etc/hosts
[root@qll251 ~]# hostname qll251
[root@qll251 ~]# echo "qll251" > /etc/hostname
[root@qll251 ~]# echo "192.168.1.251 qll251" >> /etc/hostsSynchronize time
[root@qll251 ~]# yum -y install ntp
[root@qll251 ~]# systemctl start ntpd
[root@qll251 ~]# systemctl enable ntpdConfigure pip mirror for faster Python package downloads
[root@qll251 ~]# mkdir ~/.pip
[root@qll251 ~]# vim ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com3.2 Install Base Packages and Docker
Install development tools
yum -y install python-devel libffi-devel gcc openssl-devel python-pipUpgrade pip to avoid later warnings
Install Docker CE
Install dependencies
yum -y install yum-utils device-mapper-persistent-data lvm2Add Docker CE repository
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repoInstall Docker CE yum -y install docker-ce Start Docker service
systemctl start docker
systemctl enable dockerConfigure Docker image registry mirror
[root@qll251 ~]# vim /etc/docker/daemon.json
# add:
{
"registry-mirrors": ["https://0i6rnnzu.mirror.aliyuncs.com"]
}This mirror address was obtained from Alibaba Cloud and can be used directly.
Set Docker volume mount mode
[root@qll251 ~]# mkdir /etc/systemd/system/docker.service.d
[root@qll251 ~]# vim /etc/systemd/system/docker.service.d/kolla.conf
# add:
[Service]
MountFlags=sharedMountFlags=shared allows Docker to recognize new host partitions without restarting, which is convenient when using Cinder storage later.
Reload systemd and restart Docker
systemctl daemon-reload
systemctl restart docker
systemctl enable docker3.3 Get Kolla and Kolla‑Ansible from GitHub
Install Ansible yum -y install ansible Clone the repositories
git clone https://github.com/openstack/kolla -b stable/stein
git clone https://github.com/openstack/kolla-ansible -b stable/stein
# If images already exist, only the second step is neededManually install kolla‑ansible python ~/kolla-ansible/setup.py install Install kolla‑ansible dependencies
[root@qll251 ~]# pip install -r /root/kolla-ansible/requirements.txtIf the above fails, force‑install the required package:
[root@qll251 ~]# pip install --ignore-installed PyYAMLInstall Kolla dependencies
[root@qll251 ~]# pip install -r /root/kolla/requirements.txtIf you encounter version conflicts (e.g., requests 2.20.0 requires idna<2.8,>=2.5), force‑upgrade:
[root@qll251 ~]# pip install --ignore-installed requestsCopy configuration files
[root@qll251 ~]# cd ~/kolla-ansible/
[root@qll251 kolla-ansible]# cp -r ./etc/kolla/* /etc/kolla/
[root@qll251 kolla-ansible]# cp ./ansible/inventory/* /etc/kolla/
# List copied files
[root@qll251 ~]# ls /etc/kolla/
all-in-one globals.yml multinode passwords.ymlExplanation of the files:
all-in-one : Ansible playbook for single‑node OpenStack deployment
multinode : Playbook for multi‑node deployment
globals.yml : Custom OpenStack configuration
passwords.yml : Service passwords
Generate random passwords
[root@qll251 ~]# kolla-genpwdKolla’s password generator creates passwords for all OpenStack services; missing passwords will cause later checks to fail.
Modify the generated passwords file
[root@qll251 ~]# vim /etc/kolla/passwords.yml
# For easier Dashboard login, change the admin password to 123123
keystone_admin_password: 123123Edit globals.yml to match the environment
[root@qll251 ~]# vim /etc/kolla/globals.yml
kolla_base_distro: "centos"
kolla_install_type: "binary"
openstack_release: "stein"
# All‑in‑one mode, no HA; set host IP
kolla_internal_vip_address: "192.168.1.251"
network_interface: "eth0"
neutron_external_interface: "eth1"
enable_haproxy: "no"3.4 Deploy OpenStack
Generate SSH key and authorize the node
ssh-keygen
ssh-copy-id [email protected]Adjust the all‑in‑one inventory file
[root@qll251 ~]# vim /etc/kolla/all-in-one
# Replace all occurrences of localhost with qll251
:1,$s/localhost/qll251/
# Remove lines containing ansible_connection=local
:1,$s/ansible_connection=local//This step is optional for single‑node deployment, but we walk through it for completeness.
Bootstrap the Kolla server
[root@qll251 ~]# kolla-ansible -i /etc/kolla/all-in-one bootstrap-serversResult screenshot omitted for brevity.
Run pre‑deployment checks
[root@qll251 ~]# kolla-ansible -i /etc/kolla/all-in-one prechecksIf this succeeds, the rest of the deployment should proceed without major issues.
Congratulations if you reach this point!
Pull OpenStack Docker images
[root@qll251 ~]# kolla-ansible -i /etc/kolla/all-in-one pullImages are downloaded from the official repositories.
Deploy OpenStack kolla-ansible -i /etc/kolla/all-in-one deploy Post‑deployment verification
kolla-ansible -i /etc/kolla/all-in-one post-deployIf the command finishes successfully, the OpenStack environment is ready.
The admin credentials are stored in /etc/kolla/admin-openrc.sh and look like this:
4 Access the OpenStack Dashboard
Open a browser and navigate to http://192.168.1.251.
Username: admin
Password: 123123 (change this in production environments).
The password was set in passwords.yml ; using a simple password is only for demonstration.
Deployment is complete; the next article will cover basic OpenStack usage and creating a test VM via the CLI.
5 Final Remarks
Even though the deployment went smoothly for us, you may encounter errors; careful attention to configuration details (extra spaces, mixed character sets, etc.) is essential.
Most errors are caused by small oversights; with patience and diligence you can successfully deploy OpenStack.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
