OpenStack is known for its complex architecture and multiple configurations, making it difficult to install and deploy. Although many automated deployment tools have emerged in the OpenStack community, it is still difficult for ordinary users, especially newcomers, to get started.

Using the kolla-Ansible-based operating system image described in this article, you can deploy your environment with very few commands.

How cumbersome it can be to install OpenStack

Slightly, understand nature understand

Here is the Stein version for you to experience more new features.

Note that this image is entirely based on the open source version and is for reference only.

How easy it can be to install OpenStack

Here is a container deployment based on Kolla-Ansible.

The advantages of this installation mode:

  • Start from zero
  • Offline installation
  • Very few orders
  • Optional components
  • Work and play
  • Easy to upgrade

Some advanced features of Kolla, such as multi-node parallel installation, high availability deployment, online upgrade and capacity expansion, cannot be shown this time due to limited conditions.

Prepare a machine

Most of us probably don’t have a spare machine to install Linux on, but we can do it using a virtual machine.

Choose a suitable vm management software for your system:

  • VirtualBox (recommended)
  • VMWare
  • Hyper-V
  • other

Download the. Iso image file

Wechat search and follow the public account DavyCloud, or scan the QR code in the picture below to get the download link

Create a virtual machine

Configure two networks:

  • Two host-only networks,
  • The address segment of one network is set to
    10.10.10.1/24

VirtualBox_network.png

Create a VM that meets the following requirements:

  • 8 gb of memory
  • Boot disk Selection
    davycloud-openstack-stein.iso
  • Disk space >= 40GB
  • Two host-only networks are configured for the two nics.
  • The first blockThe nic address segment corresponds to
    10.10.10.1/24That a

VirtualBox_VM_Info.png

Modifying startup Options

When entering the boot menu, there are two options:

  • Installing the Deploy Node
  • Install Worker node (default)

Use the arrow keys to move the cursor, select the first one, and press Enter to start installing the system.

vm_boot_menu.png

Why put the default option in the second?

Because only one deployment node needs to be installed, while there may be many working nodes.

The system starts the automatic installation process without any interaction. After the system is installed, the CD-ROM is ejected and the system restarts automatically.

The first startup process takes a long time.

Configuration changes

If the virtual machine network address segment is configured as required, there are no special requirements on OpenStack modules. You can skip to the next step without making any changes.

To keep this article from getting too tedious, I will not explain how to modify the configuration, but simply explain the situation.

All-in-one installation scenario OpenStack core modules and common components are installed by default, including:

  • MySQL
  • RabbitMQ
  • Memcached
  • Keystone
  • Glance
  • Neutron
  • Nova
  • Heat

Notice that the core module contains Heat, which is rarely used by elementary users, while Cinder, which is commonly used for volume storage, is not included as the core module. If Cinder needs to be installed, you need to specify a Backend for Cinder. Other configuration requirements may vary depending on the storage mode. Do not install Cinder by default.

Note that HAProxy and floating IP are enabled by default even In an All-in-one scenario.

  • HAProxy
  • Keepalived

No additional operations are required to enable HAProxy, except that an additional IP address is required. Enabling the floating IP address makes horizontal scaling of controller nodes easier. Therefore, it is recommended to keep the default configuration unless you are sure that you will always use it as a single-node environment.

It is worth noting that in some cloud environments (such as OpenStack), this floating address may be subject to security group issues and may require some additional configuration. More on that later when we have the opportunity.

Three consecutive commands can be run: prechecks, deploy, and post-deploy

Log in to the system as user name kolla and password kollapass and switch to user root:

$ sudo -s
# cd /root
Copy the code

All the following operations are performed as user root, and only three commands are required:

Each of the following commands executes the corresponding Ansible Playbook, so there will be a lot of printing on the screen.

Check the environment before installation and ensure that all necessary conditions are met

# kolla-ansible prechecks
Copy the code

Start the installation. Wait for 20 to 40 minutes depending on the machine performance and the number of modules to be installed

# kolla-ansible deploy
Copy the code

A little finishing touches after the installation

# kolla-ansible post-deploy
Copy the code

After the preceding command is executed, the admin-openrc.sh file is generated in the /etc/kolla directory, which contains the user name and password required for login.

Using openstack Commands

In previous OpenStack versions, each module provided its own client commands, such as nova and glance. Now, OpenStack commands are used in a unified manner. Some of the old commands work, like Nova, and some don’t, like Keystone

Before using openstack commands, you must install the client package of each module. Our host system only has Docker and Ansible installed. In the docker image built by Kolla, all client packages have been installed in the openstack base image, which means:

  1. There is no need to install a separate client on the host
  2. You can use the client in any OpenStack service container

However, it is not convenient to manually enter the container every time, so I built a bash script in the image, named openstack, which is to start a container, using the same method as the original openstack command:

# source /etc/kolla/admin-openrc.sh
# openstack <-- directly type the command
(openstack) 
Copy the code

Login horizon

The VirtualBox console does not support copying the admin password, so it is best to log in to the virtual machine with an SSH client and copy the password

horizon_login.png

Start to experience

If you have questions about the installation process, you can watch the video operation in Bilibili.

If you think the article is good, don’t forget to like and follow the official account, thank you!

PS. Due to the limited performance of personal machines, I will move the battlefield toAli cloudYou might as wellGet one.