Tripleo Standalone deployment

Steps

  • Provision VM
$ git clone -b centos8 https://gitlab.cee.redhat.com/akahat/ansible-kvm-vm.git
$ sudo dnf install virt-manager qemu-kvm virt-install libguestfs-tools-c -y
$ sudo dnf update -y
$ sudo reboot
$ virtualenv ~/.venv
$ . ~/.venv/bin/activate
$ pip install ansible
$ ansible-playbook ~/ansible-kvm-vm/playbooks/standalone_centos8_dual_nic_playbook.yml 

Or
Create new vm using ISO.

wget  http://mirrors.piconets.webwerks.in/centos-mirror/8.1.1911/isos/x86_64/CentOS-8.1.1911-x86_64-dvd1.iso
sudo virt-install -n CentOS8_tripleo --os-type=Linux --os-variant="centos7.0" --ram=8192 --vcpus=5 --disk path=/var/lib/libvirt/images/CentOS8_Tripleo.qcow2,bus=virtio,size=50 --graphics none --cdrom /root/CentOS-8.1.1911-x86_64-dvd1.iso --network network=default,network=management --print-xml > centos8.xml
virsh define --file /root/centos8.xml
  • Inside VM
dnf install -y libibverbs.so.1 libmlx5 vim  mod_http2
useradd stack
echo "redhat" | passwd stack --stdin
echo "stack ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/stack
rm -rf /etc/sysconfg/network-scripts/ifcfg-ens3
sudo systemctl restart network
  • Add containers_prepare_parameters.yaml
$ cat containers-prepare-parameters.yaml 
# Generated with the following on 2020-03-31T19:11:55.605727
#
#   openstack tripleo container image prepare default --output-env-file /home/zuul/containers-prepare-parameters.yaml
#

parameter_defaults:
  ContainerImagePrepare:
  - set:
      ceph_alertmanager_image: alertmanager
      ceph_alertmanager_namespace: docker.io/prom
      ceph_alertmanager_tag: v0.16.2
      ceph_grafana_image: grafana
      ceph_grafana_namespace: docker.io/grafana
      ceph_grafana_tag: 5.2.4
      ceph_image: daemon
      ceph_namespace: docker.io/ceph
      ceph_node_exporter_image: node-exporter
      ceph_node_exporter_namespace: docker.io/prom
      ceph_node_exporter_tag: v0.17.0
      ceph_prometheus_image: prometheus
      ceph_prometheus_namespace: docker.io/prom
      ceph_prometheus_tag: v2.7.2
#      ceph_tag: v4.0.10-stable-4.0-nautilus-centos-7-x86_64
      name_prefix: centos-binary-
      name_suffix: ''
      namespace: docker.io/tripleomaster
      neutron_driver: ovn
      rhel_containers: false
#      tag: f0874ba386f7bdf324f85771e1dd5beb
# BEGIN ANSIBLE MANAGED BLOCK
#
    push_destination: "192.168.24.1:8787"
    modify_role: tripleo-modify-image
    modify_append_tag: "-updated-20200331190114"
    modify_only_with_labels:
    - kolla_version
    modify_vars:
      tasks_from: yum_update.yml
      yum_repos_dir_path: /etc/yum.repos.d
      update_repo: "gating-repo,delorean-current,quickstart-centos-ceph-nautilus"
# END ANSIBLE MANAGED BLOCK
    tag_from_label: null

  • Add standalone_parameters.yaml
$ cat standalone_parameters.yaml 
parameter_defaults:
  CertmongerCA: local
  CloudName: 192.168.24.1
  ContainerCli: podman
  ContainerImagePrepareDebug: true
  ControlPlaneStaticRoutes: []
  Debug: true
  ConfigDebug: true
  DeploymentUser: stack
  DnsServers: ["8.8.8.8", "1.1.1.1"]
  DockerInsecureRegistryAddress:
  - 192.168.24.1:8787
  #  DockerRegistryMirror: http://mirror.ord.rax.opendev.org:8082/
  MasqueradeNetworks:
    192.168.24.0/24:
    - 192.168.24.0/24
  NeutronPublicInterface: eth1
  StandaloneCtlplaneLocalSubnet: ctlplane-subnet
  StandaloneCtlplaneSubnets:
    ctlplane-subnet:
      DhcpRangeEnd: 192.168.24.40
      DhcpRangeStart: 192.168.24.20
      NetworkCidr: 192.168.24.0/24
      NetworkGateway: 192.168.24.1
  StandaloneEnableRoutedNetworks: false
  StandaloneHomeDir: /home/stack
  InterfaceLocalMtu: 1500
  NovaComputeLibvirtType: qemu
  SELinuxMode: permissive

  • Run openstack tripleo deploy command
  • Order of the parameters matters.
sudo openstack  tripleo deploy \
--templates /usr/share/openstack-tripleo-heat-templates/ \
--standalone --yes --output-dir /home/stack/logs/ \
--standalone-role Standalone --timeout 90 \
-e /usr/share/openstack-tripleo-heat-templates/environments/standalone/standalone-tripleo.yaml \
-e /home/stack/containers_prepare_parameters.yaml \
-e /home/stack/standalone_parameters.yaml \
-e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml \
-e /usr/share/openstack-tripleo-heat-templates/ci/environments/scenario012-standalone.yaml \
-r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml \
--deployment-user stack \
--local-ip 192.168.24.1/24 2>&1 | tee -a /home/stack/standalone_deploy.log

If needed to deploy with some scenario files you can add the following parameters:

-e /usr/share/openstack-tripleo-heat-templates/ci/environments/scenario012-standalone.yaml

