Skip to content

busterswt/MNAIOv2

Repository files navigation

OpenStack-Ansible Multi-Node All-in-One (MNAIO) v2

Date: 2023-02-05
tags:mnaio, rackspace, openstack, ansible, openstack-ansible

About this repository

This is not your grandma's MNAIO.

In fact, it's not really an all-in-one at all.

MNAIOv2 provides a full OpenStack deployment using an existing OpenStack-based cloud, resulting in a multi-node installation using instances that are deployed using Terraform and managed by Ansible. So, less TripleO and more TripleOSA.

The deployed environment consists of the following:

  • 1x Deploy Node (4 vCPUs, 4 GB RAM, 20 GB Disk)
  • 2x Load Balancers (4 vCPUs, 4 GB RAM, 20 GB Disk)
  • 3x Controllers (8 vCPUs, 24 GB RAM, 20 GB Disk)
  • 3x Computes (8 vCPUs, 16 GB RAM, 40 GB Disk)
  • 3x Ceph (4 vCPUs, 8 GB RAM, 20 GB Disk + 3x 10GB OSDs)

These defaults can be adjusted, including the number of deployed nodes. The script(s) will build and deploy OpenStack across multiple virtual instances, and is customizable using standard OpenStack-Ansible override mechanisms.

Ensure quotas allow such resource utilization!

Installation

The OpenStack (under)cloud must have the resources available to support the instance flavors noted above:

  • 72 vCPU
  • 156 GB RAM
  • 260 GB Disk
  • 90 GB Disk (via Cinder)

Download this repository to your local workstation or to a machine that has access to an OpenStack-based cloud. The machine must be able to access the undercloud OpenStack APIs and the deployed instances (via Floating IPs).

git clone https://github.com/busterswt/MNAIOv2/

Prerequisites

  • Ansible (>=2.3.15)
  • Terraform (>=1.3.6)

From within the MNAIOv2 directory, install Ansible and required collections with the following commands:

Ubuntu 20.04 LTS
----------------
sudo apt install python3-pip
sudo pip3 install ansible-core==2.13.5
ansible-galaxy collection install -r ansible-collection-requirements.yml

MacOS X (Homebrew)
------------------
brew install ansible
ansible-galaxy collection install -r ansible-collection-requirements.yml

Install Terraform:

Ubuntu 20.04 LTS
----------------
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install terraform=1.3.6

MacOS X (Homebrew)
------------------
brew install terraform

Overrides

By default, MNAIOv2 will deploy an OpenStack cloud with the following attributes:

  • Ubuntu Focal 22.04 LTS
  • OpenStack-Ansible (master branch)
  • Neutron ML2/OVS

Overrides can be set in overrides.yml, which will be read in by Ansible to override default values. Other overrides can be set using environment variables prior to executing the build, but this will be deprecated in most cases.

build.sh Options

Required

The variables here are required, and the deployment will fail without them.

Set the Neutron external provider network name (from undercloud)
export MNAIO_OSA_EXTERNAL_NETWORK_NAME="<openstack external provider network name>"
Set the Neutron external provider network uuid (from undercloud)
export MNAIO_OSA_EXTERNAL_NETWORK_UUID="<openstack external provider network uuid>"

A clouds.yaml file is also required for authentication. Create and save the file as ~/.config/openstack/clouds.yaml.

Example:

clouds:
  mnaiov2:
    auth:
      auth_url: https://openstack.cloud.com:5000
      username: "admin"
      password: "wme7rr72vs&123"
      project_id: 7a8df96a3c6a47118e60e57aa9ecff54
      project_name: "admin"
      user_domain_name: "Default"
    region_name: "RegionOne"
    interface: "public"
    identity_api_version: 3

Optional

The variables here are optional, as there are defaults in place. Change them according to your deployment preference:

Set the OpenStack-Ansible branch
export MNAIO_OSA_BRANCH="${MNAIO_OSA_BRANCH:-master}"
Set the Neutron plugin (options: ml2.ovs,ml2.ovn)
export MNAIO_OSA_NEUTRON_PLUGIN="${MNAIO_OSA_NEUTRON_PLUGIN:-ml2.ovs}"
Set the instance image type for automatic download (options: focal,jammy)
export MNAIO_OSA_VM_IMAGE="${MNAIO_OSA_VM_IMAGE:-jammy}"
Set the deployment to metal versus containers
export MNAIO_OSA_NO_CONTAINERS="${MNAIO_OSA_NO_CONTAINERS:-true}"

