In VMware ESXi, the descriptor file for a VMDK (Virtual Machine Disk) file is a plain text file with a .vmdk extension. The descriptor file contains metadata about the virtual disk, such as disk geometry, file names, and other configuration information. If you suspect that the descriptor file is missing, you can manually create one. Here are the general steps to create a descriptor file for a VMDK:
Open SSH Service from Manage -> Services -> SSH -> Start Service
Connect your ESXI via Putty or another SSH client tool.
Locate path to => /vmfs/volumes/{volumeUUID}
{volumeGuid} is UUID of your datastore
Locate path to your MyDiskFile-flat.vmdk folder.
We will create a new .vmdk file but it will be contain same size metadata as our current .vmdk file. To learn the size of current .vmdk file, we will use this command:
ls - l MyDiskFile.vmdk
Then we will create another .vmdk file descriptor to change its content later:
vmkfstools -c 17179869184 test.vmdk
17179869184
: size of MyDiskFile.vmdk (It is MyDiskFile-flat.vmdk)
We can delete -flat.vmdk file of test.vmdk
rm test-flat.vmdk
Rename test.vmdk to MyDiskFile.vmdk
mv test.vmdk MyDiskFile.vmdk
Change the content of MyDiskFile.vmdk
vi MyDiskFile.vmdk
Press Esc, then :wq to save and exit from Vi editor.
It’s done! You can use MyDiskFile.vmdk as a harddisk file.