VMware虚拟磁盘VMDK格式说明书3.The Descriptor File

来源:互联网 发布:mac照片文件夹在哪 编辑:程序博客网 时间:2024/06/14 02:29
VMware虚拟磁盘VMDK格式说明书-The Descriptor File


3.The Descriptor File
For a more detailed view of how these elements of a virtual disk come together in practice, look at the following example text descriptor file, called test.vmdk. It describes a link in a virtual disk that is split into files no larger than 2GB each and that starts small and grows as data is added. The descriptor file is not case-sensitive.


Lines beginning with # are comments and are ignored by the VMware program that opens the disk.
--------------------------------------------
% cat test.vmdk
# Disk DescriptorFile
version=1
CID=fffffffe
parentCID=ffffffff
createType="twoGbMaxExtentSparse"
# Extent description
RW 4192256 SPARSE "test-s001.vmdk"
RW 4192256 SPARSE "test-s002.vmdk"
RW 2101248 SPARSE "test-s003.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "ide"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "16"
ddb.geometry.cylinders = "10402"
---------------------------------------------
3.1 The Header
    The first section of the descriptor is the header. It provides the following information about the virtual disk:
3.1.1. version
The number following version is the version number of the descriptor. The default value is 1.
3.1.2. CID
This line shows the content ID. It is a random 32-bit value updated the first time the content of the virtual disk is modified after the virtual disk is opened.
Every link header contains both a content ID and a parent content ID (described below).
If a link has a parent — as is true of links B and C in the diagram of links in a chain — the parent content ID is the content ID of the parent link.






    If a link has no parent — as is true of link A in the diagram of links in a chain — the parent content ID is set to CID_NOPARENT (defined below).



The purpose of the content ID is to check the following:
a. In the case of a base disk with a delta link, that the parent link has not changed since the time the delta link was created. If the parent link has changed, the delta link must be invalidated.
b. That the bottom-most link was not modified between the time the virtual machine was suspended and the time it was resumed or between the time you took a snapshot of the virtual machine and the time you reverted to the snapshot.
3.1.3 parentCID
    This line shows the content ID of the parent link — the previous link in the chain — if thereis one. If the link does not have any parent (in other words, if the link is a base disk), the parent’s content ID is set to the following value:
#define CID_NOPARENT (~0x0)

3.1.4 createType
This line describes the type of the virtual disk. It can be one of the following:
- ** monolithicSparse
- ** vmfsSparse
- ** monolithicFlat
- ** vmfs
- ** twoGbMaxExtentSparse
- ** twoGbMaxExtentFlat
- ** fullDevice
- ** vmfsRaw
- ** partitionedDevice
- ** vmfsRawDeviceMap
- ** vmfsPassthroughRawDeviceMap
- ** streamOptimized
The first six terms are used to describe various types of virtual disks. Terms that include monolithic indicate that the data storage for the virtual disk is contained in a single file. Terms that include twoGbMaxExtent indicate that the data storage for the virtual disk consists of a collection of smaller files. Terms that include sparse indicate that the virtual disks start small and grow to accommodate data. Some product documentation refers to these virtual disks as growable disks. Terms that include flat indicate that all space needed for the virtual disks is allocated at the time they are created. Some product documentation refers to these virtual disks as preallocated disks.
Terms that include vmfs indicate that the disk is an ESX Server disk.
The terms fullDevice, vmfsRaw, and partitionedDevice are used when the virtual machine is configured to make direct use of a physical disk — either a full disk or partitions on a disk — rather than store data in files managed by the host operating system.


The terms vmfsRawDeviceMap and vmfsPassthroughRawDeviceMap are used in headers for disks that use ESX Server raw device mapping.
The term streamOptimized is used to describe disks that have been optimized for streaming.
3.1.5 parentFileNameHint
This line, present only if the link is a delta link, contains the path to the parent of the delta link.


3.2 The Extents
Each line of the second section describes one extent. The extents are enumerated beginning with the one accessible at offset 0 from the virtual machine’s point of view. The format of the line looks like one of the following examples:


图 
The extent descriptions provide the following key information:
- ** Access — may be RW, RDONLY, or NOACCESS
- ** Size in sectors — a sector is 512 bytes
- ** Type of extent — may be FLAT, SPARSE, ZERO, VMFS, VMFSSPARSE, VMFSRDM, or VMFSRAW.
- ** Filename — shows the path to the extent (relative to the location of the descriptor)
Note: If the type of the virtual disk, shown in the header, is fullDevice or partitionedDevice, then the filename should point to an IDE or SCSI block device. If the type of the virtual disk is vmfsRaw, the filename should point to a file in /vmfs/devices/disks/.
- ** Offset — the offset value is specified only for flat extents and corresponds to the offset in the file or device where the guest operating system’s data is located. For preallocated virtual disks, this number is zero. For device-backed virtual disks (physical or raw disks), it may be non-zero.


3.3 The Disk Database
Additional information about the virtual disk is stored in the disk database section of the descriptor. Each line corresponds to one entry. Each entry is formatted as follows:
ddb.<nameOfEntry> = "<value of entry>"
When the virtual disk is created, the disk database is populated with entries like those shown in the example descriptor. The entry names are self-explanatory and show the following information:
- ** The adapter type can be ide, buslogic, lsilogic, or legacyESX. The buslogic and lsilogic values are for SCSI disks and show which virtual SCSI adapter is configured for the virtual machine. The legacyESX value is for older ESX Server virtual machines when the adapter type used in creating the virtual machine is not known.
- ** The geometry values — for cylinders, heads, and sectors — are initialized with the geometry of the disk, which depends on the adapter type.
There is one descriptor, and thus one disk database, for each link in a chain. Searches for disk database information begin in the descriptor for the bottom link of the chain — Link C in the illustration of links in the chain — and work their way up the chain until the information is found.


3.4 Layout of the Example Disk
The link described in the example descriptor has three extents, each of which is a file on disk.
The following diagram shows the layout of this link and the filenames of the extents:


阅读全文
0 0
原创粉丝点击