Installing AppFormix using Contrail Command
Install AppFormix during the initial installation along with the Contrail and OpenStack installation. AppFormix cannot be installed after the Contrail and OpenStack cluster is already depolyed and imported into Contrail Command.
3-Node setup includes:
Install Centos 7.5 on all three nodes. Install
libvirton the compute nodes using the following command:yum -y install libvirt
Copy the SSH key from the
contrail_commandDocker container to all servers.
The workflow for installing AppFormix and receiving statistics is:
Install AppFormix using Contrail Command.
Configure AppFormix plugins using Ansible.
Enable LLDP for each device and analytics you want to collect.
To install AppFormix using Contrail Command:
- Download the following AppFormix packages from
https://support.juniper.net/support/downloads/ and copy the
tar.gzfiles to/opt/software/appformix/on the Contrail Command host.Note Contrail version 5.1 supports AppFormix version 2.19.10.
appformix-<version>.tar.gz appformix-platform-images-<version>.tar.gz appformix-dependencies-images-<version>.tar.gz appformix-network_device-images-<version>.tar.gz appformix-openstack-images-<version>.tar.gz
- Verify the
command_servers.ymlfile was added before installing Contrail Command as specified in Installing Contrail Command.Copy the images and license files for AppFormix inside the
contrail_commandcontainer in a directory named/opt/software/appformixto make the AppFormix images available in the container. Directory structure needs to be created inside Docker. To do this, adduser_command_volumes:as shown in the following example to thecommand_servers.ymlreferenced in Installing Contrail Command.Note Using the following statements requires that the images and license file reside in
/opt/software/appformixon the All-In-One (AIO) Contrail Cluster server. When adding the following statements to thecommand_servers.ymlfile, they must be placed after the "---" at the very top of the file or as the last two lines at the very bottom of the file.--- user_command_volumes: - /opt/software/appformix:/opt/software/appformix command_servers: server1: ip: 192.168.100.129 - On the Appformix Nodes tab, select Show Advanced and enter the values for each of the following parameters:
Figure 1: Setup > AppFormix Nodes 
Table 1: Advanced Settings Descriptions and Example Corresponding Values from the instances.yml File
Field
Description
AppFormix License (Required)
Path to License
/opt/software/appformix/<appformix-license>-<version>.sig
AppFormix Image Dir (Required)
Path to AppFormix image directory. The path can include
platform-images,network-device-images,openstack-images, ordependencies-imagesdepending on your installation./opt/software/appformix/appformix-platform-images-2.19.10.tar.gz /opt/software/appformix/appformix-dependencies-images-2.19.10.tar.gz /opt/software/appformix/appformix-network_device-images-2.19.10.tar.gz /opt/software/appformix/appformix-openstack-images-2.19.10.tar.gz
AppFormix Version (Required)
Current version to be installed.
appformix_version: 2.19.10
- Select OpenStack Platform Enabled and enter
the values for:
Table 2: OpenStack Platform Settings Descriptions and Examples Corresponding Values from the instances.yml File
Field
Description
Contrail Analytics URL (Required)
URL for the Contrail analytics API. This field should reference the All-In-One (AIO) Contrail Cluster server.
contrail_analytics_url: 'http://192.168.0.28:8081'
Contrail Config URL (Required)
URL for the Contrail configuration API. port on the All-In-One (AIO) Contrail Cluster server.
contrail_config_url: 'http://192.168.0.28:8082'
Contrail Cluster Name
Name by which the Contrail instance will be displayed in the Dashboard.
contrail_cluster_name: 'ContrailCluster1'
- Select the following options. Most of these are enabled
by default.
Table 3: Discovery and Monitor Settings Descriptions and Examples Corresponding Values from the instances.yml File
Field
Description
AppFormix kvm Instance Discovery
Identifies instances on Linux kernel-based virtual machines (KVM.)
appformix_kvm_instance_discovery: True
Network Device Monitoring Enabled
Monitors metrics from network devices, including the topology connections between devices.
appformix_network_device_monitoring_enabled: True
JTI Network Device Monitoring Enabled
Enables JTI streaming telemetry for streaming metrics to AppFormix Agent. This can be enabled for devices running a supported version of Junos.
appformix_jti_network_device_monitoring_enabled: True
Remote Host Monitoring Enabled
Monitor host remotely without installing AppFormix Agent on the host. Metric collection is supported using SNMP (version 2c or 3) and Intelligent Platform Management Interface (IPMI).
appformix_remote_host_monitoring_enabled: True
Network Device Discovery Enabled (Required)
Network devices of a monitored network topology discovered by AppFormix.
network_device_discovery_enabled: True
- Enter the values for the AppFormix Configuration parameters:
appformix_haproxy_datamanager_port_http: 8200appformix_haproxy_datamanager_port_https: 8201You can also edit or remove roles from the AppFormix Configuration pane.
Figure 2: AppFormix Configuration Parameters 
- Add the AppFormix server from the drop-down list in the Available servers section.
- Select a node in the Assigned AppFormix Nodes section.
The roles selected are for the server added in 7. The
following roles are for AppFormix:
appformix_controllerappformix_bare_hostappformix_openstack_controllerappformix_compute
- Click Next to continue to Summary.
- Verify the summary of your configuration and click Provision.
Figure 3: Setup Configuration Summary 
After the AppFormix installation, you can view monitoring by selecting Monitoring > External Apps > AppFormix.
Enable AppFormix Plugins
After the Contrail Command UI- based installation is complete for Openstack, Contrail, and AppFormix, follow these steps to enable AppFormix plugins and receive statistics.
Run the following commands on the contrail-command node.
To enable the AppFormix plugins:
- Activate the virtual environment:
# docker exec -it contrail_command bash # cd /usr/share/contrail/appformix-ansible-deployer/appformix # source venv/bin/activate # cd /opt/software/appformix/inventory/
- Create a host file with entries from the
group_vars/instances.yml.# vi group_vars/instances.yml hosts # cat hosts [appformix_controller] 192.168.0.46 ansible_user=root ansible_ssh_pass=<password> [compute] 192.168.0.28 ansible_user=root ansible_ssh_pass=<password> [openstack_controller] 192.168.0.28 ansible_user=root ansible_ssh_pass=<password>
- Add the following to the
inventory/group_vars/allfile.appformix_openstack_factory_plugins: - { plugin_info: 'certified_plugins/cinder_api_logparser.json', log_file_path: '/var/log/cinder/cinder-api.log'} - { plugin_info: 'certified_plugins/glance_logparser.json', log_file_path: '/var/lib/docker/volumes/kolla_logs/_data/glance/glance-api.log'} - { plugin_info: 'certified_plugins/heavy_hitters.json' } - { plugin_info: 'certified_plugins/keystone_logparser.json', log_file_path: '/var/lib/docker/volumes/kolla_logs/_data/keystone/keystone.log'} - { plugin_info: 'certified_plugins/neutron_logparser.json', log_file_path: '/var/lib/docker/volumes/kolla_logs/_data/neutron/neutron-server.log'} - { plugin_info: 'certified_plugins/nova_logparser.json', log_file_path: '/var/lib/docker/volumes/kolla_logs/_data/nova/nova-api.log'} appformix_plugins: '{{ appformix_openstack_factory_plugins }} + {{ appformix_application_factory_plugins }} + {{ appformix_contrail_factory_plugins }} + {{ appformix_remote_host_factory_plugins }} + {{ appformix_network_device_factory_plugins }}' - Call the AppFormix playbook and the AppFormix plugins
are added.
# cd /opt/software/appformix/; ansible-playbook -i inventory --skip-tags=install_docker appformix-2.19.10/appformix_openstack.yml
Enable LLDP and Analytics To Collect
In the AppFormix software, enable LLDP for each device and any analytics that you want to collect.
- In the AppFormix Dashboard, select the menu in the upper-right corner, then select Settings.
- Select Network Devices > Add Device.
- In the LLDP field, complete the following:
Select Enabled in Device Info for LLDP.
Add the Management IP address, then click Next.
Select SNMP > + in Device Sources to input the SNMP community string. The default community string for each Junos device provisioned is public.
Figure 4: Enable LLDP and Add Management IP for Network Device 
- In the Resource field, select the Resource from
the list, then click Add.
Figure 5: Add Selected Resource for Network Device MIB Configurations 
- Click Submit to complete.
You can set alarms on different aspects of each network device. These alarms can be created in either the AppFormix UI or Contrail Command.
