This type of situation occurs when you either accidently delete a vmdk and have only a xxxx-flat.vmdk file or if you had a second machine attached to a disk and delete that machine it details the details of the disk. You cannot mount a xxxx-flat.vmdk file to any virtual machine because the machine has no idea how to manage the disk. So you can no longer attach the disk or boot the VM it is attached too. The very first step is to remove the original disk from the machine so there is no way to power on or essentially damage the files. Verify you can still boot the VM successfully but minus the disk (if it was not the primary disk). If you have no disk space to re-create a mirror of this disk (in order to copy the vmdk settings into the problematic file) disk to pull the .vmdk file from and point it to the xxxx-flat.vmdk file so you can create an any size virtual disk on the specified machine and attached it to the xxxx-flat.vmdk and then calculate the the Cylinders, Sectors, and Heads for the original xxxx-flat.vmdk. I found a excellent website to assist the calculations:
This example is of a 510gb disk that was deleted and used a 40gb disk to recreate the xxxx.vmdk I needed. From here I was able to re-create the .VMDK file for the virtual disk as follows (the original):
You can see that the geomotry of the disk changed to reflect the actual listed in VMware when referring to the machine and its attached disks. The most important part is to update the pointer to reflect the xxxx-flat.vmdk file that was the problem. You will notice if you look at the datastore now that the xxxx-flat.vmdk is now hidden and only the xxxx.vmdk is showing. This means you corrected the problem and now you can attach the disk back to the virtual machine. Either complete this step while the machine is running or turn it off and mount it. Anyway you do it, you will be happy that you restored your disk.
Comments (0)