A collection of Ansible playbooks to detect and report potential issues during TripleO deployments
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
tripleo-validations/roles/check_nfv_ovsdpdk_zero_pack.../tasks/validate_instance.yml

91 lines
3.0 KiB

---
- name: Get instance numa node from xml string
xml:
xmlstring: "{{ instance_xml_data }}"
xpath: /domain/numatune/memory
content: attribute
attribute: nodeset
register: xml_instance_node
- name: Get instance associated numa nodes
set_fact:
instance_numa: "{{ xml_instance_node.matches[0].memory.nodeset }}"
# Validates the instance vcpus list.
- name: Get vcpu list from xml string
xml:
xmlstring: "{{ instance_xml_data }}"
xpath: /domain/cputune/vcpupin
content: attribute
attribute: cpuset
register: xml_vcpus
- name: Get instance vcpus list
set_fact:
vcpus_list: |-
{{ (vcpus_list | default([])) }} + {{ [vcpu.vcpupin.cpuset] }}
loop: "{{ xml_vcpus.matches }}"
loop_control:
loop_var: vcpu
- name: Check vcpu's aligned with DPDK NIC's NUMA
become: true
check_cpus_aligned_with_dpdk_nics:
cpus: "{{ vcpus_list | join(',') }}"
numa_node: "{{ instance_numa | int }}"
dpdk_nics_numa_info: "{{ dpdk_nics_numa_info }}"
register: valid_cpus
- name: Check vcpu's valid or not
set_fact:
validation_msg: "{{ validation_msg }} + {{ [valid_cpus.message] }}"
when:
- not valid_cpus.valid_cpus
# Validates instance emulatorpin threads
- name: Get emulatorpin list from xml string
xml:
xmlstring: "{{ instance_xml_data }}"
xpath: /domain/cputune/emulatorpin
content: attribute
attribute: cpuset
register: xml_emulatorpin
- name: Check emulatorpin valid or not
set_fact:
validation_msg: "{{ validation_msg }} + {{ ['Invalid emulatorpin configured for instance ' \
+ instance_id + ': ' + emulatorpin.emulatorpin.cpuset] }}"
when: "{{ emulatorpin.emulatorpin.cpuset in vcpus_list | list }}"
loop: "{{ xml_emulatorpin.matches }}"
loop_control:
loop_var: emulatorpin
# Validates instance huge page size length is greater than or equal to 6.
- name: Get hugepages from xml string
xml:
xmlstring: "{{ instance_xml_data }}"
xpath: /domain/memoryBacking/hugepages/page
content: attribute
attribute: size
register: xmlhugepages
- name: Set instance {{ vm_id }} hugepages details
set_fact:
msg: |-
Huge page size '{{ xmlhugepages.matches[0].page.size }}'
when: "{{ xmlhugepages.matches[0].page.size | length >= 6 }}"
# Validates instance tx rx queue sizes and should be greater than or equal to 1024.
- name: Get {{ vm_id }} libvirt tx | rx queue sizes from xml string
xml:
xmlstring: "{{ instance_xml_data }}"
xpath: /domain/devices/interface/driver
content: attribute
register: xmlqueues
- name: Set instance {{ vm_id }} devices tx and rx queue size details
set_fact:
validation_msg: "{{ validation_msg }} + {{ ['Invalid tx/rx queues configured for instance '
+ instance_id + ', tx queue size: ' + xmlqueues.matches[0].driver.tx_queue_size + ' \
& rx queue size: ' + xmlqueues.matches[0].driver.rx_queue_size] }}"
when: "{{ xmlqueues.matches[0].driver.tx_queue_size | int < 1024 and xmlqueues.matches[0].driver.rx_queue_size | int < 1024 }}"