diff --git a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml index 2d7a94095..6690aab1b 100644 --- a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml +++ b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml @@ -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 @@ register: xmlinterfacetype ignore_errors: true -- 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' }}" @@ -33,6 +33,6 @@ - name: Validate NFV instance vars: - instance_id: "{{ vm_id }}" + instance_name: "{{ vm_name }}" import_tasks: validate_instance.yml when: valid_nfv_instance diff --git a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/main.yml b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/main.yml index e30582608..e4fa7b34c 100644 --- a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/main.yml +++ b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/main.yml @@ -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 diff --git a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml index b062fe661..de3c4c1ca 100644 --- a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml +++ b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml @@ -51,7 +51,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: @@ -65,21 +65,21 @@ content: attribute 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 + ' \