Architecture

Deploy

  • MNAIOv2 utilizes floating IPs from the "undercloud" to allow the Terraform and Ansible host to perform bootstrapping of the deployed instances.
  • Some Terraform files are dynamically generated by Ansible.

Glance

  • Glance API is hosted on a single Controller node to avoid issues with uneven image distribution.

Networking

MNAIOv2 uses undercloud provider and tenant network capabilities to constuct a virtual network infrastructure suitable for an OpenStack-Ansible based deployment. Fixed IP and MAC addresses are known and consistent between deployments to ease the burden on automation.

A Neutron router is required to provide connectivity for the 'management' network, and a floating IP sourced from the external provider network (MNAIO_OSA_EXTERNAL_NETWORK_NAME) is used to provide ingress connectivity from the Terraform/Ansible deploy node to the management IP of the MNAIOv2 VMs.

Deployment

To deploy an MNAIOv2 environment, simply execute the following:

bash build.sh

To destroy an MNAIOv2 environment, simply execute the following:

bash destroy.sh

If the VM deployment is successful, you should see the following:

TASK [Finished notice] *************************************************************
ok: [mnaio-deploy1] => {}

MSG:

OSA deploy running. To check on the state of this deployment, login
to the mnaio-deploy1 VM (192.168.2.183) and attach to the "build-osa" tmux session.

To SSH to the deploy node, use the private key. Attach to the existing tmux session, as indicated:

% ssh -i id_rsa_mnaio.key [email protected]
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-135-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

System information as of Sat Dec 17 00:16:49 UTC 2022

System load:  0.0                Processes:             130
Usage of /:   10.7% of 19.20GB   Users logged in:       1
Memory usage: 8%                 IPv4 address for ens3: 172.25.1.51
Swap usage:   0%


0 updates can be applied immediately.

New release '22.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Sat Dec 17 00:11:36 2022 from 192.168.6.199
ubuntu@mnaio-deploy1:~$ sudo su
root@mnaio-deploy1:/home/ubuntu# tmux attach

Changes to the deployment can be made in /etc/openstack_deploy, and playbooks exist in /opt/openstack-ansible.

Rackspace Private Cloud

MNAIOv2 can deploy a Rackspace Private Cloud environment based on OpenStack-Ansible but using custom RPC-O templates. This method requires access to certain private GitHub repos and uses a slighty different workflow.

Set the deployment method from osa (default) to rpc and run the build.sh scripts from the MNAIOv2 directory:

export MNAIO_DEPLOY=rpc
bash build.sh

A successful run of build.sh will result in the following message:

TASK [Finished notice] *************************************************************
ok: [mnaio-deploy1] => {}

MSG:

RPC openstack-ops repo has been downloaded. To proceed, login to the deploy host (mnaio-deploy1)
at 192.168.2.239 and run the the following command(s):

cd /opt/openstack-ops; SKIP_PROMPTS=true OSA_ENV=lab1 OSA_ENV_LCASE=lab1 OSA_RELEASE=23.4.4 OSA_RUN_PLAY=false RPCO_CONFIG_BRANCH=master scripts/deploy-rpco.sh

Once complete, come back and run the "setup-rpc.sh" bash script from the MNAIOv2 directory.

Once complete, login to the deploy node and run the RPC scripts using the appropriate overrides for your environment:

cd /opt/openstack-ops; SKIP_PROMPTS=true OSA_ENV=lab1 OSA_ENV_LCASE=lab1 OSA_RELEASE=23.4.4 OSA_RUN_PLAY=false RPCO_CONFIG_BRANCH=master scripts/deploy-rpco.sh

Once the RPC playbook is complete, return to the deploy node and run the setup-rpc.sh script:

bash setup-rpc.sh

A successful run of setup-rpc.sh will result in the following message:

TASK [Finished notice] *************************************************************
ok: [mnaio-deploy1] => {}

MSG:

RPC deploy running. To check on the state of this deployment, login
to the mnaio-deploy1 VM (192.168.2.239) and attach to the "build-osa" tmux session.

From here, SSH to the mnaio-deploy1 VM and execute tmux attach, then run the OSA deployment playbooks:

root@adjusted-shrew-mnaio-deploy1:/opt/openstack-ansible/playbooks# openstack-ansible setup-everything.yml

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published