During VM creation, vSphere CPI reports:
"Failed to add DV Port in vmkernel: Status (bad0006)= Limit exceeded"
The allocated memory for a large number of virtual distributed switch ports exceeds the dvsLargeHeap parameter (DVSLargeHeapMaxSize)
In vSphere 7, it is a default of 300
This can go as high as 2048
Increase the value of DVSLargeHeapMaxSize parameter on every affected ESXi host
This can be done using the esxcli cli
Verify the current configuration:
esxcli system settings advanced list -o /Net/DVSLargeHeapMaxSize
To update the setting:
esxcli system settings advanced set -o /Net/DVSLargeHeapMaxSize --int-value 512
VM could not complete creation and power on