VMware虚拟磁盘VMDK格式说明书1.1---3 The Descriptor File描述文件

来源:互联网 发布:ubuntu拷贝文件 编辑:程序博客网 时间:2024/06/10 19:09
VMware虚拟磁盘VMDK格式说明书1.1----3The 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.
有关虚拟磁盘的这些元素在实践中如何组合的更详细的视图,请查看以下示例文本描述符文件,称为test.vmdk。它描述了一个虚拟磁盘中的链接,该链接被分成不大于2GB的文件,并且随着数据被添加而增长。描述符文件不区分大小写。


Lines beginning with # are comments and are ignored by the VMware program that opens the disk.
以#开头的行是注释,被打开磁盘的VMware程序忽略。
--------------------------------------------
% 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.
version的值数字是描述符的版本号。默认值为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.
此行显示内容ID。在虚拟磁盘打开后,第一次修改虚拟磁盘的内容时,会随机更新32位值。
Every link header contains both a content ID and a parent content ID (described below).
每个链接头都包含内容ID和父内容ID(如下所述)。
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.
如果一个链接有一个父 - 如链中的链接图中的链接B和C所示,父内容ID是父链接的内容ID。




    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).
如果一个链接没有父 - 如链中链接图中的链接A所示 - 父内容ID设置为CID_NOPARENT(下面定义)。


The purpose of the content ID is to check the following:
内容ID的目的是检查以下内容:
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:
此行显示父链接的内容ID  - 链中的以前链接(如果有)。如果链接没有任何父项(换句话说,如果链接是基础磁盘),则父项的内容ID将被设置为以下值:
#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.
前六个术语用于描述各种类型的虚拟磁盘。包括单片的术语表示虚拟磁盘的数据存储包含在单个文件中。包含twoGbMaxExtent的术语表示虚拟磁盘的数据存储包含较小文件的集合。包括稀疏性的术语表示虚拟磁盘启动时间较短,并可增长以适应数据。一些产品文档将这些虚拟磁盘称为可扩展磁盘。包括平面的术语表示虚拟磁盘所需的空间在创建时分配。一些产品文档将这些虚拟磁盘引用为预先分配的磁盘。
Terms that include vmfs indicate that the disk is an ESX Server disk.
包括vmfs的术语表示磁盘是ESX Server磁盘。
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.
当虚拟机配置为直接使用物理磁盘(磁盘上的完整磁盘或分区)而不是将数据存储在主机操作系统管理的文件中时,将使用fullDevice,vmfsRaw和partitionDevice等术语。


The terms vmfsRawDeviceMap and vmfsPassthroughRawDeviceMap are used in headers for disks that use ESX Server raw device mapping.
术语vmfsRawDeviceMap和vmfsPassthroughRawDeviceMap用于使用ESX Server原始设备映射的磁盘的标题。
The term streamOptimized is used to describe disks that have been optimized for streaming.
术语streamOptimized用于描述已针对流优化的磁盘。
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:
第二部分的每一行描述一个extent。extents从枚举开始,从虚拟机的角度可以在偏移量0处访问。该行的格式看起来像以下示例之一:


图 
The extent descriptions provide the following key information:
范围说明提供以下关键信息:
- ** Access — may be RW, RDONLY, or NOACCESS 访问-可以是RW,RDONLY或NOACCESS
- ** Size in sectors — a sector is 512 bytes 扇区大小 - 扇区为512字节
- ** Type of extent — may be FLAT, SPARSE, ZERO, VMFS, VMFSSPARSE, VMFSRDM, or VMFSRAW.
扩展类型 - 可以是FLAT,SPARSE,ZERO,VMFS,VMFSSPARSE,VMFSRDM或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/.
注意:如果标题中显示的虚拟磁盘的类型为fullDevice或partitionsDevice,则文件名应指向IDE或SCSI块设备。如果虚拟磁盘的类型为vmfsRaw,文件名应指向/ 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.
适配器类型可以是ide,buslogic,lsilogic或legacyESX。buslogic和lsilogic值用于SCSI磁盘,并显示为虚拟机配置的虚拟SCSI适配器。当用于创建虚拟机的适配器类型未知时,legacyESX值适用于较旧的ESX Server虚拟机。
- ** 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.链中的每个链接都有一个描述符,因此有一个磁盘数据库。  搜索磁盘数据库信息的链接的链 ,从链接C的链 图示开始,并按照此方式继续链接到链条,直到找到信息。


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