WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Heads Up - ESXi 8.0 Host Client unable to attach existing virtual disk to VM

Heads Up - ESXi 8.0 Host Client unable to attach existing virtual disk to VM

12.07.2022 by William Lam // 9 Comments

A couple of days ago, I had received an email from a customer that after upgrading to ESXi 8.0, they were no longer able to attach an existing virtual disk (VMDK) to a VM using the ESXi Host Client, which is accessible by opening a browser to the Hostname/IP Address of your ESXi host.


After selecting the desired VMDK to attach in ESXi Host Client wizard, the customer had noticed several fields were not populated as shown in the screenshot above and the workflow would not be allowed to complete as these fields are required.

Note: This issue also affects ESXi 7.0 Update 3i and potentially other newer releases, if they also contain the 2.x version of the ESXi Host Client. One workaround, which I have personally verified with ESXi 7.0 Update 3i is to uninstall the bundled esxi-ui VIB and install the prior version by downloading the ESXi offline depot (zip) for ESXi 7.0 Update 3g. While this may not be officially supported, for those that have a standalone ESXi host or using the Free ESXi version, this may be an acceptable workaround until a fix is available in a future patch/update. For detailed instructions, see my reply on this VMTN thread.

My use of the ESXi Host Client is typically limited because I have vCenter Server, but was curious about this issue since this is something I have done in the past using the ESXi Host Client without any issues. I saw the same behavior, which can easily be reproduced by creating a dummy VM with a virtual disk, detaching and attempt to re-attach the same VMDK.

I filed an internal bug and reached out to one of the ESXi Host Client Engineers and they confirmed that this is indeed a bug and they were able to quickly track down the problem relating to one of the Javascript calls which ESXi Host Client uses. This issue will be fixed in a future update of ESXi 8.x and currently only affects ESXi version that uses the new ESXi Host Client 2.x version, which was initially introduced with release of vSphere 8.

For customers that need a solution right now, you can 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 = "[sm-vsanDatastore] 25169063-0084-2e2d-a364-ac1f6b1a4efa/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

More from my site

  • Quick Tip - Accessing new custom theme editor for ESXi 8.0 Host Client
  • Managing ESXi Embedded Host Client settings
  • Automated ESXi Installation with a USB Network Adapter using Kickstart
  • ESXi with Intel Arc 750 / 770 GPU
  • How to bootstrap vSAN Express Storage Architecture (ESA) on unsupported hardware?

Categories // Automation, ESXi, PowerCLI, vSphere 8.0 Tags // embedded host client, ESXi 8.0, host client

Comments

  1. SVC says

    12/07/2022 at 1:11 pm

    When attempting to change a disk from thin to thick from the datastore, I ran into the "A specified parameter was not correct" issue. I then detached the disk and tried again. I then was unable to reattach the disk due to the issue you describe. Looking forward to seeing a fix for both issues in the next release.

    Reply
  2. Osama Muhammad says

    12/08/2022 at 9:22 am

    I found this bug 2 weeks ago the workaround is I created a new independent persistent disk, unregister the VM, manually edit the vmx file to replace the vmdk filename with that of the existing disk that you actually want, then re-register the VM.

    Reply
  3. SprinkleJames says

    12/08/2022 at 2:52 pm

    Hi William,

    So, administering hosts licensed with the free vSphere Hypervisor is an important use case for the ESXi Host Client. Is your PowerCLI solution valid for such hosts? Or does that license disable use of such automation as I believe it does in some previous ESXi versions?

    Reply
    • William Lam says

      12/08/2022 at 4:03 pm

      ESXi host must be licensed with any type EXCEPT the Free Edition

      Reply
  4. André Pett says

    12/10/2022 at 10:00 am

    The ESXi 8.0a release notes mention a workaround for this issue.

    "Workaround: After you select a hard disk and go to the Ready to complete page, do not click Finish. Instead, return one step back, wait for the page to load, and then click Next > Finish."

    https://docs.vmware.com/en/VMware-vSphere/8.0/rn/vsphere-esxi-80a-release-notes/index.html

    Reply
    • William Lam says

      12/10/2022 at 12:52 pm

      I don't believe this is the same issue, since the workaround doesn't really make sense as you can really go back one step ... at least I haven't been able to use it

      Reply
      • André Pett says

        12/11/2022 at 3:42 am

        Sorry, my bad. You're right, the workaround only works with newly created VMs.

        Reply
  5. Shajal says

    12/12/2022 at 2:23 am

    The same thing happened to me, tube 2, solution one through terminal, add the hard drive,
    vim-cmd vmsvc/getallvms
    vim -cmd vmsvc/device.diskaddexisting 8/vmfs/volumes/vm2tbnvme/110lab/110lab.vmdk 0 0,

    The other way is to open the virtual machine console with vmware vmrc from there open menu > manage > Virtual machine settings add the scisi disk

    Reply
  6. Stefan Gubler says

    12/21/2022 at 3:43 pm

    unbelievable. Version 8 and new bugs. If the issue was already in ESX 7U3i why it was not fiex before rolling out version 8 ?
    Mots propably because sales determines the roll out date and not development nor Quality Assurance ! Poor quality. I'm now waiting to upgrade to version 8 and save the money.

    Workaround for users of Vmware Workstation:
    use vmware workstation to connect to your ESX.Server and then open the vm to edit. Adding existing virtual disks is not an issue. It works as desired.

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Automated ESXi Installation with a USB Network Adapter using Kickstart 02/01/2023
  • How to bootstrap ESXi compute only node and connect to vSAN HCI Mesh? 01/31/2023
  • Quick Tip - Easily move or copy VMs between two Free ESXi hosts? 01/30/2023
  • vSphere with Tanzu using Intel Arc GPU 01/26/2023
  • Quick Tip - Automating allowed and not allowed Datastores for use with vSphere Cluster Services (vCLS) 01/25/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...