

Remove the remaining unnecessary temp-flat file with the rm command, and you're done. When that's done, use the mv command to replace the name of the temporary VMDK file with that of the missing descriptor file. Next, open the tempdisk.vmdk file and change the name of the temporary flat-file to that of the original flat-file from the missing descriptor file. If it was thin-provisioned, use the -d thin parameter or add this line to the descriptor file: ddb.thinProvisioned = "1". If it was originally thick-provisioned, then you're done. Just make sure that the new disk descriptor matches the format of the original disk. Doing so is faster and consumes less disk space.

You can add the parameter -d thin to this command to create a thin-provisioned disk. With this information, use the vmkfstools command, shown in Figure B, to create a new disk with the same size: You can use the ls -l command to find the exact number of bytes. Then, find the size of the flat.vmdk file in your VM folder on the data store. To do this, access your ESXi host via the Secure Shell. If you don't have a previous backup from which to restore, you can create a new disk with the same specifications, and then use that new descriptor file to point to the original data disk, titled "flat.vmdk." The first step to recreating the descriptor file is to restore it from a previous backup.
#Create vmdk from folder how to#
This is the file I'll be showing you how to recreate should it go missing. The file titled ".vmdk" is the descriptor file, which describes the geometry of the virtual disk. These are the files that contain the actual data. If you look even more closely, you'll also notice that for both disks there is a similar file ending with a -flat suffix. It is customary to attach a suffix of _1, _2 and so on to additional disks. If you look at the VMDKs in Figure A, you'll notice that there are files with the VM name and with the _1 suffix (WinFS01.vmdk and WinFS01_1.vmdk, respectively).
