Error: An internal error occurred in the vSphere Client occurs while adding an existing virtual disk to a virtual machine with snapshots
search cancel

Error: An internal error occurred in the vSphere Client occurs while adding an existing virtual disk to a virtual machine with snapshots

book

Article ID: 340512

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • Adding an existing virtual disk to a virtual machine fails
  • When you browse to the virtual disk in the Add Hardware wizard, you see the error:

    An internal error occurred in the vSphere Client
    Details: Object reference not set to an instance of an object.
Contact VMware support if necessary.
  • This error is reported when you try to add an existing virtual disk back into a virtual machine and the virtual machine or previous virtual machine that it came off of had snapshots.When looking at the vmdk descriptor file, while SSHing into the host, you see that it is missing several entries (such asddb.adapterType = "buslogic" or "lsilogic") or that the file is missing entirely (including its associated *-flat.vmdk file)


Environment

VMware ESXi 4.1.x Installable
VMware vCenter Server 4.1.x

Cause

This issue occurs if the virtual machine is copied/moved while the snapshot are in use.

Resolution

To prevent this issue from occurring, remove all snapshots before copying, moving, or performing a vMotion on the virtual machine.
 
To resolve this issue when the virtual machine has been copied/moved while snapshots were in use, clone the affected disk.

From the ESX/ESXi host command-line, navigate to the folder where the virtual machine vmdk files reside and run this command to recreate the <vmname>.vmdk file from the snapshot file:

# vmkfstools -i <vmname>-<latest_snapshot>.vmdk <vmname>.vmdk

For example, for VM test1 with 1 snapshot, run the command:

# vmkfstools -i test1-00001.vmdk test1.vmdk


Additional Information

For related information, see Adding an existing virtual disk to a virtual machine fails with the error: An internal error occurred in the vSphere Client (1031166).
Adding an existing virtual disk to a virtual machine fails with the error: An internal error occurred in the vSphere Client