Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion playbooks/templates/appendix-cloud-report.j2
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@
</td>
<td width="90" style="background: transparent; border: 1.00pt solid #000000; padding: 0.07in"><p align="left" style="page-break-inside: auto; orphans: 0; widows: 0; border: none; padding: 0in; background: transparent; page-break-after: auto">
{% for test, value in v.items() %}
<b>{{ test }}</b>: {{ value }}</p>
{% if value is mapping %}
<b>{{ test | trim }}</b>: {{ value.packets_received }}/{{ value.packets_transmitted }} packets received ({{ value.packet_loss_percent }}% loss), avg RTT {{ value.round_trip_ms_avg }}ms</p>
{% else %}
<b>{{ test | trim }}</b>: {{ value | trim }}</p>
{% endif %}
{% endfor %}
</td>
<td width="260" style="background: transparent; border: 1.00pt solid #000000; padding: 0.07in"><p align="left" style="page-break-inside: auto; orphans: 0; widows: 0; border: none; padding: 0in; background: transparent; page-break-after: auto">
Expand Down
10 changes: 5 additions & 5 deletions roles/network_validation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
ssh -i ~oneadmin/.ssh/id_rsa -o StrictHostKeyChecking=no root@{{item.stdout}} hostname
register: vm_ssh_result
until: vm_ssh_result.rc == 0
retries: 10
delay: 10
retries: 30
delay: 20
loop: "{{ vm_ip.results }}"
run_once: true

Expand All @@ -70,14 +70,14 @@

- name: Check GW reachability from VM
ansible.builtin.shell: |
ssh -i ~oneadmin/.ssh/id_rsa -q -oStrictHostKeyChecking=no root@{{item.stdout}} ping -c 3 $(ip route show default | awk '/default/ {print $3}') | jc --ping --pretty
ssh -i ~oneadmin/.ssh/id_rsa -q -oStrictHostKeyChecking=no root@{{item.stdout}} "ping -c 10 \$(ip route show default | awk '/default/ {print \$3}') | jc --ping --pretty"
register: gw_reachability
loop: "{{ vm_ip.results }}"
run_once: true

- name: Check DNS resolvation
ansible.builtin.shell: |
ssh -i ~oneadmin/.ssh/id_rsa -q -oStrictHostKeyChecking=no root@{{item.stdout}} dig {{ validation.network.ext_host }} | jc --dig -p | jq .[].answer.[].data
ssh -i ~oneadmin/.ssh/id_rsa -q -oStrictHostKeyChecking=no root@{{item.stdout}} "dig {{ validation.network.ext_host }} | jc --dig -p | jq '.[].answer[].data'"
register: dns_reachability
loop: "{{ vm_ip.results }}"
run_once: true
Expand Down Expand Up @@ -109,7 +109,7 @@

- name: Save VM IPs for report
set_fact:
network_verification_results: "{{ (network_verification_results | default({})) | combine({item.0: {'Test VM IP': item.1, '\nNetwork GW ping, packet received': item.2, '\nExternal Host ping: ': item.3, '\nExternal host DNS resolvation':item.4}}) }}"
network_verification_results: "{{ (network_verification_results | default({})) | combine({item.0: {'Test VM IP': item.1, 'Network GW ping': item.2, 'External Host ping': item.3, 'External host DNS resolution': item.4}}) }}"
loop: "{{ one_networks.stdout.splitlines() | zip(vm_ips_list, gw_reachability_list, ext_host_reachability_list, dns_reachability_list) | list }}"


Expand Down
10 changes: 8 additions & 2 deletions roles/storage-benchmark/tasks/storage_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,21 @@
ssh -i ~oneadmin/.ssh/id_rsa -q -oStrictHostKeyChecking=no root@{{ vm_ip.stdout }}
register: ssh_conn_result
until: ssh_conn_result.rc == 0
retries: 10
retries: 20
delay: 10

- name: Run Storage benchmark suite
- name: Install fio on benchmark VM
become: true
become_user: oneadmin
ansible.builtin.shell: |
ssh -q -oStrictHostKeyChecking=no root@{{ vm_ip.stdout }} apk update > /dev/null
ssh -q -oStrictHostKeyChecking=no root@{{ vm_ip.stdout }} apk add fio > /dev/null
when: not (validation.storage_benchmark.skip_fio_install | d(false))

- name: Run Storage benchmark suite
become: true
become_user: oneadmin
ansible.builtin.shell: |
ssh -q -oStrictHostKeyChecking=no root@{{ vm_ip.stdout }} 'cat > /tmp/onebench.fio << "EOF"
[global]
time_based=1
Expand Down
27 changes: 13 additions & 14 deletions roles/test_vm/tasks/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
---
- name: Check if VM template already exists in OpenNebula
ansible.builtin.shell: >
onetemplate list --csv -f NAME='{{ _test_vm_name }}' -l ID --no-header
register: existing_vm_template_id
changed_when: false
failed_when: existing_vm_template_id.rc != 0

- name: Download test VM template and image from the Marketplace
ansible.builtin.shell: |
onemarketapp export $(onemarketapp list -f NAME='{{ _test_vm_name }}' -l ID --no-header) -d $(onedatastore list -f TYPE=img -l ID --no-header | head -n 1) '{{_test_vm_name}}'
register: vm_download
# success when: rc == 0 or rc == 255 and 'NAME is already taken by IMAGE' in stderr
failed_when: "vm_download.rc != 0 and (vm_download.rc != 255 or 'NAME is already taken by IMAGE' not in vm_download.stderr)"
failed_when: vm_download.rc != 0
when: existing_vm_template_id.stdout | trim == ''

- name: Verify VM Download from Marketplace
set_fact:
verification_result: "{{ (verification_result | default({})) | combine({'Download a test VM template from the marketplace' : 'ok' }) }}"
when: vm_download is not skipped and vm_download.rc == 0

# We have to check that image was downlodaded before attempting to instantiate VM
- name: Get newly downloaded VM template ID
ansible.builtin.shell: >
echo '{{ vm_download.stdout }}' | grep -A1 VMTEMPLATE | grep ID | awk '{print $2}'
register: new_vm_template_id
failed_when: "new_vm_template_id.rc != 0"
when: vm_download.rc == 0

- name: Get existing VM template ID
ansible.builtin.shell: >
onetemplate list --csv -f NAME='{{ _test_vm_name }}' -l ID --no-header
register: existing_vm_template_id
failed_when: "existing_vm_template_id.rc != 0"
when: vm_download.rc == 255 and 'NAME is already taken by IMAGE' in vm_download.stderr
failed_when: new_vm_template_id.rc != 0
when: vm_download is not skipped and vm_download.rc == 0

- name: Set VM template ID
set_fact:
vm_template_id: "{{ new_vm_template_id if not new_vm_template_id.skipped|default(false) else existing_vm_template_id }}"
failed_when: new_vm_template_id.skipped|default(false) and existing_vm_template_id.skipped|default(false)
vm_template_id: "{{ new_vm_template_id if (vm_download is not skipped and vm_download.rc == 0) else existing_vm_template_id }}"

- name: Write extra template variables to a temporary file on the remote host
ansible.builtin.copy:
Expand Down