88 lines
3.0 KiB
YAML
88 lines
3.0 KiB
YAML
---
|
|
- name: Get instance numa node from xml string
|
|
community.general.xml:
|
|
xmlstring: "{{ instance_xml_data }}"
|
|
xpath: /domain/numatune/memory
|
|
content: attribute
|
|
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
|
|
community.general.xml:
|
|
xmlstring: "{{ instance_xml_data }}"
|
|
xpath: /domain/cputune/vcpupin
|
|
content: attribute
|
|
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
|
|
community.general.xml:
|
|
xmlstring: "{{ instance_xml_data }}"
|
|
xpath: /domain/cputune/emulatorpin
|
|
content: attribute
|
|
register: xml_emulatorpin
|
|
|
|
- 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 }}"
|
|
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
|
|
community.general.xml:
|
|
xmlstring: "{{ instance_xml_data }}"
|
|
xpath: /domain/memoryBacking/hugepages/page
|
|
content: attribute
|
|
register: xmlhugepages
|
|
|
|
- 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 }}"
|
|
|
|
# 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
|
|
community.general.xml:
|
|
xmlstring: "{{ instance_xml_data }}"
|
|
xpath: /domain/devices/interface/driver
|
|
content: attribute
|
|
register: xmlqueues
|
|
|
|
- name: Set instance {{ instance_name }} 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 }}"
|