From 956989a5ad8966c06cf3300c2e5edf3f46466edb Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Mon, 28 Jan 2019 20:57:00 +0000 Subject: FIX: Cleanup mechanics for vpp_device Change-Id: Ice975127f8ecdd4cead418151cf37d61dfb218a0 Signed-off-by: Peter Mikus --- resources/libraries/bash/function/device.sh | 13 ++++++++++--- .../ansible/roles/vpp_device/handlers/main.yaml | 4 ++++ .../testbed-setup/ansible/roles/vpp_device/tasks/main.yaml | 9 +++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh index 7a61bf7f71..8aeb221fd9 100644 --- a/resources/libraries/bash/function/device.sh +++ b/resources/libraries/bash/function/device.sh @@ -124,9 +124,16 @@ function clean_environment () { # Kill docker containers. docker rm --force "${DCR_UUIDS[@]}" || die "Cleanup containers failed!" - # Remove DUT1 /tmp volume - docker volume rm "${DCR_VOLUMES[dut1]}" || { - die "Failed to remove DUT1 /tmp volume!" + # Check if some container is using volume and remove all the hanged + # containers before removing volume. Command will not fail in case there + # are no containers to remove. + docker rm --force $(docker ps -q --filter volume=${DCR_VOLUMES[dut1]}) || { + warn "Failed to remove hanged containers or nothing to remove!" + } + + # Remove DUT1 volume. + docker volume rm --force "${DCR_VOLUMES[dut1]}" || { + die "Failed to remove DUT1 volume!" } # Rebind interfaces back to kernel drivers. diff --git a/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml index e2add5cecf..bda9dd4649 100644 --- a/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml @@ -5,3 +5,7 @@ command: systemctl enable csit-initialize-vfs.service tags: enable-vf-service +- name: Update GRUB + command: update-grub + tags: update-grub + diff --git a/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml index d1ede0cfbb..d07f328424 100644 --- a/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml @@ -19,3 +19,12 @@ mode: '644' notify: ['Enable csit-initialize-vfs.service'] tags: copy-vf-service + +- name: Set isolcpus and pstate parameter + lineinfile: + path: '/etc/default/grub' + state: 'present' + regexp: '^GRUB_CMDLINE_LINUX=' + line: 'GRUB_CMDLINE_LINUX="hugepagesz=2M hugepages=65536"' + notify: ['Update GRUB'] + -- cgit 1.2.3-korg