Use Sunbeam together with MAAS to deploy machines at scale

Key Value
Summary Deploy at scale.
Categories openstack
Difficulty 2
Author Tytus Kurek tytus.kurek@canonical.com

Overview

Duration: 3 minutes

Before you get started!

Welcome to OpenStack!

In this series of tutorials, we will walk you through all the necessary steps to install, configure and get started with OpenStack. Using just three dedicated machines, you will learn how to deploy OpenStack in highly available, multi-node, production-grade clusters.

This tutorial is the sixth in the “Phase 2 - Deploy OpenStack” series.

Explore other tutorials >

What is OpenStack?

OpenStack is a collection of open source projects designed to work together to form the basis of a cloud. OpenStack can be used for both private and public cloud implementation.

What is Sunbeam?

Sunbeam is an upstream project under the governance of the OpenInfra Foundation (OIF), which was created to lower the barrier to entry for OpenStack, simplify its adoption process, and set the foundation for an autonomous private cloud. Sunbeam uses cloud-native architecture and total bottom-up automation to make OpenStack more accessible to newcomers and to help users get to grips with the platform immediately.

What is MicroStack?

MicroStack (based on Sunbeam) is an OpenStack distribution designed for small-scale cloud environments. While it is available with full commercial support from Canonical, it can also be self-deployed with no friction, effectively eliminating the need for a paid consulting engagement. MicroStack currently includes core OpenStack services only, but is expected to evolve quickly to ensure full feature parity with Canonical’s Charmed OpenStack soon.

In this tutorial, you will learn how to:

  • Deploy OpenStack at scale with Sunbeam and MAAS

You will only need:

  • Theoretical knowledge of OpenStack gained by completing all tutorials in the “Phase I - Learning OpenStack” series
  • Three fresh physical machines commissioned with Ubuntu 22.04 LTS in MAAS with:
    • 16+ core amd64 processor
    • A minimum of 32 GB of free memory
    • 200 GB of SSD storage available on the root disk
    • A least one un-partitioned disk of at least 200 GB in size
    • Two network interfaces:
      • Primary: for access to the OpenStack control plane
      • Secondary: for remote access to cloud VMs
  • One fresh physical or virtual machine commissioned with Ubuntu 22.04 LTS in MAAS with:
    • 2+ core amd64 processor
    • A minimum of 4 GB of free memory
    • 128 GB of storage available on the root disk
    • One network interface
    • MAAS instance up and running
  • One fresh physical or virtual machine, or a LXD container with Ubuntu 22.04 LTS installed that is external to MAAS

Reference configuration

Duration: 5 minutes

This section provides reference configuration used for the purpose of this tutorial.

! Reference configuration
Note that in your environment those values might be different and might need to be adjusted accordingly.

Machines

For the purpose of this tutorial, the following machines are used:

Machine FQDN Purpose Storage device
sunbeam01 sunbeam01.example.com cloud /dev/sdb
sunbeam02 sunbeam02.example.com cloud /dev/sdb
sunbeam03 sunbeam03.example.com cloud /dev/sdb
sunbeam04 sunbeam04.example.com juju N/A
sunbeam05 sunbeam05.example.com client N/A

Those machines are configured in MAAS in the following way:

Machine Resource pool Network space Machine tags Storage tag Network tag
sunbeam01 openstack myspace mycloud, control, compute, storage ceph compute
sunbeam02 openstack myspace mycloud, control, compute, storage ceph compute
sunbeam03 openstack myspace mycloud, control, compute, storage ceph compute
sunbeam04 openstack myspace mycloud, juju-controller

The MAAS instance is configured in the following way:

  • URL: http://172.16.1.1:5240/MAAS
  • Token: z6sbVdQTuKWPFCFvPF:WkRdtsJnwXu38aRHUz:77SqG9DmaugFRHNT4SFtyGqubmLawNBJ

Control plane networking

The network associated with the primary network interface requires a range of approximately 10 IP addresses that will be used for API service endpoints.

For the purposes of this tutorial, the following configuration is in place:

Network component Value
CIDR 172.16.1.0/24
Gateway 172.16.1.1
Address range 172.16.1.201-172.16.1.220
Interface name on machine eno1

External networking

The network associated with the secondary network interface requires a range of IP addresses that will be sufficient for allocating floating IP addresses to VMs. This will, in turn, allow them to be contacted by remote hosts.

For the purposes of this tutorial, the following configuration is in place:

Network component Value
CIDR 172.16.2.0/24
Gateway 172.16.2.1
Address range 172.16.2.2-172.16.2.254
Interface name on machine eno2

Deploy OpenStack at scale with Sunbeam and MAAS

Duration: 25 minutes

In this tutorial we’ll deploy an OpenStack cloud with Sunbeam and MAAS.

Note: all commands in this tutorial are run on the sunbeam05 machine.

Install the OpenStack snap

In order to install OpenStack snap, execute the following command:


$ sudo snap install openstack --channel 2024.1/beta

Prepare the client machine

In order to prepare the client machine for OpenStack usage, execute the following command:


$ sunbeam prepare-node-script | bash -x && newgrp snap_daemon

Add the MAAS deployment

In order to add the MAAS deployment called my_maas to the client machine according to the “Reference configuration” section, execute the following command:


