vmware / ansible-vsphere-gos-validation

Guest OS validation test set for vSphere using Ansible
Other
41 stars 30 forks source link

[Linux] Update all mount and unmount operations without fstab changing #642

Closed keirazhang closed 2 weeks ago

keirazhang commented 2 weeks ago

The unmount tasks didn't success but it returned OK, which led to ejecting CDROM failure due to the CDROM is still mounted.

This fix replaced all CDROM mount and unmount task with set_mount_point.yml, and updated the mount_state valid values to: mounted and unmounted. The mounted for ansible.builtin.mount state will be replaced by ephemeral. And both of ephemeral and unmounted state will not change /etc/fstab.

For unmounted state, a waiting task was added to set_mount_point.yml to wait the mount point being absent from ansiblle_mounts fact. I added ignore errors to the waiting task because even if it fails, the eject command would also try to unmount the device firstly and then eject it. The waiting task can provide a pause before ejecting the CDROM device in such case.

Test passed on RHEL 9.5 Beta:

+----------------------------------------------------------------------------------+
| VMTools Version           | 12.4.0 (build-23259341)                              |
+----------------------------------------------------------------------------------+
| Config Guest Id           | rhel9_64Guest                                        |
+----------------------------------------------------------------------------------+
| GuestInfo Guest Id        | rhel9_64Guest                                        |
+----------------------------------------------------------------------------------+
| GuestInfo Guest Full Name | Red Hat Enterprise Linux 9 (64-bit)                  |
+----------------------------------------------------------------------------------+
| GuestInfo Guest Family    | linuxGuest                                           |
+----------------------------------------------------------------------------------+
| GuestInfo Detailed Data   | architecture='X86'                                   |
|                           | bitness='64'                                         |
|                           | cpeString='cpe:/o:redhat:enterprise_linux:9::baseos' |
|                           | distroAddlVersion='9.5 (Plow)'                       |
|                           | distroName='Red Hat Enterprise Linux'                |
|                           | distroVersion='9.5'                                  |
|                           | familyName='Linux'                                   |
|                           | kernelVersion='5.14.0-503.11.1.el9_5.x86_64'         |
|                           | prettyName='Red Hat Enterprise Linux 9.5 (Plow)'     |
+----------------------------------------------------------------------------------+

Test Results (Total: 9, Passed: 7, Skipped: 2, Elapsed Time: 00:57:09)
+----------------------------------------------------------------------+
| ID | Name                              |   Status        | Exec Time |
+----------------------------------------------------------------------+
|  1 | deploy_vm_efi_paravirtual_vmxnet3 |   Passed        | 00:19:26  |
|  2 | ovt_verify_pkg_install            |   Passed        | 00:07:16  |
|  3 | paravirtual_vhba_device_ops       |   Passed        | 00:06:12  |
|  4 | lsilogic_vhba_device_ops          | * Not Supported | 00:00:44  |
|  5 | lsilogicsas_vhba_device_ops       | * Not Supported | 00:00:39  |
|  6 | sata_vhba_device_ops              |   Passed        | 00:06:36  |
|  7 | nvme_vhba_device_ops              |   Passed        | 00:06:17  |
|  8 | nvdimm_cold_add_remove            |   Passed        | 00:06:51  |
|  9 | ovt_verify_pkg_uninstall          |   Passed        | 00:02:53  |
+----------------------------------------------------------------------+