This article aims to assist in resolving such issues.
Symptoms:
VMware vSphere ESXi 8.0.x
The problem relates to one of the Javascript calls which ESXi Host Client uses and affects the ESXi version that uses the new ESXi Host Client 2.x version, which was initially introduced with the release of vSphere 8.
The issue is resolved in ESXi 8.0b
Release notes:
https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/release-notes/esxi-update-and-patch-release-notes/vsphere-esxi-80b-release-notes.html#GUID-a8f1fd09-e0c2-4fa0-b4c1-881817481593-en_id-a0cd2027-2aee-4f14-969b-54655b97cff3
Workaround:
For customers that need a solution right now, use the following workaround by leveraging Automation. Below is an easy PowerCLI snippet that will allow you to attach an existing VMDK to VM by using the New-HardDisk cmdlet and connecting directly to ESXi host, since it also exposes a vSphere API.
The required parameters is a reference to a VM and the VMDK disk path which is in the format of "[datastore ] path/to/vmdk". While you can programmatically use PowerCLI and the vSphere API to construct this value. An easier way to retrieve this if you are only attaching a handful of VMs is by using the datastore browser within the ESXi Host Client. As you navigate to the desired VMDK, the disk path can be seen immediately below, which you can then copy and save that into the $diskPath variable.
$vm = Get-VM -Name "Test-VM"
$diskPath = "[vsanDatastore] ########-####-####-a364-########/Test-VM_1.vmdk"
New-HardDisk -VM $vm -diskPath $diskPath -Confirm:$false
Below is an example output for running the PowerCLI snippet and now you have the desired VMDK attached to VM