How to create missing vmdk file for delta disk .... fixing vmware snapshot issue

A disk file of this type consists of a virtual disk descriptor file and paired delta extent file. These data files are based on the vmfsSparseformat, intended to store delta content or "change data" for a period of time, otherwise known as a snapshot.

To recreate a missing virtual disk (VMDK) descriptor file for delta disks:
1.    Confirm if the virtual machine directory contains either another delta disk descriptor file, or a base disk's descriptor, for use as a basis or template. For example, you will see some or all of these files in the virtual machine directory:

drwxr-xr-x 1 root root        1400 Aug 16 09:39 .
drwxr-xr-t 1 root root        2520 Aug 16 09:32 ..
-rw------- 1 root root       32768 Aug 17 19:11 examplevm-000002-delta.vmdk
-rw------- 1 root root       32768 Aug 17 19:11
 examplevm-000002.vmdk
-rw------- 1 root root       32768 Aug 16 14:39 examplevm-000001-delta.vmdk
-rw------- 1 root root       32768 Aug 16 14:39
 examplevm-000001.vmdk
-rw------- 1 root root 16106127360 Aug 16 09:32 examplevm-flat.vmdk
-rw------- 1 root root         469 Aug 16 09:32
 examplevm.vmdk
-rw------- 1 root root       18396 Aug 16 14:39 examplevm-Snapshot1.vmsn
-rw------- 1 root root       18396 Aug 17 19:11 examplevm-Snapshot2.vmsn
-rw------- 1 root root         397 Aug 16 09:39 examplevm.vmsn
-rwxr-xr-x 1 root root        1626 Aug 16 09:39 examplevm.vmx
-rw------- 1 root root         259 Aug 16 09:36 examplevm.vmxf


Notes:
o    Items highlighted in red are descriptor files which are ideally used as a template or base, if they are present.
o    If you are missing the base disk's descriptor file (or examplevm.vmdk), refer http://techfrozen.blogspot.in/2013/10/how-to-create-missing-vmx-file-and.html
If you have additional delta files with intact descriptor files, you may copy one of them for use as a template. Alternatively, copy the base disk descriptor file, or use the right-most example in the table below and customize the copied content.

Warning: Ensure that character encoding for any files modified outside of an ESXi/ESX host console or SSH session conform to UTF-8. Unsupported encoding results in failure to start the virtual machine.
o    For ESXi 5.0 and later, virtual machines have their delta files in the same directory as the disk they relate to. For example, a virtual machine with two disks each on different datastores:
§  The first disk (disk.vmdk) is located on datastore1
§  The second disk (disk_1.vmdk) is located on datastore2
After taking a snapshot, the delta file for the first disk (disk-000001.vmdk) will be stored on datastore1, and the delta file for the second disk (disk_1-000001.vmdk) will be stored on datastore2.
2.    Assume that the descriptor file for the delta disk examplevm-000001.vmdk is missing and that there are no issues with its associated delta file examplevm-000001-delta.vmdk.

To recreate the delta descriptor file, copy the current base disk descriptor file
 examplevm.vmdk with the name of the missing descriptor file examplevm-000001.vmdk:

# cp examplevm.vmdk examplevm-000001.vmdk

We can simply edit this new snapshot delta descriptor file to change its format from a base disk descriptor to a snapshot delta disk descriptor.
Modify the new examplevm-000001.vmdk delta descriptor file to contain this information:
Base disk descriptor file examplevm.vmdk
Recreated delta descriptor examplevm-000001.vmdk(originally copied from examplevm.vmdk)
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=19741890
parentCID=ffffffff
createType="vmfs"

# Extent description
RW 31457280 VMFS "examplevm-flat.vmdk"

# The Disk Data Base
#DDB

ddb.virtualHWVersion = "7"
ddb.longContentID = "5fd87dda1dc77cafd5be
881a19741890"
ddb.uuid = "60 00 C2 9e 3d 8d 45 82-dd 1f e4 93 22 da 9c 61"
ddb.geometry.cylinders = "1958"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=7f3a1e17
parentCID=19741890
createType="vmfsSparse"
parentFileNameHint="examplevm.vmdk"

# Extent description
RW
 31457280 VMFSSPARSE "examplevm-000001-delta.vmdk"

# The Disk Data Base
#DDB

ddb.longContentID = "5fd87dda1dc77cafd5be
881a19741890"
3.   
Notes:
o    If you are creating the snapshot descriptor file from the the base disk description make sure that you change the entry fromVMFS to VMFSSPARSE.
o    If the base disk is greater than 2 TB (2 TB+ only supported in ESXi 5.5) in size, these changes are required:
§  createType="vmfsSparse" replaced with createType="seSparse"
§  VMFSSPARSE under Extent Description replaced with SESPARSE
§  examplevm-000001-delta.vmdk replaced with examplevm-000001-sesparse.vmdk

