prl-xml.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. Parallels Disk Format
  2. =====================
  3. ..
  4. Copyright (c) 2015-2017, Virtuozzo, Inc.
  5. Authors:
  6. 2015 Denis Lunev <den@openvz.org>
  7. 2015 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  8. 2016-2017 Klim Kireev <klim.kireev@virtuozzo.com>
  9. 2016-2017 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
  10. This work is licensed under the terms of the GNU GPL, version 2 or later.
  11. See the COPYING file in the top-level directory.
  12. This specification contains minimal information about Parallels Disk Format,
  13. which is enough to properly work with QEMU. Nevertheless, Parallels Cloud Server
  14. and Parallels Desktop are able to add some unspecified nodes to the xml and use
  15. them, but they are for internal work and don't affect functionality. Also it
  16. uses auxiliary xml ``Snapshot.xml``, which allows storage of optional snapshot
  17. information, but this doesn't influence open/read/write functionality. QEMU and
  18. other software should not use fields not covered in this document or the
  19. ``Snapshot.xml`` file, and must leave them as is.
  20. A Parallels disk consists of two parts: the set of snapshots and the disk
  21. descriptor file, which stores information about all files and snapshots.
  22. Definitions
  23. -----------
  24. Snapshot
  25. a record of the contents captured at a particular time, capable
  26. of storing current state. A snapshot has a UUID and a parent UUID.
  27. Snapshot image
  28. an overlay representing the difference between this
  29. snapshot and some earlier snapshot.
  30. Overlay
  31. an image storing the different sectors between two captured states.
  32. Root image
  33. a snapshot image with no parent, the root of the snapshot tree.
  34. Storage
  35. the backing storage for a subset of the virtual disk. When
  36. there is more than one storage in a Parallels disk then that
  37. is referred to as a split image. In this case every storage
  38. covers a specific address space area of the disk and has its
  39. particular root image. Split images are not considered here
  40. and are not supported. Each storage consists of disk
  41. parameters and a list of images. The list of images always
  42. contains a root image and may also contain overlays. The
  43. root image can be an expandable Parallels image file or
  44. plain. Overlays must be expandable.
  45. Description file
  46. ``DiskDescriptor.xml`` stores information about disk parameters,
  47. snapshots, and storages.
  48. Top Snapshot
  49. The overlay between actual state and some previous snapshot.
  50. It is not a snapshot in the classical sense because it
  51. serves as the active image that the guest writes to.
  52. Sector
  53. a 512-byte data chunk.
  54. Description file
  55. ----------------
  56. All information is placed in a single XML element
  57. ``Parallels_disk_image``.
  58. The element has only one attribute, ``Version``, which must be ``1.0``.
  59. The schema of ``DiskDescriptor.xml``::
  60. <Parallels_disk_image Version="1.0">
  61. <Disk_Parameters>
  62. ...
  63. </Disk_Parameters>
  64. <StorageData>
  65. ...
  66. </StorageData>
  67. <Snapshots>
  68. ...
  69. </Snapshots>
  70. </Parallels_disk_image>
  71. ``Disk_Parameters`` element
  72. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  73. The ``Disk_Parameters`` element describes the physical layout of the
  74. virtual disk and some general settings.
  75. The ``Disk_Parameters`` element MUST contain the following child elements:
  76. * ``Disk_size`` - number of sectors in the disk,
  77. desired size of the disk.
  78. * ``Cylinders`` - number of the disk cylinders.
  79. * ``Heads`` - number of the disk heads.
  80. * ``Sectors`` - number of the disk sectors per cylinder
  81. (sector size is 512 bytes)
  82. Limitation: The product of the ``Heads``, ``Sectors`` and ``Cylinders``
  83. values MUST be equal to the value of the Disk_size parameter.
  84. * ``Padding`` - must be 0. Parallels Cloud Server and Parallels Desktop may
  85. use padding set to 1; however this case is not covered
  86. by this specification. QEMU and other software should not open
  87. such disks and should not create them.
  88. ``StorageData`` element
  89. ^^^^^^^^^^^^^^^^^^^^^^^
  90. This element of the file describes the root image and all snapshot images.
  91. The ``StorageData`` element consists of the ``Storage`` child element,
  92. as shown below::
  93. <StorageData>
  94. <Storage>
  95. ...
  96. </Storage>
  97. </StorageData>
  98. A ``Storage`` element has the following child elements:
  99. * ``Start`` - start sector of the storage, in case of non split storage
  100. equals to 0.
  101. * ``End`` - number of sector following the last sector, in case of non
  102. split storage equals to ``Disk_size``.
  103. * ``Blocksize`` - storage cluster size, number of sectors per one cluster.
  104. The cluster size for each "Compressed" (see below) image in
  105. a parallels disk must be equal to this field. Note: the cluster
  106. size for a Parallels Expandable Image is in the ``tracks`` field of
  107. its header (see :doc:`parallels`).
  108. * Several ``Image`` child elements.
  109. Each ``Image`` element has the following child elements:
  110. * ``GUID`` - image identifier, UUID in curly brackets.
  111. For instance, ``{12345678-9abc-def1-2345-6789abcdef12}.``
  112. The GUID is used by the Snapshots element to reference images
  113. (see below)
  114. * ``Type`` - image type of the element. It can be:
  115. * ``Plain`` for raw files.
  116. * ``Compressed`` for expanding disks.
  117. * ``File`` - path to image file. The path can be relative to
  118. ``DiskDescriptor.xml`` or absolute.
  119. ``Snapshots`` element
  120. ^^^^^^^^^^^^^^^^^^^^^
  121. The ``Snapshots`` element describes the snapshot relations with the snapshot tree.
  122. The element contains the set of ``Shot`` child elements, as shown below::
  123. <Snapshots>
  124. <TopGUID> ... </TopGUID> /* Optional child element */
  125. <Shot>
  126. ...
  127. </Shot>
  128. <Shot>
  129. ...
  130. </Shot>
  131. ...
  132. </Snapshots>
  133. Each ``Shot`` element contains the following child elements:
  134. * ``GUID`` - an image GUID.
  135. * ``ParentGUID`` - GUID of the image of the parent snapshot.
  136. The software may traverse snapshots from child to parent using the
  137. ``<ParentGUID>`` field as reference. The ``ParentGUID`` of the root
  138. snapshot is ``{00000000-0000-0000-0000-000000000000}``.
  139. There should be only one root snapshot.
  140. The Top snapshot could be
  141. described via two ways: via the ``TopGUID`` child
  142. element of the ``Snapshots`` element, or via the predefined GUID
  143. ``{5fbaabe3-6958-40ff-92a7-860e329aab41}``. If ``TopGUID`` is defined,
  144. the predefined GUID is interpreted as a normal GUID. All snapshot images
  145. (except the Top Snapshot) should be
  146. opened read-only.
  147. There is another predefined GUID,
  148. ``BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}``, which is used by
  149. original and some third-party software for backup. QEMU and other
  150. software may operate with images with ``GUID = BackupID`` as usual.
  151. However, it is not recommended to use this
  152. GUID for new disks. The Top snapshot cannot have this GUID.