Page 1 of 2
Attaching Differencing Image
Posted: 2. Jul 2012, 19:02
by joeller
On Friday, one of the administrators of our system was attempting to increase the size of virtual disk of our VM using VBManager command line utility. While the VD was increased in size according to the VB Manager GUI, when the VM was booted up Windows did not show the extra space that had been added. He found some forum entry that told him to detach and re-attach the Virtual Disk. However after he did so he found that the disk image had reverted to the last snapshot done on 3/29/2012. A new diferencing image had been created and was was being used by the VM. When I came in on Monday I found that the correct differencing image was still located on the system. When I opened the Virtual Media Manager I found that the proper child diferencing image was attached but the proper grandchild differencing image was unattached and a new grandchild differencing image had been created. So I tried to use the Virtual Media manager to attach the proper image but I found no way to do that. Does anyone know how to get this done?
Re: Attaching Differencing Image
Posted: 2. Jul 2012, 21:01
by mpack
No backup?
Differencing images are hard to manipulate - to do it correctly you really need to be an expert. Attaching single files to VMs can lead to modification of that file, which corrupts its contents as far as the differencing chain is concerned. From the actions you describe, you may already have done this.
If you can identify the correct differencing child then you can try cloning the child file with
CloneVDI. No promises that it will work. Note that you must clone the difference file, not the base VDI. If it does work then it gives you a merged VDI which you can build a new VM around.
CloneVDI only supports VDI type snapshot chains (not VMDK or VHD). If you get an error message that snapshot files are not supported, and they are VDI format, then put all files in the chain into a single folder and try again.
Re: Attaching Differencing Image
Posted: 2. Jul 2012, 22:32
by joeller
Tried to use clone VDI. Unfortunately got message not enough space on destination drive. No sure why since there are 47 GB of room on actual hard drive and file is only 39 gb.
Re: Attaching Differencing Image
Posted: 2. Jul 2012, 22:37
by joeller
As for backup, he made a copy of the .vbox file and a copy of the VDI file. Anyway I can make use of those to undo what he did?
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 10:23
by mpack
joeller wrote:As for backup, he made a copy of the .vbox file and a copy of the VDI file. Anyway I can make use of those to undo what he did?
If nothing affected any files other than those two then yes, that will be sufficient.
I see from your history that we
previously had a long discussion about how to back up a VM, in which the need to back up the entire VM folder was discussed. I'm left puzzled as to why that info was ignored.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 10:27
by mpack
joeller wrote:Tried to use clone VDI. Unfortunately got message not enough space on destination drive. No sure why since there are 47 GB of room on actual hard drive and file is only 39 gb.
Try enabling the "Compact" option, and I emphasise again that you need to clone the correct current state file - cloning the base VDI would waste both our times.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 14:45
by joeller
mpack wrote:joeller wrote:As for backup, he made a copy of the .vbox file and a copy of the VDI file. Anyway I can make use of those to undo what he did?
If nothing affected any files other than those two then yes, that will be sufficient.
Excellent!!
Based on our previous discussion then it would seem that I should
Remove the broken VM.
Replace the broken files with the copies?
Machine/Add the VM using the replaced files.
Do you concur?
mpack wrote:[
I see from your history that we
previously had a long discussion about how to back up a VM, in which the need to back up the entire VM folder was discussed. I'm left puzzled as to why that info was ignored.
He, (the administrator/customer) felt that we had a lot more higher priority tasks to complete before spending time in learning how to properly use VirtualBox, particularly since it is a development machine. As usual in such cases, this strategy has come back to bite him in the a--. Unfortunately the customer is always right until things go wrong at which point it is your (the contractor's ) fault.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 15:47
by mpack
joeller wrote:
Based on our previous discussion then it would seem that I should
Remove the broken VM.
Replace the broken files with the copies?
Machine/Add the VM using the replaced files.
Do you concur?
Not really - my earlier comment had a caveat which hasn't been addressed yet. If the two files are self contained then they are sufficient as a backup. However if snapshots existed at the time they were copied then the backup is incomplete and maybe won't function, because the .vbox will access snapshot files that may no longer exist. It's hard to say from here.
Basically, if you use snapshots then there is exactly one practical way to back up the VM, and that is to copy the entire VM folder. If that has not been done then it's hard to say what is necessary to get this back to working order. It seems certain that recent data (from the current state) will have been lost - at least unless you are willing to persevere with CloneVDI, which is the only tool available which can repair a broken snapshot chain.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 16:17
by joeller
joeller wrote:Excellent!!
Based on our previous discussion then it would seem that I should
Remove the broken VM.
Replace the broken files with the copies?
Machine/Add the VM using the replaced files.
IT WORKED!!!!
Of course there is still the issue that Brad (the administrator/customer) was trying to resolve in the first place, i.e. failure of the Window Server 2003 R2 guest to show the additional space added to the virtual hard drive. But I've got a lot more pressing tasks that need to be done to this VM before we start playing around with that. Do you happen to know anything about this issue? If not, I'll just open another thread.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 16:30
by joeller
How do I mark your reply as the answer. I don't see any obvious buttons or links.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 16:34
by mpack
You can't increase a disk size if snapshots have been used. Delete all the snapshots then you can use "VBoxManage modifyhd --resize". I suggest a careful read of the appropriate bit of the current user manual.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 16:36
by mpack
joeller wrote:How do I mark your reply as the answer. I don't see any obvious buttons or links.
This isn't that kind of forum. You can however change the topic title to "[Solved] Attaching Differencing Image" by editing the first message.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 17:13
by joeller
mpack wrote: I suggest a careful read of the appropriate bit of the current user manual.
I read manual from cover to cover twice before I even attempted to install VirtualBox. I read the VBoxmanage modifyhd --resize Section 8.22 as well as Section 5.2 on Disk image files several times last Friday when figuring out how to resize the vhd. Page 78 says
As opposed to a physical disk however, VirtualBox allows you to expand an image file after creation, even if it has data already; see chapter 8.22, VBoxManage modifyhd, page 129 for details.
Page 129 says
The --resize option allows you to change the capacity of an existing image; this adjusts the logical size of a virtual disk without affecting the physical size much. This currently works only for expanding the capacity of VDI and VHD formats, and only for the dynamically allocated variants.
In neither place did it say anything about it not working when a drive had snapshots.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 18:06
by mpack
True. I don't know if it's intentional or an oversight that "modifyhd --resize" does not support snapshots - but that fact remains that it doesn't.
The details I wanted you to read about in the user manual was the details of how to use "modifyhd --resize", and that a partitioning tool will be needed to complete the job.
Also, note that I said "current user manual" - the feature explanation was expanded recently.
Re: Attaching Differencing Image
Posted: 3. Jul 2012, 22:16
by joeller
Recently expanded? Since March? Wow. Talk about moving target.