Virtually anything is possible!
Recreating a missing VMDK and descriptor file
- Log in to the console of the ESX host.
- Go to the directory that contains the virtual disk with the missing header/descriptor file
- Identify the kind of SCSI controller the virtual disk is using this command:
less *.vmx | grep –i virtualdev - Run this command to identify and record the exact size of the flat file:# ls -l *.vmdk
- Run the vmkfstools command to create a new virtual disk.# vmkfstools -c filesize -a scsi type filename.vmdk
see the example belowvmkfstools -c 4294967296 -a lsilogic temp.vmdkThis command uses the following flags:-c <size> (This is the size of the virtual disk.)
-a <virtual controller> (Whether the virtual disk was configured to work with BusLogic or LSILogic.)If you are short on disk space, you can create the temporary disk as type thin. The associated -flat file consumes almost no space (1Mb) instead of the amount specified with -c (as we are not keeping the new -flat file, this is not a problem). The consequence is that the header file will contain an extra line that must be removed manually. The command looks like this:
# vmkfstools -c 4294967296 -a lsilogic -d thin temp.vmdk
The files temp.vmdk and temp-flat.vmdk are created as a result.
- Check if vmdk was created with this command : ls –ltr *.vmdk
- Delete temp-flat.vmdk as it is not needed. Run the command:# rm temp-flat.vmdk
- Rename temp.vmdk to the name that is required to match the orphaned -flat file
# mv temp.vmdk win2003x86.vmdk
- Use nano to edit the descriptor
- Find the line # Extent description
RW ####### VMFS “temp–flat.vmdk
and change the name of the -flat to match the orphaned -flat file you have. - Find the line with ddb.thinProvisioned and remove it.
(if -d thin was used and the original was not a thin disk)
- Find the line # Extent description
- The Virtual machine is now ready to power on
See the KB article 1002511
| Print article | This entry was posted by VMtech on June 30, 2010 at 16:20, and is filed under Articles, Troubleshooting. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |