VMware Cloud Community
dingding
Enthusiast
Enthusiast
Jump to solution

how to re-construct disk descriptor file?

as you know, every vmdk consists of 2 files, one is xxxx.vmdk, the other is xxxxx-flat.vmdk.

the former is disk descriptor file, the later is the disk include the real data.

if for some reason, user delete the descriptor file, how to restore it from the xxxxx-flat.vmdk?

---- Idleness is not doing nothing. Idleness is being free to do anything.
0 Kudos
1 Solution

Accepted Solutions
ctfoster
Expert
Expert
Jump to solution

Oh right I see what you mean. The following steps will guide you to recreate your vmdk's:

  1. Determine the hard disk sizes of your original VM - this information should be in the logs files mentioned by previous poster.

  2. Create a new VM with the same number of hard disks as your old VM, and the exact same sizes using the log info.

  3. Once created, use Putty or some tool to navigate to the directory of new VM.

  4. Copy the newly created vmdk files to your existing directory

  5. Edit the new VMDK's with the existing flat.vmdk file names.

  6. Load the VM in your VirtualCenter. You should now be able to add the flat.vmdk to your VM

View solution in original post

0 Kudos
11 Replies
ctfoster
Expert
Expert
Jump to solution

Just use the VI client to reattach the file back to the VM.

0 Kudos
oreeh
Immortal
Immortal
Jump to solution

You can restore it from the log and you can restore it by "calculating" its contents.

dingding
Enthusiast
Enthusiast
Jump to solution

your method does not work, if there's only flat file without the descriptor file, when vi client browse the directory, it will display no vmdk files.

---- Idleness is not doing nothing. Idleness is being free to do anything.
0 Kudos
dingding
Enthusiast
Enthusiast
Jump to solution

agree with you, can you provide the detail approch how to do this.

i read the ppt from TSX 2007, "top support issues and how to solve them, part 2", it says use "grep -i rw xxxx.vmdk" to get the size, but when i use it, nothing useful displayed.

---- Idleness is not doing nothing. Idleness is being free to do anything.
0 Kudos
ctfoster
Expert
Expert
Jump to solution

Oh right I see what you mean. The following steps will guide you to recreate your vmdk's:

  1. Determine the hard disk sizes of your original VM - this information should be in the logs files mentioned by previous poster.

  2. Create a new VM with the same number of hard disks as your old VM, and the exact same sizes using the log info.

  3. Once created, use Putty or some tool to navigate to the directory of new VM.

  4. Copy the newly created vmdk files to your existing directory

  5. Edit the new VMDK's with the existing flat.vmdk file names.

  6. Load the VM in your VirtualCenter. You should now be able to add the flat.vmdk to your VM

0 Kudos
ctfoster
Expert
Expert
Jump to solution

Thanks for the post. Apologies for not reading your original post more closely.

0 Kudos
dingding
Enthusiast
Enthusiast
Jump to solution

thank you and your method is very easy to understand and implement. i successfully do a test, let me add some notes to your steps.

1. Determine the hard disk sizes of your original VM - this information should be in the logs files mentioned by previous poster.

just use ls -l to determine the disk size, in my example, i have 2 disks, one is 6457893888 bytes, the other is 5368709120

2. Create a new VM with the same number of hard disks as your old VM, and the exact same sizes using the log info.

when you create a new VM, the key is disk size and guest os type. the guest os type you can get it from vmware.log, or you can ask the user who use it.

for disk capacity, just use the size get from step 1, and divide it with 102410241024, for 6457893888, the result is:6158.7275390625

for 5368709120, the result is just 5. notice the unit is MB, so type the exact value in the input box.

3. Once created, use Putty or some tool to navigate to the directory of new VM.

4. Copy the newly created vmdk files to your existing directory

this should be: copy the vmdk flat files in your existing directory to the newly created VM dir

5. Edit the new VMDK's with the existing flat.vmdk file names.

6. Load the VM in your VirtualCenter. You should now be able to add the flat.vmdk to your VM

just power on the VM in virtualcenter

---- Idleness is not doing nothing. Idleness is being free to do anything.
0 Kudos
oreeh
Immortal
Immortal
Jump to solution

This requires a log file where the disk actually is mentioned:

Depending on how long the VM is running this isn't always the case.

Example

Mar 29 21:02:52.646: vmx| DISK: OPEN scsi0:0 '/vmfs/volumes/461256a8-e79b7df6-6dc8-0019bbca677c/test/test.vmdk' persistent R[(null)]
Mar 29 21:02:52.652: vmx| DISKLIB-VMFS : "/vmfs/volumes/461256a8-e79b7df6-6dc8-0019bbca677c/test/test-flat.vmdk" : open successful (10) size = 8589934592, hd = 8219. Type 3
Mar 29 21:02:52.652: vmx| DISKLIB-DSCPTR: Opened [0]: "test-flat.vmdk" (0xa)
Mar 29 21:02:52.653: vmx| DISKLIB-LINK  : Opened '/vmfs/volumes/461256a8-e79b7df6-6dc8-0019bbca677c/test/test.vmdk' (0xa): vmfs, 16777216 sectors / 8192 Mb.
Mar 29 21:02:52.653: vmx| DISKLIB-LIB   : Opened "/vmfs/volumes/461256a8-e79b7df6-6dc8-0019bbca677c/test/test.vmdk" (flags 0xa). 0x85857d0
Mar 29 21:02:52.710: vmx| DISK: OPEN '/vmfs/volumes/461256a8-e79b7df6-6dc8-0019bbca677c/test/test.vmdk' Geo (1044/255/63) BIOS Geo (0/0/0) freeSpace=180934Mb, DDB.adapterType=lsilogic

Another way would be to create a disk of equal size (provided you know the actually size) and modify the newly created descriptor.

dingding
Enthusiast
Enthusiast
Jump to solution

VM log files contains both the disk information also the configuration info in vmx file. i never thought this file is so important before.

---- Idleness is not doing nothing. Idleness is being free to do anything.
0 Kudos
continuum
Immortal
Immortal
Jump to solution

some more to read

http://sanbarrow.com/vmdk/extracting-vmdk-from-log.html

http://sanbarrow.com/vmdk/extracting-vmx-from-log.html

description of vmx-parameters:

VMware-liveCD:


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
JeremyHowes
Contributor
Contributor
Jump to solution

Thank you ctfoster... this worked for me.  Jeremy

0 Kudos