Installing AppFormix for OpenStack
AppFormix provides resource control and visibility for hosts and virtual machines in an OpenStack environment. This topic explains how to install AppFormix for OpenStack.
Architecture
AppFormix provides resource control and visibility for hosts, containers, and virtual machines in your cloud infrastructure. Figure 1 shows the AppFormix architecture with OpenStack.
Agent monitors resource usage on the compute nodes.
Controller offers REST APIs to configure the system.
DataManager stores data from multiple Agents.
Dashboard provides a Web-based user interface.
An adapter discovers platform-specific resources and configures the AppFormix Controller.
Adapters exist for OpenStack, Kubernetes, and Amazon EC2.
Installing AppFormix
To install AppFormix:
Install Ansible on the AppFormix Controller node. Ansible will install docker and docker-py on the controller.
apt-get install python-pip python-dev #Installs Pip pip install ansible==2.3 #Installs Ansible 2.3 sudo apt-get install build-essential libssl-dev libffi-dev #Dependencies pip install markupsafe httplib2 #Dependencies
On the vRouter compute nodes where AppFormix Agent runs verify that python
virtualenv
is installed.apt-get install -y python-pip pip install virtualenv
Enable passwordless login to facilitate AppFormix Controller node with Ansible to install agents on the nodes. Run the same command on the AppFormix Controller node also.
ssh-keygen -t rsa #Creates Keys ssh-copy-id -i ~/.ssh/id_rsa.pub <target_host> #Copies key from the node to other hosts
Use the
Sample_Inventory
file as a template to create a host file.# Example naming schemes are as below: # hostname ansible_ssh_user='username' ansible_sudo_pass='password' # List all Compute Nodes [compute] 203.0.113.5 203.0.113.17 # AppFormix controller host # # Host variables can be defined to control AppFormix configuration parameters # for particular host. For example, to specify the directory in which MongoDB # data is stored on hostname1 (the default is /opt/appformix/mongo/data): # # hostname1 appformix_mongo_data_dir=/var/lib/appformix/mongo # # For variables with same value for all AppFormix controller hosts, set group # variables below. # [appformix_controller] 203.0.113.119
Verify that all the hosts listed in the inventory file are reachable from the AppFormix Controller.
export ANSIBLE_HOST_KEY_CHECKING=False # Eliminates interactive experience prompting for Known_Hosts ansible -i inventory -m ping all # Pings all the hosts in the inventory file
At the top-level of the distribution, create a directory named
group_vars
.mkdir group_vars
Every installation requires an authorized license file and Docker images. In
group_vars
directory, create a file named all. Add the following:openstack_platform_enabled: true appformix_version: <version> appformix_manager_version: <version> appformix_license: path/to/appformix-license-file.sig # Location of License Provided appformix_docker_images: - /path/to/appformix-platform-images-<version>.tar.gz - /path/to/appformix-dependencies-images-<version>.tar.gz - /path/to/appformix-openstack-images-<version>.tar.gz
Enable the
Appformix Certified_Plugins
in the file namedall
in thegroup_vars
directory and add the following:appformix_plugins: '{{ appformix_contrail_factory_plugins }} + {{ appformix_network_device_factory_plugins }} + {{ appformix_openstack_factory_plugins }} + {{ appformix_application_factory_plugins }} + {{ appformix_remote_host_factory_plugins }} + {{appformix_network_device_factory_juniper_plugins }}' appformix_network_device_monitoring_enabled: true appformix_remote_host_monitoring_enabled: true appformix_jti_network_device_monitoring_enabled: true
Source the
openrc
file from the OpenStack controller node (/etc/contrail/openstackrc
) to the AppFormix Controller to authenticate the adapter to access admin privileges over the controller services.export OS_USERNAME=<admin user> export OS_PASSWORD=<password> export OS_AUTH_URL=http://<openstack-auth-URL>/v2.0/ export OS_NO_CACHE=1 export OS_PROJECT_DOMAIN_NAME=Default export OS_USER_DOMAIN_NAME=Default export OS_PROJECT_NAME=admin export OS_IDENTITY_API_VERSION=3 export OS_IMAGE_API_VERSION=2
Add the username and password for credentials-based login.
Constraints for creating Username: - Should not be more than 30 characters - Can have anything mentioned below: 1. alphanumeric character 2. '_' or '.' Constraints for creating Password: - 8 characters length or more - 1 digit or more - 1 uppercase letter or more - 1 lowercase letter or more export APPFORMIX_USERNAME=<username> export APPFORMIX_PASSWORD=<password>
Run Ansible with the created inventory file.
ansible-playbook -i inventory appformix_openstack.yml
Removing a Node from AppFormix
To remove a node from AppFormix:
Edit the inventory file and add
appformix_state=absent
to each node that you want to remove from AppFormix.# Example naming schemes are as below: # hostname ansible_ssh_user='username' ansible_sudo_pass='password' # List all Compute Nodes [compute] 203.0.113.5 appformix_state=absent 203.0.113.17
Run Ansible with the edited inventory file. This will remove the node and all its resources from AppFormix.
ansible-playbook -i inventory appformix_openstack.yml