Avoid failure when non DPDK instances present
Avoid the validation failure when there are non DPDK instances. The playbook fails when there are instances not containing numatune, vcpupin or hugepages settings on the domain xml content.
Closes-Bug: #1988211
Signed-off-by: Juan Pablo Martí <jmarti@redhat.com>
Change-Id: I243f7781cd72827c0a1f9623a7e994e63d1561b0
(cherry picked from commit 477aaa9877)
This commit is contained in:
committed by
Jiri Podivin
parent
0ba58e88cf
commit
6be51cd366
@@ -6,10 +6,12 @@
|
||||
content: attribute
|
||||
attribute: nodeset
|
||||
register: xml_instance_node
|
||||
when: '"numatune" in instance_xml_data'
|
||||
|
||||
- name: Get instance associated numa nodes
|
||||
set_fact:
|
||||
instance_numa: "{{ xml_instance_node.matches[0].memory.nodeset }}"
|
||||
when: '"numatune" in instance_xml_data'
|
||||
|
||||
# Validates the instance vcpus list.
|
||||
- name: Get vcpu list from xml string
|
||||
@@ -19,6 +21,7 @@
|
||||
content: attribute
|
||||
attribute: cpuset
|
||||
register: xml_vcpus
|
||||
when: '"vcpupin" in instance_xml_data'
|
||||
|
||||
- name: Get instance vcpus list
|
||||
set_fact:
|
||||
@@ -27,6 +30,7 @@
|
||||
loop: "{{ xml_vcpus.matches }}"
|
||||
loop_control:
|
||||
loop_var: vcpu
|
||||
when: '"vcpupin" in instance_xml_data'
|
||||
|
||||
- name: Check vcpu's aligned with DPDK NIC's NUMA
|
||||
become: true
|
||||
@@ -35,11 +39,13 @@
|
||||
numa_node: "{{ instance_numa | int }}"
|
||||
dpdk_nics_numa_info: "{{ dpdk_nics_numa_info }}"
|
||||
register: valid_cpus
|
||||
when: '"vcpupin" in instance_xml_data'
|
||||
|
||||
- name: Check vcpu's valid or not
|
||||
set_fact:
|
||||
validation_msg: "{{ validation_msg }} + {{ [valid_cpus.message] }}"
|
||||
when:
|
||||
- '"vcpupin" in instance_xml_data'
|
||||
- not valid_cpus.valid_cpus
|
||||
|
||||
# Validates instance emulatorpin threads
|
||||
@@ -50,12 +56,15 @@
|
||||
content: attribute
|
||||
attribute: cpuset
|
||||
register: xml_emulatorpin
|
||||
when: '"emulatorpin" in instance_xml_data'
|
||||
|
||||
- name: Check emulatorpin valid or not
|
||||
set_fact:
|
||||
validation_msg: "{{ validation_msg }} + {{ ['Invalid emulatorpin configured for instance ' \
|
||||
+ instance_name + ': ' + emulatorpin.emulatorpin.cpuset] }}"
|
||||
when: "{{ emulatorpin.emulatorpin.cpuset in vcpus_list | list }}"
|
||||
when:
|
||||
- '"emulatorpin" in instance_xml_data'
|
||||
- emulatorpin.emulatorpin.cpuset in vcpus_list | list
|
||||
loop: "{{ xml_emulatorpin.matches }}"
|
||||
loop_control:
|
||||
loop_var: emulatorpin
|
||||
@@ -68,12 +77,15 @@
|
||||
content: attribute
|
||||
attribute: size
|
||||
register: xmlhugepages
|
||||
when: '"memoryBacking" in instance_xml_data and "hugepages" in instance_xml_data'
|
||||
|
||||
- name: Set instance {{ instance_name }} hugepages details
|
||||
set_fact:
|
||||
msg: |-
|
||||
Huge page size '{{ xmlhugepages.matches[0].page.size }}'
|
||||
when: "{{ xmlhugepages.matches[0].page.size | length >= 6 }}"
|
||||
when:
|
||||
- '"memoryBacking" in instance_xml_data and "hugepages" in instance_xml_data'
|
||||
- 'xmlhugepages.matches[0].page.size | length >= 6'
|
||||
|
||||
# Validates instance tx rx queue sizes and should be greater than or equal to 1024.
|
||||
- name: Get {{ instance_name }} libvirt tx | rx queue sizes from xml string
|
||||
|
||||
Reference in New Issue
Block a user