Narrative
The virtual disk in ESX 3.x environments is made up of 2 files. A descriptor, or header file and an image file (normally ends in -flat.vmdk). A missing or corrupted descriptor file can cause various errors. This tool examines the descriptor file (if present) and verifies that the geometry values are valid for image file it describes. If the values are incorrect, it offers the user the ability to fix them. If the user chooses to fix the descriptor file, a backup of the original is made first. If the descriptor file is not present, the tool offers the user the ability to create one based on the image file.
I hope you find this tool useful. Please post any issues in the comments below and I'll try to address them as time allows.
Cheers,
-Eric
Description
This unsupported tool implements the 'Creating a header for an ESX 3 virtual machine' resolution documented in kb article 1004232. It can also repair the virtual geometry and length fields of an existing header (sometimes referred to as a descriptor) file.
Installation instructions:
1.) Copy the zip file to an ext3 filesystem on an ESX 3.5 service console.
2.) Unzip the file using the following command:
unzip vmdkdtool.zip
3.) Make use the tool is in the root user’s path.
To verify a descriptor file:
[root@x3 root]# vmdkdtool /vmfs/volumes/test/testvm/fixed-template.vmdk
vmdkdtool version 1.0.090402.
Copyright (c) 2009 NetApp, Inc.
All rights reserved.
/vmfs/volumes/test/testvm/fixed-template-flat.vmdk is 12884902400 bytes (12.0000004768372 GB)
size = 25165825 (current 25165825)
sectors = 63 (current value 63)
heads = 255 (current value 255)
cylinders = 1566 (current value 1566)
The descriptor file appears to be correct.
To fix a corrupt descriptor file:
[root@x3 root]# vmdkdtool /vmfs/volumes/test/testvm/fixed-template.vmdk
vmdkdtool version 1.0.090402.
Copyright (c) 2009 NetApp, Inc.
All rights reserved.
/vmfs/volumes/test/testvm/fixed-template-flat.vmdk is 12884902400 bytes (12.0000004768372 GB)
size = 25165825 (current 25125)
sectors = 63 (current value 21)
heads = 255 (current value 3)
cylinders = 1566 (current value 106)
NOTE: A backup of the file will be made if you choose yes.
Shall I fix the descriptor file? yes
Creating a backup of /vmfs/volumes/test/testvm/fixed-template.vmdk
Fixed.
To create a descriptor file:
[root@x3 root]# vmdkdtool /vmfs/volumes/test/testvm/fixed-template-flat.vmdk
vmdkdtool version 1.0.090402.
Copyright (c) 2009 NetApp, Inc.
All rights reserved.
/vmfs/volumes/test/testvm/fixed-template-flat.vmdk is 12884902400 bytes (12.0000004768372 GB)
size = 25165825 (current 0)
sectors = 63 (current value 0)
heads = 255 (current value 0)
cylinders = 1566 (current value 0)
Unable to find /vmfs/volumes/test/testvm/fixed-template.vmdk.
Shall I create the descriptor file based on /vmfs/volumes/test/testvm/fixed-template-flat.vmdk? yes
Created /vmfs/volumes/test/testvm/fixed-template.vmdk.