| 1 | Here's step 1:
|
|---|
| 2 |
|
|---|
| 3 | stephen@jellyshot:~$ mkdir vboxhold
|
|---|
| 4 | stephen@jellyshot:~$ mv .VirtualBox/ VirtualBox\ VMs/ vboxhold/
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 | Then after completing GUI steps 2 through 12 to make the master VM, check the result:
|
|---|
| 8 |
|
|---|
| 9 | stephen@jellyshot:~$ vboxmanage list hdds
|
|---|
| 10 | UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 11 | Parent UUID: base
|
|---|
| 12 | Format: VDI
|
|---|
| 13 | Location: /home/stephen/VirtualBox VMs/master/master.vdi
|
|---|
| 14 | State: created
|
|---|
| 15 | Type: normal
|
|---|
| 16 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | So far so good. Now check again after doing steps 13 through 15 to snapshot the master VM:
|
|---|
| 20 |
|
|---|
| 21 | stephen@jellyshot:~$ vboxmanage list hdds
|
|---|
| 22 | UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 23 | Parent UUID: base
|
|---|
| 24 | Format: VDI
|
|---|
| 25 | Location: /home/stephen/VirtualBox VMs/master/master.vdi
|
|---|
| 26 | State: created
|
|---|
| 27 | Type: normal
|
|---|
| 28 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
|
|---|
| 29 |
|
|---|
| 30 | UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
|
|---|
| 31 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 32 | Format: VDI
|
|---|
| 33 | Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
|
|---|
| 34 | State: created
|
|---|
| 35 | Type: normal
|
|---|
| 36 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
|
|---|
| 37 |
|
|---|
| 38 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
|
|---|
| 39 | <MediaRegistry>
|
|---|
| 40 | <HardDisks>
|
|---|
| 41 | <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
|
|---|
| 42 | <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
|
|---|
| 43 | </HardDisk>
|
|---|
| 44 | </HardDisks>
|
|---|
| 45 | <DVDImages/>
|
|---|
| 46 | <FloppyImages/>
|
|---|
| 47 | </MediaRegistry>
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | That's all making sense. After steps 16 through 21, things are still looking OK:
|
|---|
| 51 |
|
|---|
| 52 | stephen@jellyshot:~$ vboxmanage list hdds
|
|---|
| 53 | UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 54 | Parent UUID: base
|
|---|
| 55 | Format: VDI
|
|---|
| 56 | Location: /home/stephen/VirtualBox VMs/master/master.vdi
|
|---|
| 57 | State: created
|
|---|
| 58 | Type: normal
|
|---|
| 59 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
|
|---|
| 60 |
|
|---|
| 61 | UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
|
|---|
| 62 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 63 | Format: VDI
|
|---|
| 64 | Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
|
|---|
| 65 | State: created
|
|---|
| 66 | Type: normal
|
|---|
| 67 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
|
|---|
| 68 |
|
|---|
| 69 | UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
|
|---|
| 70 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 71 | Format: VDI
|
|---|
| 72 | Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi
|
|---|
| 73 | State: created
|
|---|
| 74 | Type: normal
|
|---|
| 75 | Usage: slave (UUID: 5bc28a02-31de-47ac-91a7-d1b54448f3da)
|
|---|
| 76 |
|
|---|
| 77 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
|
|---|
| 78 | <MediaRegistry>
|
|---|
| 79 | <HardDisks>
|
|---|
| 80 | <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
|
|---|
| 81 | <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
|
|---|
| 82 | <HardDisk uuid="{8c4c95d3-fd3c-42dc-8424-3148315f1f07}" location="/home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi" format="VDI"/>
|
|---|
| 83 | </HardDisk>
|
|---|
| 84 | </HardDisks>
|
|---|
| 85 | <DVDImages/>
|
|---|
| 86 | <FloppyImages/>
|
|---|
| 87 | </MediaRegistry>
|
|---|
| 88 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/slave/slave.vbox
|
|---|
| 89 | <MediaRegistry>
|
|---|
| 90 | <HardDisks/>
|
|---|
| 91 | <DVDImages/>
|
|---|
| 92 | <FloppyImages/>
|
|---|
| 93 | </MediaRegistry>
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | Interesting. The slave VM's .vbox file contains an empty HardDisks media registry section, and the differencing disk created inside the slave's Snapshots folder to let the slave VM attach master.vdi is listed in the *master* VM's media registry.
|
|---|
| 97 |
|
|---|
| 98 | Anyway, press on with steps 22 through 24 to snapshot the slave, then check again:
|
|---|
| 99 |
|
|---|
| 100 | stephen@jellyshot:~$ vboxmanage list hdds
|
|---|
| 101 | UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 102 | Parent UUID: base
|
|---|
| 103 | Format: VDI
|
|---|
| 104 | Location: /home/stephen/VirtualBox VMs/master/master.vdi
|
|---|
| 105 | State: created
|
|---|
| 106 | Type: normal
|
|---|
| 107 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
|
|---|
| 108 |
|
|---|
| 109 | UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
|
|---|
| 110 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 111 | Format: VDI
|
|---|
| 112 | Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
|
|---|
| 113 | State: created
|
|---|
| 114 | Type: normal
|
|---|
| 115 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
|
|---|
| 116 |
|
|---|
| 117 | UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
|
|---|
| 118 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 119 | Format: VDI
|
|---|
| 120 | Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi
|
|---|
| 121 | State: created
|
|---|
| 122 | Type: normal
|
|---|
| 123 | Usage: slave (UUID: 5bc28a02-31de-47ac-91a7-d1b54448f3da) [Snapshot 1 (UUID: 19daf6b0-b7d7-43b6-9f98-8dde42c967cc)]
|
|---|
| 124 |
|
|---|
| 125 | UUID: 9ffed033-c605-4bdd-ae84-bc87af9af57b
|
|---|
| 126 | Parent UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
|
|---|
| 127 | Format: VDI
|
|---|
| 128 | Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{9ffed033-c605-4bdd-ae84-bc87af9af57b}.vdi
|
|---|
| 129 | State: created
|
|---|
| 130 | Type: normal
|
|---|
| 131 | Usage: slave (UUID: 5bc28a02-31de-47ac-91a7-d1b54448f3da)
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 | OK, the slave is now using a new differencing disk {9ffe...} which is a child of its old one {8c4c...} which is itself still in use by slave Snapshot 1. All good so far. Let's check the on-disk media registries:
|
|---|
| 135 |
|
|---|
| 136 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
|
|---|
| 137 | <MediaRegistry>
|
|---|
| 138 | <HardDisks>
|
|---|
| 139 | <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
|
|---|
| 140 | <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
|
|---|
| 141 | <HardDisk uuid="{8c4c95d3-fd3c-42dc-8424-3148315f1f07}" location="/home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi" format="VDI"/>
|
|---|
| 142 | </HardDisk>
|
|---|
| 143 | </HardDisks>
|
|---|
| 144 | <DVDImages/>
|
|---|
| 145 | <FloppyImages/>
|
|---|
| 146 | </MediaRegistry>
|
|---|
| 147 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/slave/slave.vbox
|
|---|
| 148 | <MediaRegistry>
|
|---|
| 149 | <HardDisks/>
|
|---|
| 150 | <DVDImages/>
|
|---|
| 151 | <FloppyImages/>
|
|---|
| 152 | </MediaRegistry>
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 | DANGER, WILL ROBINSON - they are exactly as before; neither one contains any information about {9ffe...}.
|
|---|
| 156 |
|
|---|
| 157 | So, let's shut down the GUI, wait long enough for the service to exit, and then see what we have:
|
|---|
| 158 |
|
|---|
| 159 | stephen@jellyshot:~$ vboxmanage list hdds
|
|---|
| 160 | UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 161 | Parent UUID: base
|
|---|
| 162 | Format: VDI
|
|---|
| 163 | Location: /home/stephen/VirtualBox VMs/master/master.vdi
|
|---|
| 164 | State: created
|
|---|
| 165 | Type: normal
|
|---|
| 166 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca) [Snapshot 1 (UUID: 4a6eecda-a9b3-419d-b6be-90010056e963)]
|
|---|
| 167 |
|
|---|
| 168 | UUID: 2f0c467b-4b02-408b-9df3-dc244d7d91bb
|
|---|
| 169 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 170 | Format: VDI
|
|---|
| 171 | Location: /home/stephen/VirtualBox VMs/master/Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi
|
|---|
| 172 | State: created
|
|---|
| 173 | Type: normal
|
|---|
| 174 | Usage: master (UUID: 6919fdbb-eb6c-46a5-9478-a086381b21ca)
|
|---|
| 175 |
|
|---|
| 176 | UUID: 8c4c95d3-fd3c-42dc-8424-3148315f1f07
|
|---|
| 177 | Parent UUID: 26300ad3-a563-4add-ae06-a5cbf2f6ed27
|
|---|
| 178 | Format: VDI
|
|---|
| 179 | Location: /home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi
|
|---|
| 180 | State: created
|
|---|
| 181 | Type: normal
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 | Here is my sad face :(
|
|---|
| 185 |
|
|---|
| 186 | All we have left is what got written out to the <MediaRegistry> tags in the .vbox files; {9ffe...} has just been forgotten entirely, and there is nothing there to say that any of the remaining disks are in use by the slave.
|
|---|
| 187 |
|
|---|
| 188 | Check the <MediaRegistry> tags in the .vbox files again, just to see if anything changed as the service was shutting down:
|
|---|
| 189 |
|
|---|
| 190 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/master/master.vbox
|
|---|
| 191 | <MediaRegistry>
|
|---|
| 192 | <HardDisks>
|
|---|
| 193 | <HardDisk uuid="{26300ad3-a563-4add-ae06-a5cbf2f6ed27}" location="master.vdi" format="VDI" type="Normal">
|
|---|
| 194 | <HardDisk uuid="{2f0c467b-4b02-408b-9df3-dc244d7d91bb}" location="Snapshots/{2f0c467b-4b02-408b-9df3-dc244d7d91bb}.vdi" format="VDI"/>
|
|---|
| 195 | <HardDisk uuid="{8c4c95d3-fd3c-42dc-8424-3148315f1f07}" location="/home/stephen/VirtualBox VMs/slave/Snapshots/{8c4c95d3-fd3c-42dc-8424-3148315f1f07}.vdi" format="VDI"/>
|
|---|
| 196 | </HardDisk>
|
|---|
| 197 | </HardDisks>
|
|---|
| 198 | <DVDImages/>
|
|---|
| 199 | <FloppyImages/>
|
|---|
| 200 | </MediaRegistry>
|
|---|
| 201 | stephen@jellyshot:~$ sed -n '/<Media/,\"</Media"p' VirtualBox\ VMs/slave/slave.vbox
|
|---|
| 202 | <MediaRegistry>
|
|---|
| 203 | <HardDisks/>
|
|---|
| 204 | <DVDImages/>
|
|---|
| 205 | <FloppyImages/>
|
|---|
| 206 | </MediaRegistry>
|
|---|
| 207 | stephen@jellyshot:~$
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 | No. They look the same as they did last time.
|
|---|
| 211 |
|
|---|
| 212 | This media registry organization strikes me as a rather half-hearted way to go about decentralizing the formerly central registry. It seem to me that if the decentralizing was done to allow a VM to be completely represented inside a single folder, then the slave VM should always have all the disks it's attached to listed in its *own* .vbox file.
|
|---|
| 213 |
|
|---|
| 214 | Given that the registry's XML format uses nesting to represent parent/child relationships, this would require at least one redundant entry for an ancestral .vdi file outside the slave's folder. Perhaps any such entry could be a stub with only a uuid attribute, to distinguish it from an erroneous duplication?
|
|---|
| 215 |
|
|---|
| 216 | This would also be enough information to allow a future "VBoxManage uprootvm" command to cut free a VM based on a disk image outside its own folder while keeping all its snapshots intact. For each stub entry found in the .vbox file, it would call "VBoxManage clonehd" internally to make a new, self-contained ancestral disk inside the folder, then replace the stub entry with a full one for the new disk.
|
|---|