Tuesday, June 24, 2008

Recreating Missing VMDK Descriptor Files!

A few times over the years VMDK files have been ‘lost’ when a customer has had to shutown their storage in a less than graceful fashion.

In every case so far, touch wood, it is only the desciptor files that have been deleted so the raw data is still present in the *-flat.vmdk file.

It is actually quite simple to rescue the situation you simply restore from backup. Ahaha what if you do not have a backup, then there is another way.

Firstly, identify the size of the *-flatvmdk file using putty or something similar. Once you know how big it is, 250GB for instance, either find another flat-vmdk file the same size or create a new one that size.

Once you have created or identified the 250GB *-flat.vmdk you’ll notice it has an accompanying *.vmdk file, run a cat against it, and you’ll notice something like this:

cat rescue_me.vmdk

# Disk DescriptorFile
version=1
CID=7131fc31
parentCID=ffffffff
createType=”vmfs”

# Extent description
RW 419430400 VMFS “rescue_me-flat.vmdk”

# The Disk Data Base
#DDB

ddb.virtualHWVersion = “4″
ddb.geometry.cylinders = “26108″
ddb.geometry.heads = “255″
ddb.geometry.sectors = “63″
ddb.adapterType = “lsilogic”
ddb.toolsVersion = “7201″

Now make a copy of this file to the folder that has the original *-flat.vmdk file:

cp rescue_me.vmdk /vmfs/volumes/mysan/rescued/rescued.vmdk

Using your favourite editor change the following line as below from:

RW 419430400 VMFS “rescue_me-flat.vmdk”

To:

RW 419430400 VMFS “rescued-flat.vmdk”

Obviously making sure that the name of the .vmdk file corresponds to the scis*:*.fileName field in the Virtual Machine vmx file.

You should now be able to power on the VM with all the original disks intact.

Clear as mud, I hope.

Bron: www.vm-aware.com

Post a Comment