Setup for low_latency performance tuning 68/1568/1
authorKrisztian Lengyel <krisztian.lengyel@nokia.com>
Wed, 4 Sep 2019 20:56:44 +0000 (16:56 -0400)
committerKrisztian Lengyel <krisztian.lengyel@nokia.com>
Wed, 11 Sep 2019 16:49:08 +0000 (12:49 -0400)
Apply low_latency performance tuning setup. The actual values comes from
the performance profile's `low_latency_options` key.

Depends-On: I0db61be89ce2c3cbf19061898714de383068e120
Change-Id: I6ac3e7bc5f290ead4630fccccc405863e89d773e
Signed-off-by: Krisztian Lengyel <krisztian.lengyel@nokia.com>
playbooks/performance-kernel-cmdline-set.yml
roles/change_kernel_cmdline/tasks/main.yml

index 31f795c..5b8b20d 100644 (file)
@@ -20,5 +20,6 @@
   hosts: base
   gather_facts: "{{ gather_facts | default(True) }}"
   max_fail_percentage: 20
+  strategy: linear
   roles:
     - role: "change_kernel_cmdline"
index 37450c9..b014073 100644 (file)
 - debug:
     var: cpu_alloc
 
+- name: Get tuning option.
+  set_fact:
+    tuning: "{{ perf_profile['tuning'] | default('standard') }}"
+- debug:
+    var: tuning
+
 - name: Make combined CPU lists.
   set_fact:
     cpu_alloc: "{{ cpu_alloc | cpulist_combine(item['name'], item['lists']) }}"
     - { 'opt': 'isolcpus',    'list': 'ovs_dpdk' }
   when: "item['list'] in cpu_alloc"
 
+- name: Make low latency kernel cmdline parameters.
+  set_fact:
+    kcmdline_default_list: "{{ kcmdline_default_list + perf_profile['low_latency_options'] | default([]) ] }}"
+  when:
+    - "tuning == 'low_latency'"
+
 - name: Make hugepage parameters.
   set_fact:
     kcmdline_default_list: "{{ kcmdline_default_list + [ item + '=' + perf_profile[item] | string ] }}"
     name: network
     enabled: yes
 
+- name: Set reboot command
+  set_fact:
+    reboot_cmd: "( sleep 3 && /sbin/reboot & )"
+
 - name: Reboot node
-  shell: ( sleep 3 && /sbin/reboot & )
+  shell: "{{ reboot_cmd }}"
   async: 0
   poll: 0
   ignore_errors: yes
+  register: reboot_node
   when:
     - grub_cmdline.changed or grub_cmdline_default.changed or platform_affinity.changed
     - hostname != installation_controller
     - installation_phase != "postconfig-ended" or (scaled_out_nodes is defined and hostname in scaled_out_nodes) or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
 
 - name: Wait for the server to reboot
-  local_action: wait_for host="{{ansible_host}}" delay=15 state=started port=22 connect_timeout=10 timeout=720
-  when:
-    - grub_cmdline.changed or grub_cmdline_default.changed or platform_affinity.changed
-    - hostname != installation_controller
-    - installation_phase != "postconfig-ended" or (scaled_out_nodes is defined and hostname in scaled_out_nodes) or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
+  wait_for:
+     host: "{{ansible_host}}"
+     port: 22
+     delay: 15
+     search_regex: OpenSSH
+     sleep: 5
+     timeout: 3600
+  connection: local
+  register: remote_success
+  until: remote_success is succeeded
+  retries: 3
+  when: reboot_node is changed
 
 - name: Wait for remote node ssh login. Wating for 10mins max.
   become: "{{ ansible_env.SUDO_USER }}"
   retries: 90
   delay: 10
   no_log: True
-  when:
-    - grub_cmdline.changed or grub_cmdline_default.changed or platform_affinity.changed
-    - hostname != installation_controller
-    - installation_phase != "postconfig-ended" or (scaled_out_nodes is defined and hostname in scaled_out_nodes) or (reinitialized_nodes is defined and hostname in reinitialized_nodes)
+  when: reboot_node is changed
 
 - name: Ensure directory for flag file
   file: