VirtualBox

source: vbox/trunk/doc/manual/en_US/dita/topics/diffimages.dita@ 104409

Last change on this file since 104409 was 99797, checked in by vboxsync, 22 months ago

Docs: bugref:10302. Merging changes from the docs team. Almost exclusively conkeyref related stuff.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
Line 
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
3<topic xml:lang="en-us" id="diffimages">
4 <title>Differencing Images</title>
5
6 <body>
7 <p>
8 The previous section mentioned differencing images and how they
9 are used with snapshots, immutable images, and multiple disk
10 attachments. This section describes in more detail how
11 differencing images work.
12 </p>
13 <p>
14 A differencing image is a special disk image that only holds the
15 differences to another image. A differencing image by itself is
16 useless, it must always refer to another image. The differencing
17 image is then typically referred to as a
18 <i>child</i>, which holds the differences to its
19 <i>parent</i>.
20 </p>
21 <p>
22 When a differencing image is active, it receives all write
23 operations from the virtual machine instead of its parent. The
24 differencing image only contains the sectors of the virtual hard
25 disk that have changed since the differencing image was created.
26 When the machine reads a sector from such a virtual hard disk, it
27 looks into the differencing image first. If the sector is present,
28 it is returned from there. If not, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> looks into the
29 parent. In other words, the parent becomes
30 <i>read-only</i>. It is never written to again, but
31 it is read from if a sector has not changed.
32 </p>
33 <p>
34 Differencing images can be chained. If another differencing image
35 is created for a virtual disk that already has a differencing
36 image, then it becomes a <i>grandchild</i> of the
37 original parent. The first differencing image then becomes
38 read-only as well, and write operations only go to the
39 second-level differencing image. When reading from the virtual
40 disk, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> needs to look into the second differencing
41 image first, then into the first if the sector was not found, and
42 then into the original image.
43 </p>
44 <p>
45 There can be an unlimited number of differencing images, and each
46 image can have more than one child. As a result, the differencing
47 images can form a complex tree with parents, siblings, and
48 children, depending on how complex your machine configuration is.
49 Write operations always go to the one <i>active</i>
50 differencing image that is attached to the machine, and for read
51 operations, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> may need to look up all the parents in
52 the chain until the sector in question is found. You can view such
53 a tree in the Virtual Media Manager.
54 </p>
55 <fig id="fig-diff-images">
56 <title>Differencing Images, Shown in Virtual Media Manager</title>
57 <xref href="images/virtual-disk-manager-2.png" format="png" platform="htmlhelp">
58 <image href="images/virtual-disk-manager-2.png" width="12cm" placement="break">
59 <alt>Differencing Images, Shown in Virtual Media Manager</alt>
60 </image>
61 </xref>
62 <image platform="ohc" href="images/virtual-disk-manager-2.png" width="12cm" placement="break">
63 <alt>Differencing Images, Shown in Virtual Media Manager</alt>
64 </image>
65 </fig>
66 <p>
67 In all of these situations, from the point of view of the virtual
68 machine, the virtual hard disk behaves like any other disk. While
69 the virtual machine is running, there is a slight run-time I/O
70 overhead because <ph conkeyref="vbox-conkeyref-phrases/product-name"/> might need to look up sectors
71 several times. This is not noticeable however since the tables
72 with sector information are always kept in memory and can be
73 looked up quickly.
74 </p>
75 <p>
76 Differencing images are used in the following situations:
77 </p>
78 <ul>
79 <li>
80 <p><b outputclass="bold">Snapshots.</b> When you create a
81 snapshot, as explained in the previous section, <ph conkeyref="vbox-conkeyref-phrases/product-name"/>
82 <i>freezes</i> the images attached to the
83 virtual machine and creates differencing images for each image
84 that is not in <i>write-through</i> mode. From
85 the point of view of the virtual machine, the virtual disks
86 continue to operate before, but all write operations go into
87 the differencing images. Each time you create another
88 snapshot, for each hard disk attachment, another differencing
89 image is created and attached, forming a chain or tree.
90 </p>
91 <p>
92 In the above screenshot, you see that the original disk image
93 is now attached to a snapshot, representing the state of the
94 disk when the snapshot was taken.
95 </p>
96 <p>
97 If you <i>restore</i> a snapshot, and want to go
98 back to the exact machine state that was stored in the
99 snapshot, the following happens:
100 </p>
101 <ul>
102 <li>
103 <p>
104 <ph conkeyref="vbox-conkeyref-phrases/product-name"/> copies the virtual machine settings that
105 were copied into the snapshot back to the virtual machine.
106 As a result, if you have made changes to the machine
107 configuration since taking the snapshot, they are undone.
108 </p>
109 </li>
110 <li>
111 <p>
112 If the snapshot was taken while the machine was running,
113 it contains a saved machine state, and that state is
114 restored as well. After restoring the snapshot, the
115 machine will then be in Saved state and resume execution
116 from there when it is next started. Otherwise the machine
117 will be in Powered Off state and do a full boot.
118 </p>
119 </li>
120 <li>
121 <p>
122 For each disk image attached to the machine, the
123 differencing image holding all the write operations since
124 the current snapshot was taken is thrown away, and the
125 original parent image is made active again. If you
126 restored the root snapshot, then this will be the root
127 disk image for each attachment. Otherwise, some other
128 differencing image descended from it. This effectively
129 restores the old machine state.
130 </p>
131 </li>
132 </ul>
133 <p>
134 If you later <i>delete</i> a snapshot in order
135 to free disk space, for each disk attachment, one of the
136 differencing images becomes obsolete. In this case, the
137 differencing image of the disk attachment cannot simply be
138 deleted. Instead, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> needs to look at each sector
139 of the differencing image and needs to copy it back into its
140 parent. This is called "merging" images and can be a
141 potentially lengthy process, depending on how large the
142 differencing image is. It can also temporarily need a
143 considerable amount of extra disk space, before the
144 differencing image obsoleted by the merge operation is
145 deleted.
146 </p>
147 </li>
148 <li>
149 <p><b outputclass="bold">Immutable images.</b> When an
150 image is switched to immutable mode, a differencing image is
151 created as well. As with snapshots, the parent image then
152 becomes read-only, and the differencing image receives all the
153 write operations. Every time the virtual machine is started,
154 all the immutable images which are attached to it have their
155 respective differencing image thrown away, effectively
156 resetting the virtual machine's virtual disk with every
157 restart.
158 </p>
159 </li>
160 </ul>
161 </body>
162
163</topic>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette