Getting instance shutdown xml issue
For shutdown instances, using instance name instead of instance id (vm id) is not permanent to get instance xml data. Closes-Bug: #1961550 Change-Id: I295924cac7d2d6df276af038a53acfb435fe06c7
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
# Gets only NFV instances and validates all the NFV instances.
|
# Gets only NFV instances and validates all the NFV instances.
|
||||||
- name: Get instance {{ vm_id }} xml
|
- name: Get instance {{ vm_name }} xml
|
||||||
become: true
|
become: true
|
||||||
shell: >-
|
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
|
register: instance_xml
|
||||||
|
|
||||||
- name: Set instance {{ vm_id }} xml data
|
- name: Set instance {{ vm_name }} xml data
|
||||||
set_fact:
|
set_fact:
|
||||||
instance_xml_data: "{{ instance_xml.stdout }}"
|
instance_xml_data: "{{ instance_xml.stdout }}"
|
||||||
|
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
register: xmlinterfacetype
|
register: xmlinterfacetype
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Set default no valid nfv instance {{ vm_id }}
|
- name: Set default no valid nfv instance {{ vm_name }}
|
||||||
set_fact:
|
set_fact:
|
||||||
valid_nfv_instance: false
|
valid_nfv_instance: false
|
||||||
|
|
||||||
- name: Check whether valid nfv instance {{ vm_id }}
|
- name: Check whether valid nfv instance {{ vm_name }}
|
||||||
set_fact:
|
set_fact:
|
||||||
valid_nfv_instance: true
|
valid_nfv_instance: true
|
||||||
when: "{{ interface_type.interface.type == 'vhostuser' }}"
|
when: "{{ interface_type.interface.type == 'vhostuser' }}"
|
||||||
@@ -33,6 +33,6 @@
|
|||||||
|
|
||||||
- name: Validate NFV instance
|
- name: Validate NFV instance
|
||||||
vars:
|
vars:
|
||||||
instance_id: "{{ vm_id }}"
|
instance_name: "{{ vm_name }}"
|
||||||
import_tasks: validate_instance.yml
|
import_tasks: validate_instance.yml
|
||||||
when: valid_nfv_instance
|
when: valid_nfv_instance
|
||||||
|
|||||||
@@ -193,7 +193,7 @@
|
|||||||
- name: Get instances list on node
|
- name: Get instances list on node
|
||||||
become: true
|
become: true
|
||||||
shell: >-
|
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
|
register: instances_list
|
||||||
|
|
||||||
- name: Get instances id list
|
- name: Get instances id list
|
||||||
@@ -203,10 +203,10 @@
|
|||||||
# Validate all the instances using instances xml
|
# Validate all the instances using instances xml
|
||||||
- name: Loop on all instances and validate xml
|
- name: Loop on all instances and validate xml
|
||||||
include_tasks: check_nfv_instances.yml
|
include_tasks: check_nfv_instances.yml
|
||||||
when: "{{ vm_id }}"
|
when: "{{ vm_name }}"
|
||||||
loop: "{{ vm_list }}"
|
loop: "{{ vm_list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: vm_id
|
loop_var: vm_name
|
||||||
|
|
||||||
# Prints all the validation errors if found.
|
# Prints all the validation errors if found.
|
||||||
- name: Validation errors
|
- name: Validation errors
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
- name: Check emulatorpin valid or not
|
- name: Check emulatorpin valid or not
|
||||||
set_fact:
|
set_fact:
|
||||||
validation_msg: "{{ validation_msg }} + {{ ['Invalid emulatorpin configured for instance ' \
|
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 }}"
|
when: "{{ emulatorpin.emulatorpin.cpuset in vcpus_list | list }}"
|
||||||
loop: "{{ xml_emulatorpin.matches }}"
|
loop: "{{ xml_emulatorpin.matches }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
@@ -65,21 +65,21 @@
|
|||||||
content: attribute
|
content: attribute
|
||||||
register: xmlhugepages
|
register: xmlhugepages
|
||||||
|
|
||||||
- name: Set instance {{ vm_id }} hugepages details
|
- name: Set instance {{ instance_name }} hugepages details
|
||||||
set_fact:
|
set_fact:
|
||||||
msg: |-
|
msg: |-
|
||||||
Huge page size '{{ xmlhugepages.matches[0].page.size }}'
|
Huge page size '{{ xmlhugepages.matches[0].page.size }}'
|
||||||
when: "{{ xmlhugepages.matches[0].page.size | length >= 6 }}"
|
when: "{{ xmlhugepages.matches[0].page.size | length >= 6 }}"
|
||||||
|
|
||||||
# Validates instance tx rx queue sizes and should be greater than or equal to 1024.
|
# 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:
|
community.general.xml:
|
||||||
xmlstring: "{{ instance_xml_data }}"
|
xmlstring: "{{ instance_xml_data }}"
|
||||||
xpath: /domain/devices/interface/driver
|
xpath: /domain/devices/interface/driver
|
||||||
content: attribute
|
content: attribute
|
||||||
register: xmlqueues
|
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:
|
set_fact:
|
||||||
validation_msg: "{{ validation_msg }} + {{ ['Invalid tx/rx queues configured for instance '
|
validation_msg: "{{ validation_msg }} + {{ ['Invalid tx/rx queues configured for instance '
|
||||||
+ instance_id + ', tx queue size: ' + xmlqueues.matches[0].driver.tx_queue_size + ' \
|
+ instance_id + ', tx queue size: ' + xmlqueues.matches[0].driver.tx_queue_size + ' \
|
||||||
|
|||||||
Reference in New Issue
Block a user