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

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

book

Article ID: 306526

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides the instructions to recreate a virtual disk descriptor file for a virtual disk split up across several 2GB extents.

Environment

VMware ESXi 4.1.x Installable
VMware ESX 4.1.x
VMware ESX 4.0.x
VMware ESXi 4.0.x Embedded
VMware ESXi 4.0.x Installable
VMware ESX Server 3.5.x
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 5.0
VMware ESXi 3.5.x Embedded
VMware ESX Server 3.0.x
VMware ESXi 4.1.x Embedded

Resolution

A VMware ESX virtual machine disk that is split into several 2GB files consists of a single descriptor and multiple extent files, in sequence, based on the twoGbMaxExtentFlat or twoGbMaxExtentSparse disk format.

Note: For more information on virtual disk format, see VMware Virtual Disks: Virtual Disk Format v1.1.
To recreate the virtual disk descriptor file:
  1. Create a virtual disk descriptor file for use as a base or template. For more information, see Recreating a missing virtual disk (VMDK) header/descriptor file (1002511).

  2. Open the descriptor file using a text editor.

  3. Modify the CreateType entry as:

    createType="twoGbMaxExtentSparse"

    Note: The CreateType value depends on the type of extent used when the virtual disk was created. It can either be twoGbMaxExtentFlat or twoGbMaxExtentSparse.

  4. Locate the # Extent description section. Replace the contents in this section with a list of your extents:

    RW 4192256 SPARSE "vmdisk0-s001.vmdk"
    RW 4192256 SPARSE "vmdisk0-s002.vmdk"
    RW 2101248 SPARSE "vmdisk0-s003.vmdk"
  5. Modify the DDB entries as follows:

    ddb.virtualHWVersion = "4"
    ddb.geometry.cylinders = "652"
    ddb.geometry.heads = "255"
    ddb.geometry.sectors = "63"
    ddb.adapterType = "lsilogic"


  6. Locate and remove this line from the descriptor file, unless this was originally a thin-provisioned virtual disk before losing the descriptor file:

    ddb.thinProvisioned = "1"


Additional Information

Comparison of the base descriptor file and the tailored descriptor file

The following table provides a comparison of the base descriptor file and the tailored descriptor file:

Base Descriptor FileTailored Descriptor File
# 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"

# Disk DescriptorFile
version=1
CID=fb183c20
parentCID=ffffffff
createType="twoGbMaxExtentSparse"

# Extent description
RW 4192256 SPARSE "vmdisk0-s001.vmdk"
RW 4192256 SPARSE "vmdisk0-s002.vmdk"
RW 2101248 SPARSE "vmdisk0-s003.vmdk"

# The Disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "652"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
The extent description section in the tailored descriptor file has the following values:

RW 4192256 SPARSE "vmdisk0-s001.vmdk"
RW 4192256 SPARSE "vmdisk0-s002.vmdk"
RW 2101248 SPARSE "vmdisk0-s003.vmdk"
  • The RW value is the number of 512-Byte sectors for the extent or disk file. All but the final disk in the chain should be 4192256 512-Byte sectors, amounting to 2GB.
  • The sector count is determined by multiplying the number of cylinders, heads, and sectors. The number of cylinders, heads, and sectors are defined in the DDB section.
  • The total number of extents may deviate from the example above; append new lines containing information similar to the above, accounting for all the files in the chain.
  • In the above example, there are two 2GB files and a partial (or <2GB) disk file at the end of the chain. The total size of the disk did not reach or exceed 6GB.</li>

The DDB section in the tailored description file has the following values:

ddb.geometry.cylinders = "652"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
  • The ddb.geometry.heads value is always 255 for virtual machine disks (in entirety) equal to, or larger than, 2GB.
  • The ddb.geometry.sectors value is always 63 for virtual machine disks (in entirety) equal to, or larger than 2GB.
  • The ddb.geometry.cylinders value requires special consideration.

Cylinder Calculations

  • The number of cylinders is determined by multiplying the number of heads (255) and sectors (63), which equals 16065.
  • This number is multiplied by 512, which equals 8225280.
  • Divide the total size of the virtual disk in bytes by 8225280, per the value above.
  • Round this off to the nearest integer to get the ddb.geometry.cylinders value.

    For example:

    5,368,709,120 / (255 * 63 * 512)
    = 5,368,709,120 / 8225280
    = 652.70837223778400248988484282602
    = 652 cylinders
If the size of the disk is less than 1GB:
  • Set ddb.geometry.heads to 64.
  • Set ddb.geometry.sectors to 32.
  • Set ddb.geometry.cylinders to the integer portion of the value obtained when the size of the disk (in bytes) is divided by 1048576.

    Note: This number (1048576) is generated by multiplying head and sector values, and 512, for the block size.
If the size of the flat file is 1GB or more but less than 2GB:
  • Set ddb.geometry.heads to 128.
  • Set ddb.geometry.sectors to 32.
  • Set ddb.geometry.cylinders to the integer portion of the value obtained when the size of the disk (in bytes) is divided by by 2097152.
If the size of the flat file is 2GB or more:
  • Set ddb.geometry.heads to 255.
  • Set ddb.geometry.sectors to 63.
  • Set ddb.geometry.cylinders to the integer portion of the value obtained when the size of the disk (in bytes) is divided by 8225280.