o    CID and parentCID values are Content Identifiers (CID). For more information on the CID and how to correct CID mismatch errors, see Resolving the CID mismatch error: The parent virtual disk has been modified since the child was created (1007969).

The recreated file requires use of the
 CID value from its parent. In the example above, examplevm.vmdk was the parent. Thus, the CID from examplevm.vmdk (the parent) matches the parentCID value from examplevm-000001.vmdk(the child).

If there are other child delta disks present, such as
 examplevm-000002.vmdk (not shown in the example above), review the parentCID for the child and ensure it matches the CID parameter of your recreated descriptor file.
o    Delta disks are in the vmfsSparse format; specify this for the createType parameter.
§  Set the parentFileNameHint to the parent virtual disk file. This contains a virtual machine base disk or a deltadescriptor's file name.

Determining this may not be an immediately clear or simple process, depending on the information available.

Refer to the relevant
 vmware.log file(s) for the virtual machine when it last successfully started to determine the opening sequence of individual disk files:

vmx| DISK: OPEN scsi0:0 '/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000003.vmdk' persistent R[]
vmx| DISKLIB-VMFS : "
/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000003-delta.vmdk" : open successful (10) size = 32768, hd = 65613. Type 8
vmx| DISKLIB-DSCPTR: Opened [0]: "examplevm-000003-delta.vmdk" (0xa)
vmx| DISKLIB-LINK : Opened '
/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000003.vmdk' (0xa): vmfsSparse, 31457280 sectors / 15 GB.
vmx| DISKLIB-VMFS : "
/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000002-delta.vmdk" : open successful (14) size = 32768, hd = 65614. Type 8
vmx| DISKLIB-DSCPTR: Opened [0]: "examplevm-000002-delta.vmdk" (0xe)
vmx| DISKLIB-LINK : Opened '/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000002.vmdk' (0xe):
 vmfsSparse, 31457280 sectors / 15 GB.
vmx| DISKLIB-VMFS : "
/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000001-delta.vmdk" : open successful (14) size = 32768, hd = 65615. Type 8
vmx| DISKLIB-DSCPTR: Opened [0]: "examplevm-000001-delta.vmdk" (0xe)
vmx| DISKLIB-LINK : Opened '/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000001.vmdk' (0xe):
 vmfsSparse, 31457280 sectors / 15 GB.
vmx| DISKLIB-VMFS : "
/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-flat.vmdk" : open successful (14) size = 16106127360, hd = 65616. Type 3
vmx| DISKLIB-DSCPTR: Opened [0]: "examplevm.vmdk" (0xe)
vmx| DISKLIB-LINK : Opened '/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm.vmdk' (0xe):
 vmfs, 31457280 sectors / 15 GB.
vmx| DISKLIB-CHAINESX : ChainESXOpenSubChain: numLinks = 4, numSubChains = 1
vmx| DISKLIB-LIB : Opened "/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000003.vmdk" (flags 0xa).
vmx| DISK: OPEN '/vmfs/volumes/4b96afb0-b2474ede-fc0b-001aa004abc2/examplevm/examplevm-000003.vmdk' Geo (
1958/255/63) BIOS Geo (0/0/0)

The parts highlighted in
 blue are the fundamental configuration parameters used in the virtual machine's virtual disk descriptor files. The layout of a virtual disk tree can be determined using the same log file, based on the sequence and timeline of files opened. In this example:
§  One disk for the virtual machine, SCSI 0:0, was opened. The file specified was examplevm-000003.vmdk.
§  This disk had a parent, and referenced examplevm-000002.vmdk. This also had a parent and referencedexamplevm-000001.vmdk.
§  An intermediary disk file itself, it referenced examplevm.vmdk as its parent. This was the base disk for the virtual machine.
§  If there are no log files available, the creation or modification dates for the files in the directory may be considered when establishing delta disk ordering.
o    Reviewing the descriptor files for each of the remaining virtual machine delta disks will also shed light on the virtual machine's existing layout.

Warning: These files are not always ordered numerically. Incorrectly ordering the disk files can cause severe file system corruption in the guest operating system and/or trigger CID mismatch conditions when the virtual machine is powered on. If in doubt, stop and contact VMware Technical Support to file a support request
o    The Extent description specifies the corresponding data file containing the virtual machine disk's data:

RW 31457280 VMFS "examplevm-flat.vmdk
"

The RW number is the number of 512-Byte sectors (or "sector count") for the extent or disk file. A base disk's RW value is used throughout the chain of delta disks attached to it; no child virtual disk files should deviate from the defined number and will contain the same value.

o    The DDB section, unlike base disk descriptor files, does not contain geometry information. Only a long content ID is used (which pertains to ESX 4.x virtual machines and newer):

ddb.longContentID = "5fd87dda1dc77cafd5be881a19741890"

This value also matches the parent disks (and base) associated to the delta virtual disk. Do not include geometry information for the delta disk descriptor files.

Comments

Popular Posts