$ sunbeam deployment add maas \
  --name my_maas \
  --url http://172.16.1.1:5240/MAAS \
  --token z6sbVdQTuKWPFCFvPF:WkRdtsJnwXu38aRHUz:77SqG9DmaugFRHNT4SFtyGqubmLawNBJ \

You should be able to see the following message:


MAAS deployment my_maas added.

Map MAAS network spaces to OpenStack cloud networks

In order to map the MAAS network space from the “Reference configuration” section to all OpenStack cloud networks, execute the following commands:


$ sunbeam deployment space map myspace data
$ sunbeam deployment space map myspace internal
$ sunbeam deployment space map myspace management
$ sunbeam deployment space map myspace public
$ sunbeam deployment space map myspace storage
$ sunbeam deployment space map myspace storage-cluster

You should be able to see the following message:


Space myspace mapped to network data.
Space myspace mapped to network internal.
Space myspace mapped to network management.
Space myspace mapped to network public.
Space myspace mapped to network storage.
Space myspace mapped to network storage-cluster.

Validate the deployment

In order to validate the deployment, execute the following command:


$ sunbeam deployment validate

Sample output:


Checking machines, roles, networks and storage... OK
Checking zone distribution... OK
Checking networking... OK
Report saved to '/home/guardian/snap/openstack/common/reports/validate-deployment-my_maas-20240610-113835.433548.yaml'

If you see any FAIL messages in the output of the sunbeam deployment validate command, check the report file mentioned in the output to see any potential issues with your deployment. Fix those issues and then run the sunbeam deployment validate command again.

Note: a validation error will lessen the chances of a successful deployment but it will not block an attempted deployment.

Bootstrap the governor

In order to bootstrap the governor according to the “Reference configuration” section, execute the following command:


$ sunbeam cluster bootstrap

! sunbeam cluster bootstrap
This command takes a while to finish. Please, be patient.

When prompted, enter the following values:

  • Use proxy to access external network resources? - type n and press Enter,

Sample output:


Use proxy to access external network resources? [y/n] (n): n

Once finished, you should be able to see the following message:


Bootstrap controller components complete.

Bootstrap the cloud

In order to bootstrap the cloud according to the “Reference configuration” section, execute the following command:


$ sunbeam cluster deploy

! sunbeam cluster deploy
This command takes a while to finish. Please, be patient.

When prompted, enter the following values:

  • Enter a region name (cannot be changed later) (RegionOne) - type RegionOne and press Enter,

Sample output:


Enter a region name (cannot be changed later) (RegionOne): RegionOne

Once finished, you should be able to see the following message:


Deployment complete with 3 control, 3 compute and 3 storage nodes. Total nodes in cluster: 3

Configure the cloud

In order to configure the cloud according to the “Reference configuration” section, execute the following command:


$ sunbeam configure --openrc demo-openrc

When prompted, enter the following values:

  • CIDR of network to use for external networking - type the value of the CIDR field from the “External networking” sub-section of the “Reference configuration” section and press Enter,
  • IP address of default gateway for external network - type the value of the Gateway field from the “External networking” sub-section of the “Reference configuration” section and press Enter,
  • Start of IP allocation range for external network - type the first IP address from the range defined in the Address range field from the “External networking” sub-section of the “Reference configuration” section and press Enter,
  • End of IP allocation range for external network - type the last IP address from the range defined in the Address range field from the “External networking” sub-section of the “Reference configuration” section and press Enter,
  • Network type for access to external network - type flat and press Enter,
  • Populate OpenStack cloud with demo user, default images, flavors etc - type y and press Enter,
  • Username to use for access to OpenStack - type demo and press Enter,
  • Password to use for access to OpenStack - type demo and press Enter,
  • Network range to use for project network - press Enter,
  • List of nameservers guests should use for DNS resolution - type an IP address of a DNS server (e.g. 8.8.8.8) accessible from the External network,
  • Enable ping and SSH access to instances? - type y and press Enter,
  • Free network interface that will be configured for external traffic - type the value of the Interface name on machine field from the “External networking” sub-section of the “Reference configuration” section and press Enter.

Sample output:


CIDR of network to use for external networking (10.20.20.0/24): 172.16.2.0/24
IP address of default gateway for external network (172.16.2.1): 172.16.2.1
Start of IP allocation range for external network (172.16.2.2): 172.16.2.2
End of IP allocation range for external network (172.16.2.254): 172.16.2.254
Network type for access to external network [flat/vlan] (flat): flat
Populate OpenStack cloud with demo user, default images, flavors etc [y/n] (y): y
Username to use for access to OpenStack (demo): demo
Password to use for access to OpenStack (DS********): 
Network range to use for project network (192.168.122.0/24): 
List of nameservers guests should use for DNS resolution (8.8.8.8): 8.8.8.8
Enable ping and SSH access to instances? [y/n] (y): y

Once finished, you should be able to see the following message:


Writing openrc to demo-openrc ... done

Next steps

Duration: 2 minutes

Congratulations! You have reached the end of this tutorial.

You can now move to the next tutorial - “7. Validate” - or explore other tutorials.

In this tutorial, you have learnt how to:

  • Deploy OpenStack at scale with Sunbeam and MAAS

Where to go from here?