Contrail Insights Installation for OpenStack in HA
HA Design Overview
Contrail Insights Platform can be deployed to multiple hosts for high availability (HA). Platform services continue to communicate using an API proxy that listens on a virtual IP address. Only one host will have the virtual IP at a time, and so only one API proxy will be the “active” API proxy at a time.
The API proxy is implemented by HAProxy. HAProxy is configured to use services in active-standby or load-balanced active-active mode, depending on the service.
At most, one host will be assigned the virtual IP at any given time. This host is considered the “active” HAproxy. The virtual IP address is assigned to a host by keepalived, which uses VRRP protocol for election.
Services are replicated in different modes of operation. In the “active-passive” mode, HAProxy sends all requests to a single “active” instance of a service. If the service fails, then HAProxy will select a new “active” from the other hosts, and begin to send requests to the new “active” service.In the “active-active” mode, HAProxy load balances requests across hosts on which a service is operational.
Contrail Insights Platform can be deployed in a 3-node, 5-node, or 7-node configuration for high availability.
Requirements
For each host, on which Contrail Insights Platform is installed, see Contrail Insights General Requirements for hardware and software requirements. For a list of Contrail Insights Agent supported platforms, see Contrail Insights Agent Requirements.
- Note:
Upgrade notice: Starting with Contrail Insights 3.2.6, the requirement for a license file is removed. If you are installing a version earlier than 3.2.6, a license is required prior to installation.
You can obtain a license key from mailto:APPFORMIX-KEY-REQUEST@juniper.net. Provide the following information in your request:
Group name: Target customers or use: Cluster type: OpenStack Number of hosts: Number of instances:
Connectivity
One virtual IP address to be shared among all the Platform Hosts. This IP address should not be used by any host before installation. It should have reachability from all the Platform Hosts after installation.
Dashboard client (in browser) must have IP connectivity to the virtual IP.
IP addresses for each Platform Host for installation and for services running on these hosts to communicate.
keepalived_vrrp_interface for each Platform Host which would be used for assigning virtual IP address. Details on how to configure this interface is described in the sample_inventory section.
Install Contrail Insights for High Availability
To install Contrail Insights to multiple hosts for high availability:
Download the Contrail Insights installation packages from software downloads to the Contrail Insights Platform node. Get the following files:
contrail-insights-<version>.tar.gz contrail-insights-dependencies-images-<version>.tar.gz contrail-insights-openstack-images-<version>.tar.gz contrail-insights-platform-images-<version>.tar.gz contrail-insights-network_device-images-<version>.tar.gz
If you are installing a version earlier than 3.2.6, copy the Contrail Insights license file to the Contrail Insights Platform node.
Install Ansible on the installer node. Ansible will install docker and the docker Python package on the
appformix_controller
.# sudo apt-get install python-pip python-dev build-essential libssl-dev libffi-dev # sudo pip install ansible==2.7.6 markupsafe httplib2
For Ansible 2.3:
# sudo pip install ansible==2.3 markupsafe httplib2 cryptography==1.5
Install Python and
python-pip
on all the Platform hosts so that Ansible can run between the installer node and theappformix_controller
node.# sudo apt-get install -y python python-pip
Install
python pip
package on the hosts where Contrail Insights Agents run.# apt-get install -y python-pip
To enable passwordless login to all Platform hosts by Ansible, create an SSH public key on the node where Ansible playbooks are run and then copy the key to all the Platform hosts.
# ssh-keygen -t rsa #Creates Keys # ssh-copy-id -i ~/.ssh/id_rsa.pub <platform_host_1>.........#Copies key from the node to all platform hosts # ssh-copy-id -i ~/.ssh/id_rsa.pub <platform_host_2>.........#Copies key from the node to all platform hosts # ssh-copy-id -i ~/.ssh/id_rsa.pub <platform_host_3>.........#Copies key from the node to all platform hosts
Use the sample_inventory file as a template to create a host file. Add all the Platform hosts and compute hosts details.
# List all compute hosts which needs to be monitored by Contrail Insights [compute] 203.0.113.5 203.0.113.17 # Contrail Insights controller hosts [appformix_controller] 203.0.113.119 keepalived_vrrp_interface=eth0 203.0.113.120 keepalived_vrrp_interface=eth0 203.0.113.121 keepalived_vrrp_interface=eth0
Note:Note: In the case of 5-node or 7-node deployment, list all the nodes under
appformix_controller
.At top-level of the distribution, create a directory named
group_vars
and then create a file namedall
inside this directory.# mkdir group_vars # touch group_vars/all
Add the following entries to the newly created
all
file:appformix_vip: <ip-address> appformix_docker_images: - /path/to/contrail-insights-platform-images-<version>.tar.gz - /path/to/contrail-insights-dependencies-images-<version>.tar.gz - /path/to/contrail-insights-openstack-images-<version>.tar.gz
If you are installing a version earlier than 3.2.6, include the path to the Contrail Insights license file in
group_vars/all
:appformix_license: path/to/<contrail-insights-license-file>.sig
Copy and source the
openrc
file from the OpenStack controller node (/etc/contrail/openrc
) to theappformix_controller
to authenticate the adapter to access admin privileges over the controller services.root@installer_node:~# cat /etc/contrail/openrc export OS_USERNAME=<admin user> export OS_PASSWORD=<password> export OS_TENANT_NAME=admin export OS_AUTH_URL=http://<openstack-auth-URL>/v2.0/ export OS_NO_CACHE=1 root@installer_node:~# source /etc/contrail/openrc
Note:In Contrail Insights version 3.2.0, support for discovering OpenStack Octavia Load Balancer services is added. Contrail Insights only collects load balancer state information, such as
provisioning_status
andoperating_status
, as well as flavor information. To enable this service discovery, provide Octavia service's endpoint as variableappformix_octavia_endpoint_url
in thegroup_vars/all
file. For example:appformix_octavia_endpoint_url: http://10.1.1.1:9876
Chargeback costs can also be configured for the Octavia Load Balancer services. See Configure Load Balancer Costs.
Run Ansible with the created inventory file.
ansible-playbook -i inventory appformix_openstack_ha.yml
If running the playbooks as root user then this step can be skipped. As a non-root user (for example. “ubuntu”), the user “ubuntu” needs access to the
docker
user group. The following command adds the user to the docker group.sudo usermod -aG docker ubuntu