Merge "Getting instance shutdown xml issue" into stable/wallaby

This commit is contained in:
Zuul 2022-04-28 15:20:49 +00:00 committed by Gerrit Code Review
commit 7076f26dc7
3 changed files with 13 additions and 13 deletions

View File

@ -1,12 +1,12 @@
---
# Gets only NFV instances and validates all the NFV instances.
- name: Get instance {{ vm_id }} xml
- name: Get instance {{ vm_name }} xml
become: true
shell: >-
"{{ container_cli }}" exec -u root nova_libvirt virsh dumpxml "{{ vm_id }}"
"{{ container_cli }}" exec -u root nova_libvirt virsh dumpxml "{{ vm_name }}"
register: instance_xml
- name: Set instance {{ vm_id }} xml data
- name: Set instance {{ vm_name }} xml data
set_fact:
instance_xml_data: "{{ instance_xml.stdout }}"
@ -18,11 +18,11 @@
attribute: type
register: xmlinterfacetype
- name: Set default no valid nfv instance {{ vm_id }}
- name: Set default no valid nfv instance {{ vm_name }}
set_fact:
valid_nfv_instance: false
- name: Check whether valid nfv instance {{ vm_id }}
- name: Check whether valid nfv instance {{ vm_name }}
set_fact:
valid_nfv_instance: true
when: "{{ interface_type.interface.type == 'vhostuser' }}"
@ -32,6 +32,6 @@
- name: Validate NFV instance
vars:
instance_id: "{{ vm_id }}"
instance_name: "{{ vm_name }}"
import_tasks: validate_instance.yml
when: valid_nfv_instance

View File

@ -193,7 +193,7 @@
- name: Get instances list on node
become: true
shell: >-
"{{ container_cli }}" exec -u root nova_libvirt virsh list --all | awk 'NR > 2 { printf $1 "\n"}'
"{{ container_cli }}" exec -u root nova_libvirt virsh list --all | awk 'NR > 2 { printf $2 "\n"}'
register: instances_list
- name: Get instances id list
@ -203,10 +203,10 @@
# Validate all the instances using instances xml
- name: Loop on all instances and validate xml
include_tasks: check_nfv_instances.yml
when: "{{ vm_id }}"
when: "{{ vm_name }}"
loop: "{{ vm_list }}"
loop_control:
loop_var: vm_id
loop_var: vm_name
# Prints all the validation errors if found.
- name: Validation errors

View File

@ -54,7 +54,7 @@
- name: Check emulatorpin valid or not
set_fact:
validation_msg: "{{ validation_msg }} + {{ ['Invalid emulatorpin configured for instance ' \
+ instance_id + ': ' + emulatorpin.emulatorpin.cpuset] }}"
+ instance_name + ': ' + emulatorpin.emulatorpin.cpuset] }}"
when: "{{ emulatorpin.emulatorpin.cpuset in vcpus_list | list }}"
loop: "{{ xml_emulatorpin.matches }}"
loop_control:
@ -69,21 +69,21 @@
attribute: size
register: xmlhugepages
- name: Set instance {{ vm_id }} hugepages details
- 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 {{ vm_id }} libvirt tx | rx queue sizes from xml string
- 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 {{ vm_id }} devices tx and rx queue size details
- 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 + ' \