Ansible Plays for installing and running tests with TE-NS Traffic Generator
https://github.com/vmware/te-ns
- Linux hosts created for TENS Controller and TEDPs (Traffic Generators). This can be one host or multiple depending on your needs and available compute resources.
- Docker installed on TENS Controller and TEDP hosts
- Ansible 2.10 or above installed on the the host that will run the Ansible playbooks for TENS
- The community.docker collection installed with
ansible-galaxy collection install community.docker
- Clone Repo and change to cloned directory
git clone https://github.com/slarimore02/tens-ansible.git
cd tens-ansible
- Edit hosts file
- The IP Address of the TENS Controller should be added to the [te] group
- The IP Address(es) of the TEDPs should be added to the [tedp] group
- Edit global_vars.yml file
- The IP address of the TENS Controller and API port (default 5000) should be added to the respective controller_ip and controller_port variables
- Edit variables in the 1_setup-te-controller.yml as required. The defaults are listed below and should work for most use cases.
vars:
grafana_port: "5002"
redis_port: "6378"
postgres_port: "5432"
zmq_port: "5555"
- Run Ansible Play with the ssh user defined (ubuntu given as example)
ansible-playbook -u ubuntu -i hosts 1_setup-te-controller.yml
- Edit variables in the 2_setup-tedp.yml as required. The dataplane interface and username/password credentials for the hosts should be changed to reflect your environment. Alternatively the credentials can sent via the -e option to the ansible-playbook command.
vars:
tedp_version: "v2.0"
dp_interface: "ens192"
username: "ubuntu"
password: "ubuntu"
- Run Ansible Play with the ssh user defined (ubuntu given as example)
ansible-playbook -u ubuntu -e username=ubuntu -e password=password -i hosts 2_setup-tedp.yml
-
Edit variables in the 3_generate-https-tests.yml or 3_generate-udp-tests.yml files depending on what type of test you'd like to run. These variables will be used to generate a JSON file used by TENS.
-
Run Ansible Play to generate test files. Generated files will be in the files directory.
ansible-playbook 3_generate-https-tests.yml
ansible-playbook 3_generate-udp-tests.yml
- The generated test files can be tweaked as needed based on the following documents:
https://github.com/vmware/te-ns/blob/main/RESOURCE_CONFIGURATION.md
https://github.com/vmware/te-ns/blob/main/SESSION_CONFIGURATION.md
- Edit the test type in the 4_start-test.yml file as needed. The available tests are https_rps or udp_rps.
vars:
test_type: https_rps
- Run Ansible Play to start traffic test
ansible-playbook 4_start-test.yml
ansible-playbook 5_stop-test.yml