From 78d6399eecbe5a5745966ca57593918ec64ae11f Mon Sep 17 00:00:00 2001 From: dw035535 Date: Wed, 7 May 2025 05:54:04 +0000 Subject: [PATCH 1/3] set nvme_vhba_device_ops_spec13 not applicable Signed-off-by: dw035535 --- .../nvme_vhba_device_ops_spec13.yml | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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..49b11d026 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,17 @@ --- # 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 of Windows Server 2022 +# or Windows 11 and later virtual machines with hardware version 21 and later, +# and a virtual NVMe controller, is set to 1.3 by default. +# Set this test case result to "Not Applicable" in above situation. # - name: nvme_vhba_device_ops_spec13 hosts: localhost @@ -37,6 +47,20 @@ - guest_os_product_type == 'server' - guest_os_ansible_kernel is version('10.0.20348.0', '<') + - 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: + - vm_hardware_version_num | int >= 21 + - (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) + - name: "Test run" include_tasks: vhba_test.yml vars: From e3716fb04df7e092439bf487633722facd3b3814 Mon Sep 17 00:00:00 2001 From: dw035535 Date: Wed, 7 May 2025 06:26:23 +0000 Subject: [PATCH 2/3] enable NVMe spec 1.3 when it's not enabled by default Signed-off-by: dw035535 --- .../nvme_vhba_device_ops_spec13.yml | 19 ++------------ windows/vhba_hot_add_remove/vhba_test.yml | 25 +++++++++++++++++++ .../vhba_hot_add_remove/vhba_test_prepare.yml | 4 +-- 3 files changed, 29 insertions(+), 19 deletions(-) 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 49b11d026..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 @@ -10,9 +10,8 @@ # 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 of Windows Server 2022 -# or Windows 11 and later virtual machines with hardware version 21 and later, -# and a virtual NVMe controller, is set to 1.3 by default. +# 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 @@ -47,20 +46,6 @@ - guest_os_product_type == 'server' - guest_os_ansible_kernel is version('10.0.20348.0', '<') - - 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: - - vm_hardware_version_num | int >= 21 - - (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) - - name: "Test run" include_tasks: vhba_test.yml vars: diff --git a/windows/vhba_hot_add_remove/vhba_test.yml b/windows/vhba_hot_add_remove/vhba_test.yml index d00ef06c9..bca2f0528 100755 --- a/windows/vhba_hot_add_remove/vhba_test.yml +++ b/windows/vhba_hot_add_remove/vhba_test.yml @@ -6,6 +6,31 @@ # - 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: + - vm_nvme_spec13_enabled is defined and vm_nvme_spec13_enabled + - test_purpose == "hot-add-spec13" + - 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) From 4ffe9ab7ce9034815b26602118dac94ec8100af5 Mon Sep 17 00:00:00 2001 From: dw035535 Date: Wed, 7 May 2025 06:29:57 +0000 Subject: [PATCH 3/3] change when conditions Signed-off-by: dw035535 --- windows/vhba_hot_add_remove/vhba_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/windows/vhba_hot_add_remove/vhba_test.yml b/windows/vhba_hot_add_remove/vhba_test.yml index bca2f0528..ffa665919 100755 --- a/windows/vhba_hot_add_remove/vhba_test.yml +++ b/windows/vhba_hot_add_remove/vhba_test.yml @@ -28,8 +28,9 @@ So skip this test case and only run test case 'nvme_vhba_device_ops' with default NVMe v1.3. skip_reason: "Not Applicable" when: - - vm_nvme_spec13_enabled is defined and vm_nvme_spec13_enabled + - 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