aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup
diff options
context:
space:
mode:
authorMaros Mullner <maros.mullner@pantheon.tech>2020-02-18 12:29:56 +0100
committerPeter Mikus <pmikus@cisco.com>2020-02-19 13:42:36 +0000
commited648e7c1f6493fd3bd01213ed0692a5b2e1a020 (patch)
tree00087c9f8e4b27a7dc887531a7d830942c6e1a97 /resources/tools/testbed-setup
parentb495b6f2077fc87ec94b821e9bd8ecfe2a588eca (diff)
Re-compile vfio-pci and igb_uio for AWS in ansible scripts.
Signed-off-by: Maros Mullner <maros.mullner@pantheon.tech> Change-Id: I6f0268f510e0c07e45d41f92ae5e2d24d05d407b
Diffstat (limited to 'resources/tools/testbed-setup')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml46
-rw-r--r--resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml10
-rw-r--r--resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml8
-rw-r--r--resources/tools/testbed-setup/ansible/sut_aws.yaml4
-rw-r--r--resources/tools/testbed-setup/ansible/tg_aws.yaml2
5 files changed, 65 insertions, 5 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
index 94dcff4ef3..7b7a7fbb1a 100644
--- a/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
@@ -1,6 +1,25 @@
---
# file: roles/aws/tasks/main.yaml
+- name: AWS - Edit repositories
+ include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+ tags: edit-repo
+
+- name: AWS - Get vfio-pci Patcher Script
+ get_url:
+ url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/vfio-wc-patch.sh"
+ dest: "/opt/vfio-wc-patch.sh"
+ mode: "744"
+ register: "vfio_patch_downloaded"
+ tags:
+ - vfio-aws-patch
+
+- name: AWS - Patch vfio-pci
+ shell: "/bin/bash /opt/vfio-wc-patch.sh"
+ when: "vfio_patch_downloaded"
+ tags:
+ - vfio-aws-patch
+
- name: AWS - Load Kernel Modules By Default
lineinfile:
path: "/etc/modules"
@@ -8,12 +27,33 @@
line: "{{ item }}"
with_items:
- "vfio-pci"
+ - "igb_uio"
+ register: "modules_added"
+ tags:
+ - load-kernel-modules
+
+- name: AWS - Add Kernel Modules Options
+ lineinfile:
+ path: "/etc/modprobe.d/igb_uio.conf"
+ state: "present"
+ line: "{{ item }}"
+ create: "yes"
+ with_items:
+ - "options igb_uio wc_activate=1"
+ when: "modules_added"
+ register: "modules_added"
tags:
- load-kernel-modules
-- name: Performance Tuning - Adjust nr_hugepages
- # change the minimum size of the hugepage pool.
- # 2G VPP, 4GB per VNF/CNF, 2G reserve
+- name: AWS - Reload systemd-modules
+ systemd:
+ name: "systemd-modules-load"
+ state: "restarted"
+ when: "modules_added"
+ tags:
+ - reload-systemd-modules
+
+- name: AWS - Performance Tuning - Adjust nr_hugepages
sysctl:
name: "vm.nr_hugepages"
value: "8192"
diff --git a/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml
new file mode 100644
index 0000000000..75e4a3ae57
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml
@@ -0,0 +1,10 @@
+---
+# file: roles/aws/tasks/ubuntu_bionic.yaml
+
+- name: AWS - Enable deb-src APT Repositories
+ replace:
+ path: "/etc/apt/sources.list"
+ regexp: "^# deb-src "
+ replace: "deb-src "
+ tags:
+ - enable-src-repo
diff --git a/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml
index 9577c5c392..753ebec50c 100644
--- a/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml
@@ -33,5 +33,13 @@
become: yes
command: "make install T={{ dpdk_build_targets[ansible_machine] }}-linux-gcc DESTDIR={{ dpdk_target_dir }}/dpdk-stable-{{ dpdk_version }} chdir={{ dpdk_target_dir }}/dpdk-stable-{{ dpdk_version }}"
when: "linux__dpdk_extracted"
+ register: "linux__dpdk_compiled"
tags:
- install-dpdk
+
+- name: Link igb_uio module
+ shell: "ln -fs {{ dpdk_target_dir }}/dpdk-stable-{{ dpdk_version }}/{{ dpdk_build_targets[ansible_machine] }}-linux-gcc/kmod/igb_uio.ko /lib/modules/`uname -r`/igb_uio.ko && depmod -a"
+ ignore_errors: "yes"
+ when: "linux__dpdk_compiled"
+ tags:
+ - link-igb_uio-module
diff --git a/resources/tools/testbed-setup/ansible/sut_aws.yaml b/resources/tools/testbed-setup/ansible/sut_aws.yaml
index 3f854859f7..4340aa1111 100644
--- a/resources/tools/testbed-setup/ansible/sut_aws.yaml
+++ b/resources/tools/testbed-setup/ansible/sut_aws.yaml
@@ -11,14 +11,14 @@
tags: common
- role: sut
tags: sut
+ - role: dpdk
+ tags: dpdk
- role: aws
tags: aws
- role: iperf
tags: iperf
- role: docker
tags: docker
- - role: dpdk
- tags: dpdk
- role: cleanup
tags: cleanup
- role: calibration
diff --git a/resources/tools/testbed-setup/ansible/tg_aws.yaml b/resources/tools/testbed-setup/ansible/tg_aws.yaml
index 4b5299f255..eb3a303825 100644
--- a/resources/tools/testbed-setup/ansible/tg_aws.yaml
+++ b/resources/tools/testbed-setup/ansible/tg_aws.yaml
@@ -9,6 +9,8 @@
tags: user_add
- role: common
tags: common
+ - role: dpdk
+ tags: dpdk
- role: aws
tags: aws
- role: tg