Wednesday, February 1, 2012

Unable to remove the vmdk of a VM in vmware esx/esxi and power on the VM

Issue:
there are 3 hard drives for the VM
unable to remove the 2nd and 3rd hdd from the vm with the error “invalid configuration for device 0” but we can remove and readd the first hdd.
The path to these 2nd and 3rd vmdk is not proper and the size is shown as 0mb but in the datastore browser the files are seen intact.
Tried adding the disk 2 and disk 3 again and they got added as hard disk 4 and 5 respectively.
When tried to power on got the error
Failed to find a host for powering on the virtual machine. The following faults explain why the registered host is not compatible. Virtual 'hard disk 2' is not accessible on the host: Unable to access file []<vmname>/<harddiskX>.vmdk
Virtual 'hard disk 3' is not accessible on the host: Unable to access file []<vmname>/<harddiskY>.vmdk”

Resolution:
Removed the VM from the inventory
edited the .vmx file of the VM and removed all the drives by deleting all the lines starting with scsi0:0,scsi0:1, scsi0:2 and then added the VM to the inventory and powered it on.
In this scenario it is recommended just to remove all the vmdk's of the VM via VM>VM settings and then re add them pointing to the last snapshot of the parent disk or the parent disk itself if there are no snapshots.
Issue Resolved.

You may also try:
you may try to just readd the VM to the inventory and try to remove the disks through GUI as suggested by one of the commenters of this post below. 
Edit the .vmx