Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

Products and Accounts

Support

Knowledge

Communities

Success

Learning

My Subscriptions

Loading

Knowledge Base

Recreating a missing VMware virtual machine disk descriptor file (.vmdk) (1002511)

Last Updated: 4/5/2021Categories: How toTotal Views: 162032Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglishGerman

219 like this article

Subscribe to get an email
newsletter with new updates

219 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Details

This article provides steps to recreate a lost virtual disk descriptor file (.vmdk). You may need to recreate missing header/descriptor files if:

The virtual machine disk file listed in the Datastore Browser is your virtual machine's flat file, and does not have an icon.

When powering on a virtual machine, you see a File not found error.

The flat file exists when viewing the virtual machine's directory.

The disk descriptor file for the virtual machine's disk does not exist or is corrupted.

Solution

How to Recreate a lost/missing virtual disk descriptor file (.vmdk):

Video tutorial to recreate a 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:

VMware recommends a regular Full Image Backup of the critical virtual machines for an easy restore in such situations.

VMware also recommends to attempt to restore the missing descriptor file from the backup. This method cannot be used to recreate an encrypted disk descriptor file.

If the impacted virtual machine does not have a full backup, ensure you copy or backup the Flat file to a separate location.

This article availability is only focused on recreating the descriptor file for the virtual machine, Do not edit or change the content of the Flat File as this may end up in data loss.

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:

Connect to the ESXi host as root through SSH or DCUI.

Navigate to the directory that contains the virtual machine disk with the missing descriptor file using the command:

cd /vmfs/volumes/DATASTORE_NAME/VM_NAME

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 :

scsi0.present = "true"
scsi0.sharedBus = "none"
scsi1.present = "true"
scsi1.sharedBus = "virtual"
scsi1.virtualDev = "lsilogic"

Identify and record the exact size of the -flat file using this command:

ls -l vmdisk0-flat.vmdk

-rw------- 1 root root 4294967296 Oct 11 12:30 vmdisk0-flat.vmdk

Use the vmkfstools command to create a new temp virtual disk:

# vmkfstools -c 4294967296 -d thin temp.vmdk

The command uses these flags:

-c size
This is the size of the virtual disk.

-d thin
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.

Delete temp-flat.vmdk, as it is not needed. Run this command:

rm -i temp-flat.vmdk

Rename temp.vmdk to the name that is required to match the orphaned -flat file (or vmdisk0.vmdk , in this example):

mv -i temp.vmdk vmdisk0.vmdk

Edit the descriptor file using "vi" text editor ( vi vmdisk0.vmdk, in this example)

Under the Extent Description section,

Use command "Insert" to allow modifications on the descriptor file.

Locate and change the name of the -flat file to match the orphaned -flat. Once completed - hit "Esc" to exit this mode.

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

# 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"

The virtual machine is now ready to power on. Verify your changes and ensure the Disk chain is consistent before starting the virtual machine.

To check the disk chain for consistency, run this command against the disk descriptor file:

vmkfstools -e filename.vmdk

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.

See Also

VMware Skyline Health Diagnostics for vSphere - FAQ

Editing configuration files in VMware ESXi and ESX (1017022)

Recreating a missing virtual disk (VMDK) descriptor file for delta disks (1026353)

Recreating a missing virtual disk (VMDK) descriptor file for disks split into 2GB files (1026266)

Recreating pass-through Raw Device Mapping (RDM) files for a virtual machine (1026256)

Troubleshooting a virtual machine that is unable to power on (2001005)

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglishGerman

Attachments

Additional Resources

No results for undefined

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

Related Versions:

VMware vSphere ESXi 7.0.0

VMware vSphere ESXi 6.7

VMware vSphere ESXi 6.5

VMware vSphere ESXi 6.0

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant