<

How to: Re-create the missing VMDK File Descriptor.

Published on
3,312 Points
212 Views
1 Endorsement
Last Modified:
R@f@r P@NC3R
Never give up - The effort and daily dedication make a person a winner
The following article describes how to recreate the VMDK file of a virtual machine.

It is important that this file is always in the datastore where the VM is stored, because if the VM is not present, it will not be able to turn on and an error

I  hope it is very useful for everyone.

Introduction.


First, what is a VMDK file in a virtual machine?


The disk description file or .vmdk, is a metadata file that contains data that describe the geometric characteristics and size of the disk where the data will be stored.

A virtual disk is made up of two files:
• File descriptor, its extension is (.vmdk).
• Flat file, where the data is saved, its extension is (flat.vmdk).


Example of a VMDK descriptor file (See image 1.0).


1.0.Parameters of a VMDK file.


I explain a summary of the origin of the problem:

In my virtual environment we currently have several virtual servers configured with the SCSI-Bus Sharing controller, which allows sharing virtual disks between virtual machines.

One of the limitations of this controller is that it does not allow vmotion with the virtual machine on, which is why we proceeded to turn off the server to perform the migration.

Once I made the migration of the virtual machine I proceeded to turn it on, but the following error appeared (See images 1.1 and 1.2).

1.1. When turning on the virtual machine, it indicates the following error:


1.2. Validating server events, it indicates the following:


Validating the datastore where the server is hosted, I could see that the VMDK file was not present, which is why it prevents me from turning on the virtual machine. (See images 1.3).


1.3.Virtual machine without the VMDK file present in the Datastore.


Throughout the article I will describe the steps to recreate the VMDK file of the virtual machine.


Activate the SSH service on the ESXi Host:


1.1.Select the ESXi, click on the Manage option.


1.2.Select Security Profile - Click on Edit.


1.3.Select SSH option. It can be seen that the SSH service is stopped.
Click on Start.


1.4.The SSH service is running. Click on OK.


1.5.In the task bar you can see that the SSH service started.


1.6.Login via SSH to the ESXi Host,using Putty. Enter the IP address of the ESXi.


Re-create the missing VMDK File Descriptor:


1.1. Enter via SSH to the ESXi where the affected virtual machine is hosted. Enter credentials
Go to the path where the virtual machine is stored. See attached image.


1.2. Once on the route, enter the command ls -lah, to validate the virtual machine records.


1.3. Enter the command less * .vmx | grep -i virtualdev To validate the VM controller.


1.4. Enter the command ls -l followed by the name of the vm along with the extension flat.vmdk.
To validate the Id of the disk.


1.5. We will carry out a cloning with the vmkfstools utility, to create a temporary file of the virtual disk, as it is visualized in the image.
-c: Indicates cloning the disk - Id of the disk.
-a: Type of virtual controller.
-d: Type of disk format


1.6. Go to the Datastore where the VM is stored and validate the creation of the temp.vmdk registry.


1.7. Validate the file system of the VM, and validate that the records are found:
temp-flat.vmdk and temp.vmdk. As shown in the picture.


1.8. Enter the command mv -i temp.vmdk followed by the name of the VM, to enter the registry. See attached image.


1.9. The parameters of the temp-flat.vmdk record are displayed.


2.1. Go to the Extent description parameter.
Replace the name temp-flat.vmdk with the name of the VM "VEPPHFEX12-flat.vmdk"


2.2. Enter the command rm -i to remove the temporary record. Press the "Y" key, to confirm the deletion. See attached image.


2.3. Go to the Datastore where the VM is stored and validate the creation of the disc descriptor record VEPPHFEX12.vmdk.


2.4. Enter the vi command to enter the disc descriptor record.


2.5. Move to the The Disk Data Base parameter.


2.6. Select the parameter ddb.thinProvisioned = "1" and delete it.


2.7. The parameter was removed, it is no longer found in the descriptor file.


2.8. Execute the vmkfstools -e command to check the consistency of the virtual disk.
       Example: vmkfstools -e VEPPHFEX12.vmdk.


2.9. Go to the inventory of the vCenter and turn on the VM.


3.0. It is displayed in the inventory that the VM is on.


3.1. Click on Launch Console to validate that the operating system starts.


3.2. It can be seen that the operating system started without problems.


Congratulations, your virtual disk has been rebuilt and your VM can now be turned on without problems.


1
Comment
  • 6
  • 2
9 Comments
 
LVL 5

Author Comment

by:R@f@r P@NC3R
Good evening Andrew,

Correct, the procedure indicates how to create the descriptor of the VMDK file, I will take into account all your suggestions and recommendations to improve the article, tomorrow I will annex all the recommendations that you are indicating to me and I will upload it again to be evaluated.

Best regards
0
 
LVL 5

Author Comment

by:R@f@r P@NC3R
Good afternoon, apply the recommendations indicated in the article.

Waiting for your comments.
Greetings.
0
 
LVL 127

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Hello, $vJR-LDv

The Introduction, and Parts 1.0 to 1.6 are confusing. I think an explaination is needed as to what makes up the virtual disk....

I've been reviewing the technical content of your EE Article.

I think the opening Introduction is a little confusing.

The article is a HOWTO, of how to re-create the missing VMDK file descriptor.

If I was writing the article... I would start with..something like...

the background to this problem, Cannot Power on virtual machine...

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

Checking the host server using PuTTY (SSH)

is - a pair of files make up a virtual disk.

a normal VMDK file is  

a)  filename-flat.vmdk <---- this contains all the disk data
b)  filename.vmdk <----- this is a text file ---> called the file descriptor

the above filename on occasion disappears, and we have to re-create it!

That is the crux of the problem...

You have a good screen shot showing the missing VMDK file descriptor...which you can use as an example, and then lead into the re-creation of the file, which solves the issue.

To allow you time to make your edits as suggested by myself, I have moved the article back to "Draft and Author Review" status.

Please use "Save as Draft" while making any additions and changes, and only use the "Submit" button once you feel they are both ready for publishing.

Thank you and I'll look forward to reviewing your work again.

Regards

Andrew Hancock
Experts Exchange Page Editor
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
LVL 5

Author Comment

by:R@f@r P@NC3R
good afternoon Andrew,

Make the indicated modifications.

regards
0
 
LVL 5

Author Comment

by:R@f@r P@NC3R
Good afternoon Andrew,

Make other modifications to the article, I remain attentive to your comments.
0
 
LVL 5

Author Comment

by:R@f@r P@NC3R
Good afternoon Andrew,

Thank you very much, for your help and recommendations, they helped me a lot.

Best regards.
0
 

Expert Comment

by:Nabeel Ahmed
Hello,

I am trying to recreate the virtual machine disk file with the above mentioned solution but seems stuck/confuse at the step where i need to edit the newly created .vmdk file, i renamed it as with the original vm name. but when i use vi VM-NAME.vmdk , i am not able to see any content in the file it shows blank file.

Now from where i can edit the descriptor file under the Extent Description, since no content is visible in the vm-name.vmdk file.

My Current Infrastructure is : V-Center HA with two hosts and mounted different data stores using ISCSi share datastores from different storage.

V-Center version: 5.5.0 Build 1300321
Hosts esxi version: 5.5.0 Build 1623387

where i am going wrong. an urgent response is needed on the query since this is a production server and its vmdk is missing since this morning abruptly.

Cheers!
0
 
LVL 127

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Nabeel Ahmed

I would recommend if you need URGENT attention to the issue I would Ask a related question.
0
 
LVL 5

Author Comment

by:R@f@r P@NC3R
Hello

Please share the screens until the step you arrived, ask a question to help you.

regards...
0

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Join & Write a Comment

Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month