Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Last active January 1, 2023 03:39
Show Gist options
  • Save gilangvperdana/01d08d26e8fc11202bf5edd18c679db2 to your computer and use it in GitHub Desktop.
Save gilangvperdana/01d08d26e8fc11202bf5edd18c679db2 to your computer and use it in GitHub Desktop.
Deploy OpenStack Xena MultiNode on Ubuntu 20.04LTS with Kolla Ansible

Deploy OpenStack Xena MultiNode on Ubuntu 20.04LTS

Goals

  • Can access on endpoint console.bignetlab.com
  • Prometheus & Grafana Ready

Prerequisite

  • 3 NODE
    • 1 CONTROLLER
    • 2 WORKER
    • 3 Interface (NAT/BRDIGE(NO IP)/Bridge with IP)
    • 2 Storage (vda&vdb) per Node
  • Network
    • ens3 : 192.168.2.0/24
    • ens4 : 192.168.3.0/24 (without IP)
    • ens5 : 192.168.3.0/24 (with IP)

Configuration

  • Add Hosts Record
nano /etc/hosts
192.168.2.50 console.gbesar.com
192.168.2.202 ctrl1
192.168.2.203 comp1
192.168.2.204 comp2

All Node

  • Add User

    adduser kolla
    usermod -aG sudo kolla
    echo "kolla ALL=(ALL) NOPASSWD:ALL" | tee /etc/sudoers.d/kolla
    
  • Create volume group for cinder service

    su - kolla
    sudo pvcreate /dev/vdb
    sudo vgcreate cinder-volumes /dev/vdb 
    sudo vgs
    

Controller Node :

  • Install Dependencies
sudo apt-get install python3-dev libffi-dev gcc libssl-dev python3-selinux python3-setuptools python3-venv -y
  • Create a virtual environment and activate it
python3 -m venv kolla-venv
source kolla-venv/bin/activate
  • Ensure the latest version of pip is installed
pip install -U pip
  • Install wheel
pip install wheel
  • Install Ansible
pip install 'ansible<3.0'
  • Config ansible.cfg - use user kolla (controller)
sudo mkdir -p /etc/ansible
sudo nano /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
  • Install kolla-ansible and its dependencies using pip
pip install kolla-ansible
  • Specify Jinja Stable
pip uninstall jinja2
pip install jinja2==3.0.3
  • Create the /etc/kolla directory.
sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
  • Copy globals.yml and passwords.yml to /etc/kolla directory
cp -r kolla-venv/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
  • Copy all-in-one and multinode inventory files to the current directory.
cp kolla-venv/share/kolla-ansible/ansible/inventory/* .
  • Distribute SSH-Keygen to all node
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub kolla@ctrl1
ssh-copy-id -i ~/.ssh/id_rsa.pub kolla@comp1
ssh-copy-id -i ~/.ssh/id_rsa.pub kolla@comp2
  • Specify Role Node
nano ~/multinode 
[control] 
ctrl1

[network] 
ctrl1

[compute] 
comp1
comp2

[monitoring]
ctrl1

[storage]
ctrl1
comp1
comp2

[deployment] 
localhost ansible_connection=local 

Note: Dont change other configuration.

  • Check Connection to all Node
ansible -i multinode all -m ping
  • Generate Password
kolla-genpwd
  • Declare base service what you want to deploy
    • kolla_internal_vip_address are IP from adapter who have access internet and some free pool subnet to access.
    • kolla_internal_fqdn are domain that you want to access to your openstack cluster.
    • neutron_external_interface are adapter that have an some free pool subnet, internet access & not have an IP.
nano /etc/kolla/globals.yml
kolla_base_distro: "ubuntu"
kolla_install_type: "source"
openstack_release: "xena"
kolla_internal_vip_address: "192.168.2.80"
kolla_internal_fqdn: "console.bignetlab.com"
kolla_enable_tls_internal: "yes"
kolla_copy_ca_into_containers: "yes"
kolla_enable_tls_backend: "yes"
openstack_cacert: "/etc/ssl/certs/ca-certificates.crt"
network_interface: "ens3"
neutron_external_interface: "ens4"
neutron_plugin_agent: "openvswitch"
enable_openstack_core: "yes"
enable_haproxy: "yes"
enable_neutron_provider_networks: "yes"
nova_compute_virt_type: "kvm"
enable_cinder: "yes"
enable_cinder_backend_lvm: "yes"
cinder_volume_group: "cinder-volumes"
enable_prometheus: "yes"
enable_prometheus_openstack_exporter: "yes"
enable_grafana: "yes"
enable_mariadb_clustercheck: "yes"
  • Ready to Deploy
kolla-ansible -i ./multinode certificates
kolla-ansible -i ./multinode bootstrap-servers
kolla-ansible -i ./multinode prechecks
kolla-ansible -i ./multinode deploy
kolla-ansible post-deploy

Note

  • If you not use TLS on your cluster, you can skip the TLS command and declare on globals.yml & certificates on deploy.
  • If you use TLS, you can inject TLS key to your admin-openrc.sh with :
    cat /etc/kolla/certificates/ca/root.crt | sudo tee -a /etc/ssl/certs/ca-certificates.crt
    source /etc/kolla/admin-openrc.sh
    
  • for Network, you can create and use type FLAT and physnet1 for Variable or you can check with $ grep bridge_mappings /etc/kolla/neutron-openvswitch-agent/openvswitch_agent.ini
  • Access anything with VIP_ADDRESS:
    • Horizon on 192.168.2.80 or console.bignetlab.com
    • Grafana on 192.168.2.80:3000 or console.bignetlab.com:3000
    • Prometheus on 192.168.2.80:9090 or console.bignetlab.com:9090
  • Make sure you must mark apt-update docker&containerd on linux to avoid crash/auto restarting docker who effect with operational cluster with
    apt-mark showhold
    apt-mark hold docker containerd
    

Public Cloud Installation

You can go Here to Install on Public VM Cloud.

Multinode Installation of Zed & Quincy (SCRATCH EDITION)

You can go Here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment