Skip to content

Instantly share code, notes, and snippets.

@jbadiapa
Last active October 7, 2018 08:22
Show Gist options
  • Save jbadiapa/6a91478d546bbe84295e9b6cd77374bb to your computer and use it in GitHub Desktop.
Save jbadiapa/6a91478d546bbe84295e9b6cd77374bb to your computer and use it in GitHub Desktop.
SAF-TripleO-Integration

Service Assusance Framework (SAF) - Telemetry Framework (TF)

TripleO Service Assurance Framework Integration

  1. Provisioning with tripleo-quickstart
  2. Disable the unused nodes
  3. Download the Telemetry patch
  4. Deploy Telemetry Framework
  5. Overcloud deployment

Provisioning with tripleo-quickstart

To do the provisioning we are going to use tripleo-quickstart. Some nodes setup is required:

  1. Download the repository
  2. Create the configuration file
  3. Launch the provisioning

Download the repository

git clone https://github.com/openstack/tripleo-quickstart.git

Create the configuration file

cat > ~/openshift-sa.yaml <<EOF
# Deploy an HA openstack environment.
#
# This will require (6144 * 4) == approx. 24GB for the overcloud
# nodes, plus another 8GB for the undercloud, for a total of around
# 32GB.
control_memory: 6144
compute_memory: 6144

undercloud_memory: 12288

# Giving the undercloud additional CPUs can greatly improve heat's
# performance (and result in a shorter deploy time).
undercloud_vcpu: 2

undercloud_generate_service_certificate: True

# Since HA has more machines, we set the cpu for controllers and
# compute nodes to 1
default_vcpu: 2

node_count: 7

# Create three controller nodes and one compute node.
overcloud_nodes:
  - name: openshift_master_0
    flavor: openshift_master
    virtualbmc_port: 6231

  - name: openshift_node_0
    flavor: openshift_worker
    virtualbmc_port: 6232

  - name: openshift_node_1
    flavor: openshift_worker
    virtualbmc_port: 6233

  - name: openshift_node_2
    flavor: openshift_worker
    virtualbmc_port: 6234

  - name: openshift_infra_node_0
    flavor: openshift_infranode
    virtualbmc_port: 6235

  - name: openshift_infra_node_1
    flavor: openshift_infranode
    virtualbmc_port: 6236

  - name: control_0
    flavor: control
    virtualbmc_port: 6237

  - name: compute_0
    flavor: compute
    virtualbmc_port: 6238


# Tell tripleo which nodes to deploy.
topology: >-
  --compute-scale 1
  --control-scale 1

extradisks_size: 70G

undercloud_custom_env_files: "{{ working_dir }}/undercloud-parameter-defaults.yaml"
undercloud_cloud_domain: "localdomain"
undercloud_undercloud_hostname: "undercloud.{{ undercloud_cloud_domain }}"
undercloud_resource_registry_args:
  "OS::TripleO::Undercloud::Net::SoftwareConfig": "{{ overcloud_templates_path }}/net-config-undercloud.yaml"

flavors:
  openshift_master:
    memory: 8192
    disk: '{{openshift_disk|default(default_disk)}}'
    vcpu: 4
    extradisks: true

  openshift_worker:
    memory: 10240
    disk: '{{openshift_disk|default(default_disk)}}'
    vcpu: 2
    extradisks: true

  openshift_infranode:
    memory: 8192
    disk: '{{openshift_disk|default(default_disk)}}'
    vcpu: 1
    extradisks: true

  compute:
    memory: '{{compute_memory|default(default_memory)}}'
    disk: '{{compute_disk|default(default_disk)}}'
    vcpu: '{{compute_vcpu|default(default_vcpu)}}'

  control:
    memory: '{{control_memory|default(default_memory)}}'
    disk: '{{control_disk|default(default_disk)}}'
    vcpu: '{{control_vcpu|default(default_vcpu)}}'

  undercloud:
    memory: '{{undercloud_memory|default(undercloud_memory)}}'
    disk: '{{undercloud_disk|default(undercloud_disk)}}'
    vcpu: '{{undercloud_vcpu|default(undercloud_vcpu)}}'
EOF

Launch the provisioning

Everything is ready to do the provisioning

cd tripleo-quickstart
bash quickstart.sh --release master-tripleo-ci -N ~/openshift-sa.yaml virthost

Disable the unused nodes

Once the undercloud is installed we can see all the baremetal nodes configured

ssh -F ~/.quickstart/ssh.config.ansible undercloud #Log into the undercloud
source stackrc
openstack baremetal node list 

+--------------------------------------+------------------------+---------------+-------------+--------------------+-------------+
| UUID                                 | Name                   | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+------------------------+---------------+-------------+--------------------+-------------+
| e1ee1387-3976-4790-aa50-21a509eca1f9 | openshift-master-0     | None          | power off   | available          | False       |
| 4894a8c3-5bbf-4abd-aa84-e724237276f7 | openshift-node-0       | None          | power off   | available          | False       |
| 922f9858-3e15-423e-b115-0432028298be | openshift-node-1       | None          | power off   | available          | False       |
| f8782b96-38c1-4cca-9a68-3b51b69d43be | openshift-node-2       | None          | power off   | available          | False       |
| 6bae9a86-9edc-4efa-a28f-29d4963f6b56 | openshift-infra-node-0 | None          | power off   | available          | False       |
| cf5f3b8a-6ac4-4b94-bc6e-c0660f1d8360 | openshift-infra-node-1 | None          | power off   | available          | False       |
| 9f5191b0-e32d-4060-902d-64cd0729a851 | control-0              | None          | power off   | available          | False       |
| 1bb16952-3f7a-4336-9801-5a23a22099fb | compute-0              | None          | power off   | available          | False       |
+--------------------------------------+------------------------+---------------+-------------+--------------------+-------------+

To "disable" the nodes that are not required (control-0 & compute-0) we are going to set the maintenance flag

openstack baremetal node maintenance set control-0
openstack baremetal node maintenance set compute-0

It can be seen that the node are in "maintenance"

openstack baremetal node list
+--------------------------------------+------------------------+---------------+-------------+--------------------+-------------+
| UUID                                 | Name                   | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+------------------------+---------------+-------------+--------------------+-------------+
| e1ee1387-3976-4790-aa50-21a509eca1f9 | openshift-master-0     | None          | power off   | available          | False       |
| 4894a8c3-5bbf-4abd-aa84-e724237276f7 | openshift-node-0       | None          | power off   | available          | False       |
| 922f9858-3e15-423e-b115-0432028298be | openshift-node-1       | None          | power off   | available          | False       |
| f8782b96-38c1-4cca-9a68-3b51b69d43be | openshift-node-2       | None          | power off   | available          | False       |
| 6bae9a86-9edc-4efa-a28f-29d4963f6b56 | openshift-infra-node-0 | None          | power off   | available          | False       |
| cf5f3b8a-6ac4-4b94-bc6e-c0660f1d8360 | openshift-infra-node-1 | None          | power off   | available          | False       |
| 9f5191b0-e32d-4060-902d-64cd0729a851 | control-0              | None          | power off   | available          | True        |
| 1bb16952-3f7a-4336-9801-5a23a22099fb | compute-0              | None          | power off   | available          | True        |
+--------------------------------------+------------------------+---------------+-------------+--------------------+-------------+

Download the Telemetry patch

The tripleo-heat-templates repository is needed. Once is downloaded the patch 605724 is also needed. The patch 605724 has everything to create the telemetry framework.

git clone https://github.com/openstack/tripleo-heat-templates.git
cd tripleo-heat-templates
git fetch https://git.openstack.org/openstack/tripleo-heat-templates refs/changes/24/605724/3 && git checkout FETCH_HEAD && git checkout -b WIP_SAF

Deploy Telemetry Framework

The tripleO overcloud deployment is going to be used.

openstack overcloud deploy --stack telemetry --templates /home/stack/tripleo-heat-templates/ -r /home/stack/tripleo-heat-templates/my_roles.yaml  -e /home/stack/tripleo-heat-templates/environments/openshift.yaml -e /home/stack/tripleo-heat-templates/environments/openshift-cns.yaml -e /home/stack/tripleo-heat-templates/params.yaml -e /home/stack/tripleo-heat-templates/environments/networks-disable.yaml -e /home/stack/network-environment.yaml -e /home/stack/containers-prepare-parameter.yaml

Checking that everything is ok.

nova list 
+--------------------------------------+------------------------+--------+------------+-------------+------------------------+
| ID                                   | Name                   | Status | Task State | Power State | Networks               |
+--------------------------------------+------------------------+--------+------------+-------------+------------------------+
| e0af9089-5015-44fe-8a37-008c2d85c3b8 | telemetry-infra-node-0 | ACTIVE | -          | Running     | ctlplane=192.168.24.13 |
| 76969533-2e14-4733-84e2-8dca0b543edb | telemetry-infra-node-1 | ACTIVE | -          | Running     | ctlplane=192.168.24.6  |
| 34cdaa7e-3d9a-4b57-aff2-b9bd06694ad0 | telemetry-master-0     | ACTIVE | -          | Running     | ctlplane=192.168.24.7  |
| 6faec4ac-6a01-4e95-9941-e57d9d09b007 | telemetry-node-0       | ACTIVE | -          | Running     | ctlplane=192.168.24.8  |
| aa07a861-dcaa-493f-aa35-ec9cf09726a6 | telemetry-node-1       | ACTIVE | -          | Running     | ctlplane=192.168.24.9  |
| c3986fc1-792b-46bb-ac2e-0eca0dcc63b5 | telemetry-node-2       | ACTIVE | -          | Running     | ctlplane=192.168.24.17 |
+--------------------------------------+------------------------+--------+------------+-------------+------------------------+

loging to the telemetry-master-0

ssh [email protected]
sudo su - 
oc status
In project default on server https://master.192.168.24.7.nip.io:8443

https://docker-registry-default.apps.192.168.24.7.nip.io (passthrough) (svc/docker-registry)
  dc/docker-registry deploys docker.io/openshift/origin-docker-registry:v3.9.0 
    deployment #1 deployed 8 minutes ago - 1 pod

svc/kubernetes - 172.30.0.1 ports 443->8443, 53->8053, 53->8053

https://registry-console-default.apps.192.168.24.7.nip.io (passthrough) (svc/registry-console)
  dc/registry-console deploys docker.io/cockpit/kubernetes:latest 
    deployment #1 deployed 8 minutes ago - 1 pod

svc/router - 172.30.244.37 ports 80, 443, 1936
  dc/router deploys docker.io/openshift/origin-haproxy-router:v3.9.0 
    deployment #1 deployed 8 minutes ago - 3 pods

View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.


oc get all 
NAME                                 REVISION   DESIRED   CURRENT   TRIGGERED BY
deploymentconfigs/docker-registry    1          1         1         config
deploymentconfigs/registry-console   1          1         1         config
deploymentconfigs/router             1          3         3         config

NAME                            DOCKER REPO                                    TAGS      UPDATED
imagestreams/registry-console   172.30.254.222:5000/default/registry-console   latest    8 minutes ago

NAME                      HOST/PORT                                           PATH      SERVICES           PORT      TERMINATION   WILDCARD
routes/docker-registry    docker-registry-default.apps.192.168.24.7.nip.io              docker-registry    <all>     passthrough   None
routes/registry-console   registry-console-default.apps.192.168.24.7.nip.io             registry-console   <all>     passthrough   None

NAME                          READY     STATUS    RESTARTS   AGE
po/docker-registry-1-qzf2t    1/1       Running   0          8m
po/registry-console-1-wv2ls   1/1       Running   0          8m
po/router-1-8kfgc             1/1       Running   0          8m
po/router-1-plv66             1/1       Running   0          8m
po/router-1-x2mcz             1/1       Running   0          8m

NAME                    DESIRED   CURRENT   READY     AGE
rc/docker-registry-1    1         1         1         8m
rc/registry-console-1   1         1         1         8m
rc/router-1             3         3         3         8m

NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                   AGE
svc/docker-registry    ClusterIP   172.30.254.222   <none>        5000/TCP                  8m
svc/kubernetes         ClusterIP   172.30.0.1       <none>        443/TCP,53/UDP,53/TCP     21m
svc/registry-console   ClusterIP   172.30.193.85    <none>        9000/TCP                  8m
svc/router             ClusterIP   172.30.244.37    <none>        80/TCP,443/TCP,1936/TCP   8m

oc projects
You have access to the following projects and can switch between them with 'oc project <projectname>':

  * default
    glusterfs
    kube-public
    kube-service-catalog
    kube-system
    logging
    management-infra
    openshift
    openshift-ansible-service-broker
    openshift-infra
    openshift-node
    openshift-web-console
    sa-telemetry

Using project "default" on server "https://master.192.168.24.7.nip.io:8443".

To reach the openshift web console from the virthost