Deploy standalone using tripleo-operator-ansible

  • Install tripleo-operator-ansible and ansible in the vm
sudo dnf -y install tripleo-operator-ansible ansible
  • copy the following playbook in the vm
---
###############################################################################
# Standalone installation playbook
#
# Description:
#   This is a basic playbook to run a simple standalone node deploymend on an
#   existing provisioned system.
#
###############################################################################
- hosts: localhost
  collections:
    - tripleo.operator
  vars:
    standalone_debug: true
    standalone_dns:
      - 1.1.1.1
      - 192.168.122.10
    standalone_hostname: 'standalone.localdomain'
    standalone_ip: 192.168.24.1
    standalone_cidr: 24
    standalone_gateway:
    standalone_local_mtu: 1400
    standalone_local_interface: eth1
    standalone_enable_selinux: false
    standalone_virt_type: qemu
    install_debug: true

  tasks:
    - name: Set hostname
      hostname:
        name: "{{ standalone_hostname }}"
      become: true

    - name: Configure tripleo repositories
      include_role:
        name: tripleo_repos
      vars:
        tripleo_repos_debug: "{{ install_debug }}"

    - name: Ensure system is up to date
      yum:
        name: '*'
        state: latest  # noqa 403
      register: packages_updated
      become: true

    - name: Reboot if necessary
      reboot:
      become: true
      when: packages_updated is changed

    - name: Install tripleoclient
      block:
        - name: install python2 tripleoclient
          yum:
            name: python-tripleoclient
            state: installed
          become: true
          when: ansible_distribution_major_version|int <= 7

        - name: install python3 tripleoclient
          package:
            name: python3-tripleoclient
            state: present
          become: true
          when: ansible_distribution_major_version|int >= 8

    - name: Generate parameters.yaml
      copy:
        content: |
          parameter_defaults:
            CloudName: {{ standalone_hostname }}
            {% if standalone_gateway | default(False) -%}
            ControlPlaneStaticRoutes:
              - ip_netmask: 0.0.0.0/0
                next_hop: {{ standalone_gateway }}
                default: true
            {% endif -%}
            Debug: {{ standalone_debug|bool }}
            DeploymentUser: {{ ansible_env.USER }}
            DnsServers: {{ standalone_dns }}
            KernelIpNonLocalBind: 1
            NeutronPublicInterface: {{ standalone_local_interface }}
            NeutronBridgeMappings: datacenter:br-ctlplane
            NeutronPyshicalBridge: br-ctlplane
            StandaloneEnableRoutedNetworks: false
            StandaloneHomeDir: {{ ansible_env.HOME }}
            InterfacesLocalMtu: {{ standalone_local_mtu }}
            NovaComputeLibvirtType: {{ standalone_virt_type }}
            CertmongerCA: local
            ContainerCli: podman
            NtpServer: clock.redhat.com
            SELinuxMode: permissive
            DockerInsecureRegistryAddress:
              - 192.168.24.1:8787
            MasqueradeNetworks:
              192.168.24.0/24:
              - 192.168.24.0/24
            StandaloneCtlplaneSubnets:
              ctlplane-subnet:
                DhcpRangeEnd: 192.168.24.40
                DhcpRangeStart: 192.168.24.20
                NetworkCidr: 192.168.24.0/24
                NetworkGateway: 192.168.24.1
        dest: "{{ ansible_env.HOME }}/parameters.yaml"

    - name: Generate ContainerImagePrepare
      include_role:
        name: tripleo_container_image_prepare_default
      vars:
        tripleo_container_image_prepare_default_output_env_file: "{{ ansible_env.HOME }}/container-image-prepare.yaml"

    - name: Run standalone deployment
      include_role:
        name: tripleo_deploy
      vars:
        tripleo_deploy_debug: "{{ standalone_debug }}"
        tripleo_deploy_templates: /usr/share/openstack-tripleo-heat-templates
        tripleo_deploy_local_ip: "{{ standalone_ip }}/{{ standalone_cidr }}"
        tripleo_deploy_roles_file: /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml
        tripleo_deploy_environment_files:
          - /usr/share/openstack-tripleo-heat-templates/environments/standalone/standalone-tripleo.yaml
          - "{{ ansible_env.HOME }}/container-image-prepare.yaml"
          - "{{ ansible_env.HOME }}/parameters.yaml"
        tripleo_deploy_standalone: true
        tripleo_deploy_output_dir: "{{ ansible_env.HOME }}"

Note: Include vm ip in the standalone_dns and make sure you run all operations in tmux

  • Run the above playbook
$ ansible-playbook standalone.yaml

It will fail after installing and configuring tripleo-repos and system update. We need to re-run the above playbook

  • you can view the standalone deploy log in
$ tail -f ~/standalone_deploy.log
  • You can view the tripleo-container-image-prepare.log
$ tail -f /var/log/tripleo-container-image-prepare.log

Note it will get stuck as connectivity giving no new service error to outer world gets lost, all traffic needs to go through eth0 network interface. so we need to restart the network server and make sure ping to outside is working

$ sudo systemctl restart network
$ ping google.com
  • Let's re-run the deployment, you can find the playbooks generated via config_download in ~/standalone-ansible-<hash> dir and re-run it
$ cd ~/standalone-ansible-<hash>
$ ansible-playbook --become -i inventory.yaml config-download/deploy_steps_playbook.yaml

It will restart the deployment and you are done.

  • Once deployment finishes, we can verify the deployment
$ sudo su
# export OS_CLOUD=standalone
# openstack catalog list
Select a repo