OpenStack | Set up a small-scale cloud with MicroStack
MicroStack is a modern cloud solution that simplifies deploying and managing OpenStack. It leverages snaps, Juju, and Kubernetes for efficient cluster operations.
Its purpose is to provide an accessible and efficient way to create private and public clouds. Here are the key points:
- Simplified Deployment: MicroStack streamlines the process of setting up an OpenStack environment. It’s ideal for small-scale deployments or testing purposes.
- Leveraging Snaps, Juju, and Kubernetes: MicroStack utilizes these technologies to optimize cluster operations. Snaps allow for easy installation and updates, Juju simplifies orchestration, and Kubernetes enhances scalability.
- Single-Node or Multi-Node: Whether you need a single-node cloud or a more complex multi-node setup, MicroStack adapts to your requirements.
Step 1. Configure your environment
We only focus on deploying a small-scale cloud for development purposes.
What we need for our environment?
A virtual machine running Ubuntu 22.04 LTS
CPUs 4+ Cores (amd64) (multi-core)
A minimum of 16 GiB of free memory
50 GiB of SSD storage available on the root disk
Step 2. Install OpenStack with Snap
OpenStack snap package. This method provides a streamlined way to set up OpenStack on your machine.
sudo snap install openstack --channel 2024.1/edgeStep 3. Deploy using sunbeam
Sunbeam is a project that simplifies OpenStack deployment and operation, making it more accessible for various scenarios.
- Sunbeam is an upstream project under the governance of the OpenInfra Foundation (OIF).
- It aim to enable OpenStack deployment and operation at any scale, from singe nodes (that is our case) to large-scale clouds with many hypervisors.
- Sunbeam leverages a hybrid deployment model using Juju to manage both Kubernetes components and machine-based components throught the use of charms.
So, in our terminal, let’s apply the following command to configure the installation
Generate a script to ensure your machine has all the required dependencies for OpenStack. You can review the script using.
sunbeam prepare-node-scriptAnd then, apply all the necessary dependencies to it:
sunbeam prepare-node-script | bash -x && newgrp snap_daemonThe script will ensure some software requirements are satisfied on the host. In particular, it will:
- install
openssh-serverif it is not found - configure passwordless sudo for all commands for the current user (
NOPASSWD:ALL)
Extra configuration:
Disable ipv6: The installation process may failed due some issues with ipv6 connection on the network interface.
Disable IPv6 using Netplan:
- Open the Netplan configuration file for the specific interface you want to modify. The file is usually located in
/etc/netplan/ - Look for the interface section where you want to disable IPv6. For example:
/etc/netplan/{somefile}.yaml - Add the following line within the interface section:
link-local: [ipv4]- This will disable IPv6 link-local addresses while keeping IPv4 intact.
- Save the changes to the Netplan configuration file.
- Apply the new configuration using the following commands:
sudo netplan try
sudo netplan applyNow it is time to “bootstrap the cloud”
Deploy the OpenStack cloud using the following command:
sunbeam cluster bootstrap --accept-defaultsWith use the --accept-defaults parameter only to define the default configuration that sunbeam needs.
That process may take about 25 or 30 minutes. It depends on the speed of your internet connection.
When the process is finished, you should have the following output at your terminal:
Node has been bootstrapped with roles: control, computeStep 4. Explore OpenStack
Once the installation is finished, you need administrator credentials to be able to browse your service.
sunbeam openrc > admin-openrc
source admin-openrcNow, you can use OpenStack CLI in order to explore your small-cloud
openstack service list
+----------------------------------+-----------+-----------+
| ID | Name | Type |
+----------------------------------+-----------+-----------+
| 61581cefc3664624aa0df8879adf1fa1 | placement | placement |
| 67c752ec6ffd4993bc7c7e0e80a73267 | neutron | network |
| 7c49cb194e6e4a93b06aa3a4b40f69de | nova | compute |
| 89adc8234f174d7eb0d1ef03a61c6286 | cinderv3 | volumev3 |
| ce4a921bf55d45308a523bb567e354bf | keystone | identity |
| d07a475a23f842718b3c04b316afe9d5 | glance | image |
| ef0a4599b76847ffa5eae0ecdac178db | cinderv2 | volumev2 |
+----------------------------------+-----------+-----------+openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 6c84ab70-8fc8-4d73-ab4a-4cf754861769 | ubuntu | active |
+--------------------------------------+--------+--------+openstack project list
+----------------------------------+----------+
| ID | Name |
+----------------------------------+----------+
| 10d07ddd133148eba0e0579b0a280869 | admin |
| 262d618e4e394162a0b34c20d886948c | admin |
| 3b5b63876d8b4415acb28017587fb2f8 | demo |
| 5946826c123f4d74b8ec41c2b5cc295c | services |
+----------------------------------+----------+Also, you can retrieved OpenStack dashboard with the sunbeam command
sunbeam dashboard-url
http://10.20.21.13:80/openstack-horizonTips: Because we use a single-node installation, the control panel is only accessible over the machine’s internal network. But with the following command, you can use port-forward to access it externally over your server’s network
sudo apt install socat
& sudo socat -v tcp-listen:80,fork tcp:10.20.21.13:80replace the IP [10.20.21.13] with your dashboard IP
Retrieve your OpenStack service credential with the following command:
sunbeam openrc | egrep 'OS_USERNAME|OS_PASSWORD|OS_USER_DOMAIN_NAME'