In the future, using the website cloudhosting.lv, you agree to the rules of using Cookies. Read more. I agree
Recreating a missing VMware virtual machine disk descriptor file (.vmdk) (1002511)
Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis
Details:
This article provides steps to recreate a lost virtual disk descriptor file (.vmdk). You may need to recreate missing header/descriptor files if:
Solution:
How to Recreate a lost/missing virtual disk descriptor file (.vmdk):
Note: From the video, the vmkfstools -a option is used. From ESXi 6.5 version and later, this option is deprecated and it will be ignored with following message: "--adaptertype is deprecated and hence will be ignored".
Important Note:
Note: This procedure will not work on virtual disks configured with a Para-virtualized SCSI controller in the virtual machine as the virtual machine may not boot However, if the Para-virtualized SCSI controller is used, the new descriptor file can also be updated with ddb.adapterType = pvscsi replacing ddb.adapterType = lsilogic in the file.
Steps to create a virtual machine disk descriptor file:
1.Connect to the ESXi host as root through SSH or DCUI.
2.Navigate to the directory that contains the virtual machine disk with the missing descriptor file using the command: 3.Identify the type of SCSI controller the virtual disk is using by examining the virtual machine configuration file (.vmx ). The controller is identified by the line scsi#.virtualDev , where # is the controller number. This example uses lsilogic : 4.Identify and record the exact size of the -flat file using this command: ls -l vmdisk0-flat.vmdk 5.Use the vmkfstools command to create a new temp virtual disk: This is the size of the virtual disk. This creates the disk in thin-provisioned format. The temp.vmdk and temp-flat.vmdk files are created as a result. Note: To save disk space, we create the disk in thin-provisioned format using the type thin. The only consequence, however, is that the descriptor file contains an extra line that must be manually removed in a later step if the original disk is not Thin provisioned. 6.Delete temp-flat.vmdk, as it is not needed. Run this command: 7.Rename temp.vmdk to the name that is required to match the orphaned - flat file (or vmdisk0.vmdk , in this example): 8.Edit the descriptor file using "vi" text editor ( vi vmdisk0.vmdk, in this example) 1.Under the Extent Description section: 2.Find and remove the line ddb.thinProvisioned = "1" if the original .vmdk was not a thin disk. If it was, retain this line. Use command ":wq!" to save and exit "vi" editor. Example: The virtual machine is now ready to power on. Verify your changes and ensure the Disk chain is consistent before starting the virtual machine. 9.To check the disk chain for consistency, run this command against the disk descriptor file: For a complete chain, you see output similar to: Disk chain is consistent. For a broken chain, you see a summary of the snapshot chain and then an output similar to: Disk chain is not consistent : The parent virtual disk has been modified since the child was created. The content ID of the parent virtual disk does not match the corresponding parent content ID in the child (18).
Related Information
Additional Information
Each disk drive for a virtual machine consists of a pair of .vmdk files. One is a text file containing descriptive data about the virtual hard disk, and the second is the actual content of that disk. For example, a virtual machine named examplevm has one 10GB disk attached to it. This disk is comprised of a examplevm.vmdk descriptor file of under 1 KB, and a 10 GB examplevm-flat.vmdk flat file which contains virtual machine content.scsi0.present = "true"
scsi0.sharedBus = "none"
scsi1.present = "true"
scsi1.sharedBus = "virtual"
scsi1.virtualDev = "lsilogic"
-rw------- 1 root root 4294967296 Oct 11 12:30 vmdisk0-flat.vmdk
# vmkfstools -c 4294967296 -d thin temp.vmdk
The command uses these flags:
-c size
-d thin
rm -i temp-flat.vmdk
mv -i temp.vmdk vmdisk0.vmdk
# Disk DescriptorFile
version=1
CID=fb183c20
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 8388608 VMFS "vmdisk0-flat.vmdk"
# The Disk Data Base
#DDB
ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "522"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
ddb.thinProvisioned = "1"
vmkfstools -e filename.vmdk