Page 1 of 1
Restoring VMs after RAID Failure
Posted: 27. Oct 2011, 23:17
by chemikalguy
I'm fairly new to using VirtualBox, so bear with me if I ask something newbies ask. I had a RAID array fail yesterday, and rebuilt it today. I restored the host OS (windows server 2003 R2 - 64bit) and had to do a reinstall of VirtualBox. I had backups of the VMs, as well as snapshots of one of them. Two VMs were new, so there were no snapshots.
So, I copied the VM and the two snapshots from the backup server to the host, but when I try to add the VM in virtualbox, it says that "differencing image ......can not be found". So, I assume this to mean that I either have to merge the snapshot with the VM, or delete it - if my googling is correct.
The problem is, when I run the command in vboxmanage to restore the snapshot, I get an error that the system can't find a registered machine called xxxxxx.
So, my question is, since I can't add it in the GUI, it's not registered, and I can't restore the snapshot. So, how do I get this to work? Please be as detailed as possible, as I'm not very familiar with the command line.
Thanks!
FYI - I have the VMs in a different folder than the Documents and Settings\xxxx, but have changed the default machine location in the GUI.
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 12:26
by mpack
VirtualBox version? You need to back up the .xml/.vbox files as well btw. These contain control information for your snapshots: lose the xml and you lose the snapshots too.
Your only practical solution is to use the CloneVDI tool (see sticky in Windows hosts) - to merge the snapshots. Details are in the release notes. When choosing the source file to clone remember that you have to select the latest difference file, not the base VDI.
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 15:17
by chemikalguy
I'm running the latest version. I actually just downloaded and installed it two or three days ago, and was working on making a 'gold image' VM when the RAID array went south. I'll try the clonevdi too. My backups actually backup the entire virtualbox folder, as well as the 'Program Files' folder, so everything is captured.
Scott
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 15:27
by mpack
If you have a backup of the entire VM folder then it should be possible to just copy it back onto your hard disk and double-click the .vbox file. Even with snapshots present, that should re-integrate the VM back into the UI. I assumed that since you didn't mention this easy recovery, you must not have backed up the whole VM, hence my earlier comments.
If you had already tried constructing a new VM around an existing disk then you should abandon and delete that attempt before doing the above.
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 15:54
by chemikalguy
Hmm, I don't see any .vbox files anywhere. Here's what I have:
(.Virtualbox folder)
vboxsvc.log
virtualbox.xml
virtualbox-xml.prev
-----(Hard Disks)
-----(Machines)
------------(Server1)
-----------------(Snapshots)
asdfasdfasdfasdf.vmdk
asdfasdfasdfasdf.sav
rtuirtuirtuirtuirt.sav
rtuirtuirtuirtuirt.vmdk
-----------------(Logs)
vbox.log
vbox.log.1
vbox.log.2
vbox.log.3
Does this make sense?
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 16:47
by mpack
chemikalguy wrote:Does this make sense?
Not really. If you really have a backup of all VBox folders, and if you are using the latest VirtualBox version, then there must be a .vbox file present for every VM. The VM could never have worked without it.
I also notice that you are using .VMDK files. That would be unusual for a VM created in VirtualBox - .vmdk is the VMWare format. It's also what you get if you used export/import - but I hope that isn't what you meant by a backup.
I also notice that your folder hierarchy is the pre-v4 layout, not the current v4 layout. In v4 your VMs are stored in subfolders of the "<UserDoc>\VirtualBox VMs" folder, one subfolder per VM. VirtualBox.xml no longer contains vital data.
You still have not really answered my question about which version you are using: "the latest version" is an ambiguous answer.
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 17:46
by chemikalguy
It's 4.1.4r74291.
I did a windows search for *.vbox, and found .vbox files for the two virtual machines that I was able to successfully add, but not this one that I'm trying to add. It's possible that the previous systems admin left that VM in the default folder, which would mean that the .vbox file is no more. As that folder wasn't being backed up, because the VMs were supposed to be moved to a folder on the root of the C: drive on the server.
At this stage, what can I do?
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 19:14
by mpack
chemikalguy wrote:At this stage, what can I do?
See my first response in this thread (CloneVDI).
Re: Restoring VMs after RAID Failure
Posted: 28. Oct 2011, 19:56
by chemikalguy
Thanks so much for your help! I used CloneVDI, cloned the snapshot, then did the 'Add' VM, selected the new VDI, and selected the old VMDK file as the virtual hard disk. It fired right up!
Thanks again!
Scott
Re: Restoring VMs after RAID Failure
Posted: 29. Oct 2011, 13:39
by mpack
Hmm. I'm slightly concerned that you seem to be talking about VDI and VMDK in the same VM, but if you are happy then who am I to argue!
Re: Restoring VMs after RAID Failure
Posted: 31. Oct 2011, 16:20
by chemikalguy
It's likely that the VMDK was a holdover, as the previous admin used MS Virtual Server before I started here, and I think that's the format they use. It runs fine, so I'm certainly not going to start making waves.

Re: Restoring VMs after RAID Failure
Posted: 31. Oct 2011, 16:48
by mpack
It isn't actually the mixing of VMDK and VDI container formats in the same VM that concerned me - there is no problem with doing that. It just reads like you mounted both the clone VDI and a VMDK in the same VM, and wasn't clear to me what you needed the VMDK for. If it's supposed to be present as a second drive containing data needed for the application then fine.
Re: Restoring VMs after RAID Failure
Posted: 31. Oct 2011, 17:03
by chemikalguy
Hmm. Like I said, I'm a newbie on using this technology.
I created the VDI from a snapshot, but when I tried to boot it, it had an error, I'm guessing because it was only a snapshot and not a full VM. So, I selected the VMDK as the virtual storage, and it booted fine after that. It might have worked this time because before creating the VDI, I wasn't able to add the VM to the console, no matter how I tried it - even in the command line. Once I created the VDI, added it, and tried to boot, then I could edit the VM. The VDI is not used at all, as far as I can tell. This is no big deal, since the snap shot was taken the morning of the RAID crash, so I didn't really lose much at all.
Re: Restoring VMs after RAID Failure
Posted: 31. Oct 2011, 19:57
by mpack
chemikalguy wrote:I created the VDI from a snapshot, but when I tried to boot it, it had an error, I'm guessing because it was only a snapshot and not a full VM.
No - ability to clone the disk implies that CloneVDI must have been able to work out the entire snapshot chain, starting from the selected file and working back to the base VDI. Speaking loosely, a successful clone can only be a complete disk image, not a partial one based on a single snapshot file. However a
complete disk image is not necessarily a
working disk image: it depends on which snapshot state you selected as the source for the copy, and whether that was a working state or not.
chemikalguy wrote:So, I selected the VMDK as the virtual storage, and it booted fine after that.
I'm still having a problem deciphering exactly what you did, but it sounds like all you had to do was create a new VM and mount an existing disk - the VMDK - within it. The VDI is probably superfluous.
We could pursue the error message you get when you try to boot from the VDI, but if you already have a working VM then there's probably no point.
Re: Restoring VMs after RAID Failure
Posted: 31. Oct 2011, 20:11
by chemikalguy
Yeah, that's pretty much it. The system gave the GUID error when trying to 'Add' a VM to VirtualBox. I couldn't point to the VDI because this one used a VMDK instead of a VDI. So, by using the CloneVDI software and selecting the snapshot, it created the VM in VirtualBox, although it didn't work. Once I had the VM created in VirtualBox, I just had to point the VM to the VMDK as the storage, and it works.