diff --git a/windows/vhba_hot_add_remove/nvme_vhba_device_ops_spec13.yml b/windows/vhba_hot_add_remove/nvme_vhba_device_ops_spec13.yml index 386127d68..89b0aa3d6 100644 --- a/windows/vhba_hot_add_remove/nvme_vhba_device_ops_spec13.yml +++ b/windows/vhba_hot_add_remove/nvme_vhba_device_ops_spec13.yml @@ -3,7 +3,16 @@ --- # Description: # This test case is used for check hotadd, hot remove disk -# on a new and existing NVMe controller with NVMe Spec 1.3 enabled. +# on a new and existing NVMe controller with NVMe Spec 1.3 enabled +# manually. +# Notes: +# Please refer to the release notes of ESXi 8.0.2: +# https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/ +# release-notes/esxi-update-and-patch-release-notes/vsphere-esxi-802-release-notes.html +# Default NVMe version 1.3 for Windows virtual machines: +# Starting with vSphere 8.0 Update 2, the NVMe version is set to 1.3 by default for +# Windows Server 2022 or Windows 11 and later VMs with hardware version 21 and later. +# Set this test case result to "Not Applicable" in above situation. # - name: nvme_vhba_device_ops_spec13 hosts: localhost diff --git a/windows/vhba_hot_add_remove/vhba_test.yml b/windows/vhba_hot_add_remove/vhba_test.yml index d00ef06c9..ffa665919 100755 --- a/windows/vhba_hot_add_remove/vhba_test.yml +++ b/windows/vhba_hot_add_remove/vhba_test.yml @@ -6,6 +6,32 @@ # - lsilogic: no inbox driver in Windows guest OS now, so no testing. # - buslogic: not supported in 64bit Windows guest OS, so no testing. # +- name: "Set fact of whether VM NVMe version 1.3 is enabled by default" + ansible.builtin.set_fact: + vm_nvme_spec13_enabled: >- + {{ + vm_hardware_version_num | int >= 21 and + ((guest_os_product_type == 'server' and guest_os_build_num | int >= 20348) or + (guest_os_product_type == 'client' and guest_os_build_num | int >= 22000)) + }} + when: + - test_disk_ctrl_type == 'nvme' + - vm_nvme_spec13_enabled is undefined + +- name: "Skip test case" + include_tasks: ../../common/skip_test_case.yml + vars: + skip_msg: >- + Skip testing on this guest OS '{{ guest_os_ansible_distribution }}' with VM hardware version + '{{ vm_hardware_version_num }}', since NVMe version is 1.3 by default for Windows Server 2022, + Windows 11 and later VMs with hardware version 21 on ESXi 8.0.2 and later. + So skip this test case and only run test case 'nvme_vhba_device_ops' with default NVMe v1.3. + skip_reason: "Not Applicable" + when: + - test_disk_ctrl_type == 'nvme' + - test_purpose == "hot-add-spec13" + - vm_nvme_spec13_enabled + - name: "Get VM current disk controller info" include_tasks: get_vm_disk_ctrl_info.yml diff --git a/windows/vhba_hot_add_remove/vhba_test_prepare.yml b/windows/vhba_hot_add_remove/vhba_test_prepare.yml index 48ff0d459..02a6e232e 100644 --- a/windows/vhba_hot_add_remove/vhba_test_prepare.yml +++ b/windows/vhba_hot_add_remove/vhba_test_prepare.yml @@ -16,8 +16,8 @@ disk_controller_facts_data: "{{ disk_ctrls_before_hotadd }}" new_vhba_type: "{{ disk_controller }}" -- name: "Enable NVMe spec 1.3" +- name: "Enable NVMe spec 1.3 for NVMe '{{ test_purpose }}' testing" include_tasks: enable_vm_nvme_spec13.yml when: - test_disk_ctrl_type == 'nvme' - - test_purpose in ["hot-add-spec13", "hot-extend"] + - test_purpose == "hot-add-spec13" or (test_purpose == "hot-extend" and not vm_nvme_spec13_enabled)