Using older copies of VDI file
Posted: 20. Apr 2013, 04:09
So I've gotten an interesting problem dumped into my lap.
A well-meaning but inexperienced colleague has a very simple VB setup. One host, one guest, one VDI. His backup scheme has been to make a copy of the VDI file periodically, whenever the guest is in powered-off state. Unfortunately, he did the copying using standard host copy methods, not any kind of VDI-aware cloning.
Now there's something on his current guest that's been lost or misconfigured or some such; details weren't given but they don't really matter. Rather than replace the entire guest disk image, he wants to (A) attach an older image to the guest, and then (B) inside the guest, mount that disk at some temporary mount point and go copy individual bits off of it. More specifically, he wants to do these steps repeatedly to get varying files out of VDIs of varying ages.
(B) wouldn't be a problem, we've all done that before. But of course he can't get (A) done because trying to attach any of the older copies gives the error "Cannot register the hard disk 'older_copy.vdi' {foo-bar-baz} because a hard disk 'current.vdi' with UUID {foo-bar-baz} already exists." No surprises there. This is when he came to me. (Filenames replaced for easy reading.)
My thought was to clone the copied files, and then attach the clones. But "VBoxManage clonehd older_copy.vdi clone_of_older_copy.vdi" fails with the same error message. Apparently even command-line cloning involves a registration step, which I wasn't expecting. And we can't use the Virtual Media Manager UI because that doesn't even list the copied files, only the currently attached ones.
What are his options here? All I can come up with is:
1) Remove the guest VM entirely from the VB Manager, carefully NOT deleting any files.
2) Using "VBoxManage clonehd", clone each of the older VDI files that he wants to examine.
3) Re-add the guest VM into the VB Manager.
4) Attach/delete each of the clone images as needed.
Is there a better approach?
(At the very least, I've convinced him to stop making VDI backups using file copy operations. He's learning a lot!)
A well-meaning but inexperienced colleague has a very simple VB setup. One host, one guest, one VDI. His backup scheme has been to make a copy of the VDI file periodically, whenever the guest is in powered-off state. Unfortunately, he did the copying using standard host copy methods, not any kind of VDI-aware cloning.
Now there's something on his current guest that's been lost or misconfigured or some such; details weren't given but they don't really matter. Rather than replace the entire guest disk image, he wants to (A) attach an older image to the guest, and then (B) inside the guest, mount that disk at some temporary mount point and go copy individual bits off of it. More specifically, he wants to do these steps repeatedly to get varying files out of VDIs of varying ages.
(B) wouldn't be a problem, we've all done that before. But of course he can't get (A) done because trying to attach any of the older copies gives the error "Cannot register the hard disk 'older_copy.vdi' {foo-bar-baz} because a hard disk 'current.vdi' with UUID {foo-bar-baz} already exists." No surprises there. This is when he came to me. (Filenames replaced for easy reading.)
My thought was to clone the copied files, and then attach the clones. But "VBoxManage clonehd older_copy.vdi clone_of_older_copy.vdi" fails with the same error message. Apparently even command-line cloning involves a registration step, which I wasn't expecting. And we can't use the Virtual Media Manager UI because that doesn't even list the copied files, only the currently attached ones.
What are his options here? All I can come up with is:
1) Remove the guest VM entirely from the VB Manager, carefully NOT deleting any files.
2) Using "VBoxManage clonehd", clone each of the older VDI files that he wants to examine.
3) Re-add the guest VM into the VB Manager.
4) Attach/delete each of the clone images as needed.
Is there a better approach?
(At the very least, I've convinced him to stop making VDI backups using file copy operations. He's learning a lot!)