17d9fc7e7SPeter MaydellParallels Disk Format 27d9fc7e7SPeter Maydell===================== 37d9fc7e7SPeter Maydell 47d9fc7e7SPeter Maydell.. 57d9fc7e7SPeter Maydell Copyright (c) 2015-2017, Virtuozzo, Inc. 67d9fc7e7SPeter Maydell Authors: 77d9fc7e7SPeter Maydell 2015 Denis Lunev <den@openvz.org> 87d9fc7e7SPeter Maydell 2015 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> 97d9fc7e7SPeter Maydell 2016-2017 Klim Kireev <klim.kireev@virtuozzo.com> 107d9fc7e7SPeter Maydell 2016-2017 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com> 117d9fc7e7SPeter Maydell 127d9fc7e7SPeter Maydell This work is licensed under the terms of the GNU GPL, version 2 or later. 137d9fc7e7SPeter Maydell See the COPYING file in the top-level directory. 147d9fc7e7SPeter Maydell 157d9fc7e7SPeter MaydellThis specification contains minimal information about Parallels Disk Format, 16*09334420SPeter Maydellwhich is enough to properly work with QEMU. Nevertheless, Parallels Cloud Server 17*09334420SPeter Maydelland Parallels Desktop are able to add some unspecified nodes to the xml and use 187d9fc7e7SPeter Maydellthem, but they are for internal work and don't affect functionality. Also it 19*09334420SPeter Maydelluses auxiliary xml ``Snapshot.xml``, which allows storage of optional snapshot 20*09334420SPeter Maydellinformation, but this doesn't influence open/read/write functionality. QEMU and 21*09334420SPeter Maydellother software should not use fields not covered in this document or the 22*09334420SPeter Maydell``Snapshot.xml`` file, and must leave them as is. 237d9fc7e7SPeter Maydell 24*09334420SPeter MaydellA Parallels disk consists of two parts: the set of snapshots and the disk 257d9fc7e7SPeter Maydelldescriptor file, which stores information about all files and snapshots. 267d9fc7e7SPeter Maydell 277d9fc7e7SPeter MaydellDefinitions 287d9fc7e7SPeter Maydell----------- 297d9fc7e7SPeter Maydell 307d9fc7e7SPeter MaydellSnapshot 317d9fc7e7SPeter Maydell a record of the contents captured at a particular time, capable 32*09334420SPeter Maydell of storing current state. A snapshot has a UUID and a parent UUID. 337d9fc7e7SPeter Maydell 347d9fc7e7SPeter MaydellSnapshot image 357d9fc7e7SPeter Maydell an overlay representing the difference between this 367d9fc7e7SPeter Maydell snapshot and some earlier snapshot. 377d9fc7e7SPeter Maydell 387d9fc7e7SPeter MaydellOverlay 397d9fc7e7SPeter Maydell an image storing the different sectors between two captured states. 407d9fc7e7SPeter Maydell 417d9fc7e7SPeter MaydellRoot image 42*09334420SPeter Maydell a snapshot image with no parent, the root of the snapshot tree. 437d9fc7e7SPeter Maydell 447d9fc7e7SPeter MaydellStorage 457d9fc7e7SPeter Maydell the backing storage for a subset of the virtual disk. When 467d9fc7e7SPeter Maydell there is more than one storage in a Parallels disk then that 477d9fc7e7SPeter Maydell is referred to as a split image. In this case every storage 48*09334420SPeter Maydell covers a specific address space area of the disk and has its 497d9fc7e7SPeter Maydell particular root image. Split images are not considered here 507d9fc7e7SPeter Maydell and are not supported. Each storage consists of disk 517d9fc7e7SPeter Maydell parameters and a list of images. The list of images always 527d9fc7e7SPeter Maydell contains a root image and may also contain overlays. The 537d9fc7e7SPeter Maydell root image can be an expandable Parallels image file or 547d9fc7e7SPeter Maydell plain. Overlays must be expandable. 557d9fc7e7SPeter Maydell 567d9fc7e7SPeter MaydellDescription file 577d9fc7e7SPeter Maydell ``DiskDescriptor.xml`` stores information about disk parameters, 58*09334420SPeter Maydell snapshots, and storages. 597d9fc7e7SPeter Maydell 607d9fc7e7SPeter MaydellTop Snapshot 617d9fc7e7SPeter Maydell The overlay between actual state and some previous snapshot. 627d9fc7e7SPeter Maydell It is not a snapshot in the classical sense because it 637d9fc7e7SPeter Maydell serves as the active image that the guest writes to. 647d9fc7e7SPeter Maydell 657d9fc7e7SPeter MaydellSector 667d9fc7e7SPeter Maydell a 512-byte data chunk. 677d9fc7e7SPeter Maydell 687d9fc7e7SPeter MaydellDescription file 697d9fc7e7SPeter Maydell---------------- 707d9fc7e7SPeter Maydell 717d9fc7e7SPeter MaydellAll information is placed in a single XML element 727d9fc7e7SPeter Maydell``Parallels_disk_image``. 73*09334420SPeter MaydellThe element has only one attribute, ``Version``, which must be ``1.0``. 747d9fc7e7SPeter Maydell 75*09334420SPeter MaydellThe schema of ``DiskDescriptor.xml``:: 767d9fc7e7SPeter Maydell 777d9fc7e7SPeter Maydell <Parallels_disk_image Version="1.0"> 787d9fc7e7SPeter Maydell <Disk_Parameters> 797d9fc7e7SPeter Maydell ... 807d9fc7e7SPeter Maydell </Disk_Parameters> 817d9fc7e7SPeter Maydell <StorageData> 827d9fc7e7SPeter Maydell ... 837d9fc7e7SPeter Maydell </StorageData> 847d9fc7e7SPeter Maydell <Snapshots> 857d9fc7e7SPeter Maydell ... 867d9fc7e7SPeter Maydell </Snapshots> 877d9fc7e7SPeter Maydell </Parallels_disk_image> 887d9fc7e7SPeter Maydell 897d9fc7e7SPeter Maydell``Disk_Parameters`` element 907d9fc7e7SPeter Maydell^^^^^^^^^^^^^^^^^^^^^^^^^^^ 917d9fc7e7SPeter Maydell 927d9fc7e7SPeter MaydellThe ``Disk_Parameters`` element describes the physical layout of the 937d9fc7e7SPeter Maydellvirtual disk and some general settings. 947d9fc7e7SPeter Maydell 957d9fc7e7SPeter MaydellThe ``Disk_Parameters`` element MUST contain the following child elements: 967d9fc7e7SPeter Maydell 977d9fc7e7SPeter Maydell* ``Disk_size`` - number of sectors in the disk, 987d9fc7e7SPeter Maydell desired size of the disk. 997d9fc7e7SPeter Maydell* ``Cylinders`` - number of the disk cylinders. 1007d9fc7e7SPeter Maydell* ``Heads`` - number of the disk heads. 1017d9fc7e7SPeter Maydell* ``Sectors`` - number of the disk sectors per cylinder 1027d9fc7e7SPeter Maydell (sector size is 512 bytes) 103*09334420SPeter Maydell Limitation: The product of the ``Heads``, ``Sectors`` and ``Cylinders`` 1047d9fc7e7SPeter Maydell values MUST be equal to the value of the Disk_size parameter. 1057d9fc7e7SPeter Maydell* ``Padding`` - must be 0. Parallels Cloud Server and Parallels Desktop may 106*09334420SPeter Maydell use padding set to 1; however this case is not covered 107*09334420SPeter Maydell by this specification. QEMU and other software should not open 1087d9fc7e7SPeter Maydell such disks and should not create them. 1097d9fc7e7SPeter Maydell 1107d9fc7e7SPeter Maydell``StorageData`` element 1117d9fc7e7SPeter Maydell^^^^^^^^^^^^^^^^^^^^^^^ 1127d9fc7e7SPeter Maydell 1137d9fc7e7SPeter MaydellThis element of the file describes the root image and all snapshot images. 1147d9fc7e7SPeter Maydell 1157d9fc7e7SPeter MaydellThe ``StorageData`` element consists of the ``Storage`` child element, 1167d9fc7e7SPeter Maydellas shown below:: 1177d9fc7e7SPeter Maydell 1187d9fc7e7SPeter Maydell <StorageData> 1197d9fc7e7SPeter Maydell <Storage> 1207d9fc7e7SPeter Maydell ... 1217d9fc7e7SPeter Maydell </Storage> 1227d9fc7e7SPeter Maydell </StorageData> 1237d9fc7e7SPeter Maydell 124*09334420SPeter MaydellA ``Storage`` element has the following child elements: 1257d9fc7e7SPeter Maydell 1267d9fc7e7SPeter Maydell* ``Start`` - start sector of the storage, in case of non split storage 1277d9fc7e7SPeter Maydell equals to 0. 1287d9fc7e7SPeter Maydell* ``End`` - number of sector following the last sector, in case of non 1297d9fc7e7SPeter Maydell split storage equals to ``Disk_size``. 1307d9fc7e7SPeter Maydell* ``Blocksize`` - storage cluster size, number of sectors per one cluster. 131*09334420SPeter Maydell The cluster size for each "Compressed" (see below) image in 132*09334420SPeter Maydell a parallels disk must be equal to this field. Note: the cluster 133*09334420SPeter Maydell size for a Parallels Expandable Image is in the ``tracks`` field of 1347d9fc7e7SPeter Maydell its header (see :doc:`parallels`). 1357d9fc7e7SPeter Maydell* Several ``Image`` child elements. 1367d9fc7e7SPeter Maydell 137*09334420SPeter MaydellEach ``Image`` element has the following child elements: 1387d9fc7e7SPeter Maydell 1397d9fc7e7SPeter Maydell* ``GUID`` - image identifier, UUID in curly brackets. 1407d9fc7e7SPeter Maydell For instance, ``{12345678-9abc-def1-2345-6789abcdef12}.`` 1417d9fc7e7SPeter Maydell The GUID is used by the Snapshots element to reference images 1427d9fc7e7SPeter Maydell (see below) 1437d9fc7e7SPeter Maydell* ``Type`` - image type of the element. It can be: 1447d9fc7e7SPeter Maydell 1457d9fc7e7SPeter Maydell * ``Plain`` for raw files. 1467d9fc7e7SPeter Maydell * ``Compressed`` for expanding disks. 1477d9fc7e7SPeter Maydell 148*09334420SPeter Maydell* ``File`` - path to image file. The path can be relative to 1497d9fc7e7SPeter Maydell ``DiskDescriptor.xml`` or absolute. 1507d9fc7e7SPeter Maydell 1517d9fc7e7SPeter Maydell``Snapshots`` element 1527d9fc7e7SPeter Maydell^^^^^^^^^^^^^^^^^^^^^ 1537d9fc7e7SPeter Maydell 1547d9fc7e7SPeter MaydellThe ``Snapshots`` element describes the snapshot relations with the snapshot tree. 1557d9fc7e7SPeter Maydell 1567d9fc7e7SPeter MaydellThe element contains the set of ``Shot`` child elements, as shown below:: 1577d9fc7e7SPeter Maydell 1587d9fc7e7SPeter Maydell <Snapshots> 1597d9fc7e7SPeter Maydell <TopGUID> ... </TopGUID> /* Optional child element */ 1607d9fc7e7SPeter Maydell <Shot> 1617d9fc7e7SPeter Maydell ... 1627d9fc7e7SPeter Maydell </Shot> 1637d9fc7e7SPeter Maydell <Shot> 1647d9fc7e7SPeter Maydell ... 1657d9fc7e7SPeter Maydell </Shot> 1667d9fc7e7SPeter Maydell ... 1677d9fc7e7SPeter Maydell </Snapshots> 1687d9fc7e7SPeter Maydell 1697d9fc7e7SPeter MaydellEach ``Shot`` element contains the following child elements: 1707d9fc7e7SPeter Maydell 1717d9fc7e7SPeter Maydell* ``GUID`` - an image GUID. 1727d9fc7e7SPeter Maydell* ``ParentGUID`` - GUID of the image of the parent snapshot. 1737d9fc7e7SPeter Maydell 174*09334420SPeter MaydellThe software may traverse snapshots from child to parent using the 175*09334420SPeter Maydell``<ParentGUID>`` field as reference. The ``ParentGUID`` of the root 176*09334420SPeter Maydellsnapshot is ``{00000000-0000-0000-0000-000000000000}``. 177*09334420SPeter MaydellThere should be only one root snapshot. 178*09334420SPeter Maydell 179*09334420SPeter MaydellThe Top snapshot could be 180*09334420SPeter Maydelldescribed via two ways: via the ``TopGUID`` child 181*09334420SPeter Maydellelement of the ``Snapshots`` element, or via the predefined GUID 1827d9fc7e7SPeter Maydell``{5fbaabe3-6958-40ff-92a7-860e329aab41}``. If ``TopGUID`` is defined, 183*09334420SPeter Maydellthe predefined GUID is interpreted as a normal GUID. All snapshot images 184*09334420SPeter Maydell(except the Top Snapshot) should be 185*09334420SPeter Maydellopened read-only. 186*09334420SPeter Maydell 187*09334420SPeter MaydellThere is another predefined GUID, 1887d9fc7e7SPeter Maydell``BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}``, which is used by 189*09334420SPeter Maydelloriginal and some third-party software for backup. QEMU and other 190*09334420SPeter Maydellsoftware may operate with images with ``GUID = BackupID`` as usual. 191*09334420SPeter MaydellHowever, it is not recommended to use this 192*09334420SPeter MaydellGUID for new disks. The Top snapshot cannot have this GUID. 193