1. Log in to the console of the ESX host.
  2. Go to the directory that contains the virtual disk with the missing header/descriptor file
  3. Identify the kind of SCSI controller the virtual disk is using this command:
    less *.vmx | grep –i virtualdev
  4. Run this command to identify and record the exact size of the flat file:# ls -l *.vmdk
  5. 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.

  6. Check if vmdk was created with this command :  ls –ltr *.vmdk
  7. Delete temp-flat.vmdk as it is not needed. Run the command:# rm temp-flat.vmdk
     
  8. Rename temp.vmdk to the name that is required to match the orphaned -flat file
     
    # mv temp.vmdk win2003x86.vmdk
     
  9. Use nano to edit the descriptor
    1. 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.
    2. Find the line with ddb.thinProvisioned and remove it.
      (if -d thin was used and the original was not a thin disk)
  10.   The Virtual machine is now ready to power on

See the KB article 1002511