The snapshot renaming took some time. When checking the renamed snapshot's name, the task may have not completed.
We need to add "until" to wait for the snapshot rename completion in the renaming snapshot task vm_rename_snapshot.yml.
TASK [Rename snapshot 'BaseSnapshot' to 'BaseSnapshot-2021-04-20-06-46-03'] ****
task path: /root/ansible-vsphere-gos-validation/common/vm_rename_snapshot.yml:11
changed: [localhost] => {
"changed": true,
"invocation": {
"module_args": {
"datacenter": "ansible_test",
"description": "",
"folder": "/ansible_test/vm",
"hostname": "10.182.11.221",
"memory_dump": false,
"moid": null,
"name": "test_vm_65u3_2",
"name_match": "first",
"new_description": null,
"new_snapshot_name": "BaseSnapshot-2021-04-20-06-46-03",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"proxy_host": null,
"proxy_port": null,
"quiesce": false,
"remove_children": false,
"snapshot_name": "BaseSnapshot",
"state": "present",
"use_instance_uuid": false,
"username": "[email protected]",
"uuid": null,
"validate_certs": false
}
},
"renamed": true
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [Display the result of renaming snapshot] *********************************
task path: /root/ansible-vsphere-gos-validation/common/vm_rename_snapshot.yml:25
ok: [localhost] => {
"task_result": {
"changed": true,
"failed": false,
"renamed": true
}
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
redirecting (type: modules) ansible.builtin.vmware_guest_snapshot_info to community.vmware.vmware_guest_snapshot_info
included: /root/ansible-vsphere-gos-validation/linux/open_vm_tools/../../common/vm_get_snapshot_facts.yml for localhost
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /tmp `"&& mkdir "` echo /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002 `" && echo ansible-tmp-1618901165.4852006-6051-132230661455002="` echo /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.vmware_guest_snapshot_info to community.vmware.vmware_guest_snapshot_info
Using module file /root/.ansible/collections/ansible_collections/community/vmware/plugins/modules/vmware_guest_snapshot_info.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1068ecjxkxhr/tmpvcekw0fu TO /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002/AnsiballZ_vmware_guest_snapshot_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002/ /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002/AnsiballZ_vmware_guest_snapshot_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.9 /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002/AnsiballZ_vmware_guest_snapshot_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /tmp/ansible-tmp-1618901165.4852006-6051-132230661455002/ > /dev/null 2>&1 && sleep 0'
TASK [Get VM 'test_vm_65u3_2' snapshot facts] **********************************
task path: /root/ansible-vsphere-gos-validation/common/vm_get_snapshot_facts.yml:4
ok: [localhost] => {
"changed": false,
"guest_snapshots": {
"current_snapshot": {
"creation_time": "2021-04-20T06:38:32.715339+00:00",
"description": "",
"id": 1,
"name": "BaseSnapshot",
"state": "poweredOn"
},
"snapshots": [
{
"creation_time": "2021-04-20T06:38:32.715339+00:00",
"description": "",
"id": 1,
"name": "BaseSnapshot",
"state": "poweredOn"
}
]
},
"invocation": {
"module_args": {
"datacenter": "ansible_test",
"folder": "/ansible_test/vm",
"hostname": "10.182.11.221",
"moid": null,
"name": "test_vm_65u3_2",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"proxy_host": null,
"proxy_port": null,
"use_instance_uuid": false,
"username": "[email protected]",
"uuid": null,
"validate_certs": false
}
}
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [Display the VM snapshot facts] *******************************************
task path: /root/ansible-vsphere-gos-validation/common/vm_get_snapshot_facts.yml:15
ok: [localhost] => {
"vm_snapshot_facts": {
"changed": false,
"failed": false,
"guest_snapshots": {
"current_snapshot": {
"creation_time": "2021-04-20T06:38:32.715339+00:00",
"description": "",
"id": 1,
"name": "BaseSnapshot",
"state": "poweredOn"
},
"snapshots": [
{
"creation_time": "2021-04-20T06:38:32.715339+00:00",
"description": "",
"id": 1,
"name": "BaseSnapshot",
"state": "poweredOn"
}
]
}
}
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [Check snapshot rename result] ********************************************
task path: /root/ansible-vsphere-gos-validation/common/vm_rename_snapshot.yml:30
fatal: [localhost]: FAILED! => {
"assertion": "vm_snapshot_facts.guest_snapshots.snapshots | selectattr('name', 'equalto', current_snapshot_name) | length == 0",
"changed": false,
"evaluated_to": false,
"msg": "Failed to rename snapshot 'BaseSnapshot' to 'BaseSnapshot-2021-04-20-06-46-03'"
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
included: /root/ansible-vsphere-gos-validation/linux/utils/test_rescue.yml for localhost
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [By default revert to base snapshot] **************************************
task path: /root/ansible-vsphere-gos-validation/linux/utils/test_rescue.yml:17
ok: [localhost] => {
"ansible_facts": {
"revert_to_base": true
},
"changed": false
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
included: /root/ansible-vsphere-gos-validation/linux/open_vm_tools/../utils/../../common/print_test_result.yml for localhost
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [Set test case name with play name] ***************************************
task path: /root/ansible-vsphere-gos-validation/common/print_test_result.yml:9
ok: [localhost] => {
"ansible_facts": {
"testcase": "ovt_verify_install"
},
"changed": false
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /tmp `"&& mkdir "` echo /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271 `" && echo ansible-tmp-1618901167.1189125-6085-273815846396271="` echo /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271 `" ) && sleep 0'
Using module file /usr/lib/python3.9/site-packages/ansible/modules/lineinfile.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1068ecjxkxhr/tmp50o2yp_w TO /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271/AnsiballZ_lineinfile.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271/ /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271/AnsiballZ_lineinfile.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.9 /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271/AnsiballZ_lineinfile.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /tmp/ansible-tmp-1618901167.1189125-6085-273815846396271/ > /dev/null 2>&1 && sleep 0'
TASK [Print test case result to test_result.yml] *******************************
task path: /root/ansible-vsphere-gos-validation/common/print_test_result.yml:24
changed: [localhost] => {
"backup": "",
"changed": true,
"diff": [
{
"after": "",
"after_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (content)",
"before": "",
"before_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (content)"
},
{
"after_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (file attributes)",
"before_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (file attributes)"
}
],
"invocation": {
"module_args": {
"attributes": null,
"backrefs": false,
"backup": false,
"create": true,
"firstmatch": false,
"group": null,
"insertafter": null,
"insertbefore": null,
"line": "ovt_verify_install: Failed",
"mode": "644",
"owner": null,
"path": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml",
"regexp": "^ovt_verify_install:",
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"state": "present",
"unsafe_writes": false,
"validate": null
}
},
"msg": "line added"
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [Display the result of print test result to test_result.yml] **************
task path: /root/ansible-vsphere-gos-validation/common/print_test_result.yml:33
ok: [localhost] => {
"print_test_result": {
"backup": "",
"changed": true,
"diff": [
{
"after": "",
"after_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (content)",
"before": "",
"before_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (content)"
},
{
"after_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (file attributes)",
"before_header": "/root/ansible-vsphere-gos-validation/logs/test_vm_65u3_2/2021-04-20-06-13-27/test_result.yml (file attributes)"
}
],
"failed": false,
"msg": "line added"
}
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
TASK [Save current time] *******************************************************
task path: /root/ansible-vsphere-gos-validation/linux/utils/test_rescue.yml:36
ok: [localhost] => {
"ansible_facts": {
"timestamp": "2021-04-20-06-46-07"
},
"changed": false
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
redirecting (type: modules) ansible.builtin.vmware_guest_snapshot to community.vmware.vmware_guest_snapshot
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
included: /root/ansible-vsphere-gos-validation/linux/open_vm_tools/../utils/../../common/vm_take_snapshot.yml for localhost
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /tmp `"&& mkdir "` echo /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563 `" && echo ansible-tmp-1618901167.7551847-6107-41363968906563="` echo /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.vmware_guest_snapshot to community.vmware.vmware_guest_snapshot
Using module file /root/.ansible/collections/ansible_collections/community/vmware/plugins/modules/vmware_guest_snapshot.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1068ecjxkxhr/tmpoiy9cfjb TO /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563/AnsiballZ_vmware_guest_snapshot.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563/ /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563/AnsiballZ_vmware_guest_snapshot.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.9 /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563/AnsiballZ_vmware_guest_snapshot.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /tmp/ansible-tmp-1618901167.7551847-6107-41363968906563/ > /dev/null 2>&1 && sleep 0'
TASK [Create snapshot 'fail-ovt_verify_install-2021-04-20-06-46-07' on 'test_vm_65u3_2'] ***
task path: /root/ansible-vsphere-gos-validation/common/vm_take_snapshot.yml:4
changed: [localhost] => {
"changed": true,
"invocation": {
"module_args": {
"datacenter": "ansible_test",
"description": "",
"folder": "/ansible_test/vm",
"hostname": "10.182.11.221",
"memory_dump": true,
"moid": null,
"name": "test_vm_65u3_2",
"name_match": "first",
"new_description": null,
"new_snapshot_name": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"proxy_host": null,
"proxy_port": null,
"quiesce": false,
"remove_children": false,
"snapshot_name": "fail-ovt_verify_install-2021-04-20-06-46-07",
"state": "present",
"use_instance_uuid": false,
"username": "[email protected]",
"uuid": null,
"validate_certs": false
}
},
"snapshot_results": {
"current_snapshot": {
"creation_time": "2021-04-20T06:46:08.336008+00:00",
"description": "",
"id": 2,
"name": "fail-ovt_verify_install-2021-04-20-06-46-07",
"state": "poweredOn"
},
"snapshots": [
{
"creation_time": "2021-04-20T06:38:32.715339+00:00",
"description": "",
"id": 1,
"name": "BaseSnapshot-2021-04-20-06-46-03",
"state": "poweredOn"
},
{
"creation_time": "2021-04-20T06:46:08.336008+00:00",
"description": "",
"id": 2,
"name": "fail-ovt_verify_install-2021-04-20-06-46-07",
"state": "poweredOn"
}
]
}
}
Read vars_file '{{ testing_vars_file | default('../../vars/test.yml') }}'