ssh -X -F ~/.quickstart/ssh.config.ansible virthost
ip route add 192.168.24.0/24 via UNDERCLOUD_IP
sudo yum install -y firefox
firefox

Deploy the overcloud

Enable the overcloud nodes (compute-0 & control-0)

openstack baremetal node maintenance unset control-0
openstack baremetal node maintenance unset compute-0

Check the IPs of the Infra Nodes

nova list 
+--------------------------------------+-------------------------+--------+------------+-------------+------------------------+
| ID                                   | Name                    | Status | Task State | Power State | Networks               |
+--------------------------------------+-------------------------+--------+------------+-------------+------------------------+
| 332b5661-fe97-4ec3-8ba6-2cc2851a0039 | telemetry-infra-node-0  | ACTIVE | -          | Running     | ctlplane=192.168.24.11 |
| a9100dae-f053-4266-8a80-0b417cc0c19d | telemetry-infra-node-1  | ACTIVE | -          | Running     | ctlplane=192.168.24.22 |
| 2c0bcb9c-6fc2-49c2-a37d-6506ff428a51 | telemetry-master-0      | ACTIVE | -          | Running     | ctlplane=192.168.24.15 |
| dceaa6b2-963a-40a3-9f1f-07c179864786 | telemetry-node-0        | ACTIVE | -          | Running     | ctlplane=192.168.24.9  |
| f67475a2-2b23-49e7-802d-1115eba39afa | telemetry-node-1        | ACTIVE | -          | Running     | ctlplane=192.168.24.30 |
| e0765d77-27fa-4bb2-92ff-d707aa7b19a2 | telemetry-node-2        | ACTIVE | -          | Running     | ctlplane=192.168.24.16 |
+--------------------------------------+-------------------------+--------+------------+-------------+------------------------+

Create the params.yaml configuration file. The IPs of the telemetry-infra-node are going to be needed to create the qdr connectors

cat > params.yaml <<EOF
---
parameter_defaults:
  MetricsQdrConnectors:
    - host: 192.168.24.11
      port: 20001
      role: inter-router
    - host: 192.168.24.22
      port: 20001
      role: inter-router
EOF

Deploy the overcloud.

cd ~/tripleo-heat-templates
git checkout master
cd ~
cp overcloud-deploy.sh overcloud-deploy-overcloud.sh
sed -i 's/usr\/share\/openstack-/home\/stack\//g' overcloud-deploy-overcloud.sh
./overcloud-deploy-overcloud.sh -e /usr/share/openstack-tripleo-heat-templates/environments/metrics-collectd-qdr.yaml -e /home/stack/params.yaml

Check the overcloud bameratal nodes.

nova list 
+--------------------------------------+-------------------------+--------+------------+-------------+------------------------+
| ID                                   | Name                    | Status | Task State | Power State | Networks               |
+--------------------------------------+-------------------------+--------+------------+-------------+------------------------+
| 91278733-73cb-44a3-8a7a-a82828414d12 | overcloud-controller-0  | ACTIVE | -          | Running     | ctlplane=192.168.24.13 |
| 55b1898e-381c-4037-90ee-4514bb28b277 | overcloud-novacompute-0 | ACTIVE | -          | Running     | ctlplane=192.168.24.17 |
| 332b5661-fe97-4ec3-8ba6-2cc2851a0039 | telemetry-infra-node-0  | ACTIVE | -          | Running     | ctlplane=192.168.24.11 |
| a9100dae-f053-4266-8a80-0b417cc0c19d | telemetry-infra-node-1  | ACTIVE | -          | Running     | ctlplane=192.168.24.22 |
| 2c0bcb9c-6fc2-49c2-a37d-6506ff428a51 | telemetry-master-0      | ACTIVE | -          | Running     | ctlplane=192.168.24.15 |
| dceaa6b2-963a-40a3-9f1f-07c179864786 | telemetry-node-0        | ACTIVE | -          | Running     | ctlplane=192.168.24.9  |
| f67475a2-2b23-49e7-802d-1115eba39afa | telemetry-node-1        | ACTIVE | -          | Running     | ctlplane=192.168.24.30 |
| e0765d77-27fa-4bb2-92ff-d707aa7b19a2 | telemetry-node-2        | ACTIVE | -          | Running     | ctlplane=192.168.24.16 |
+--------------------------------------+-------------------------+--------+------------+-------------+------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment