[AI Generated] BugFix: Use platform capability disk_count instead of vCPU/8 formula for NVMe count validation#4440
Conversation
✅ AI Test Selection — PASSED7 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
@microsoft-github-policy-service agree company="Microsoft" |
|
@knelsonmeister can you check the CI failure? |
…vCPU/8 formula for NVMe count validation
7e2270d to
531d78a
Compare
There was a problem hiding this comment.
Pull request overview
Replaces the hardcoded ceil(vCPU / 8) NVMe namespace count assertion in _verify_nvme_disk with a check against the platform-derived NvmeSettings.disk_count capability, which is correct for non-L-series Azure VMs that also expose NVMe (e.g., Dds_v6 series with remote/temp NVMe).
Changes:
- Removed dependency on
mathandLscpufor computing expected NVMe count. - Look up
NvmeSettingsfromnode.capability.features.itemsand assertlen(nvme_namespace) == nvme_settings.disk_count. - Added defensive assertions that the capability is present and that
disk_countis a concreteint.
✅ AI Test Selection — PASSED7 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
|
Retested after the mypy fix (added
Both sizes pass on commit 531d78a. |
Summary
The
verify_nvme_basictest (step 4 of_verify_nvme_disk) unconditionally asserted that the NVMe namespace count equalsceil(vCPU / 8). This formula only applies to storage-optimized (L-series) VMs with NVMe Direct disks, but was applied to all Azure VMs — causing false failures on VMs like Standard_D4ds_v6 / Standard_D64ds_v6 where NVMe is used for remote/temp disks with different counts.The fix replaces the hardcoded vCPU/8 formula with the platform-derived
NvmeSettings.disk_countcapability, which Azure computes fromNvmeDiskSizeInMiB / NvmeSizePerDiskInMiBin the SKU data. This is correct for all VM types.Validation Results