Problem with VM and snapshots...Help!

Discussions related to using VirtualBox on Windows hosts.
Post Reply
tsgrp
Posts: 6
Joined: 26. Oct 2016, 00:53

Problem with VM and snapshots...Help!

Post by tsgrp »

Suse linux VM running Novell GroupWise mail server that had three snapshots ran out of space on the host machin (Windows server 2008)
1 snapshot from 6/2013, 1 from 4/2016, 1 from 9/2016
Deleted newest snapshot as was informed it wasn't needed
It presented the typical data will be "merged" warning and proceeded to process.
This ended up actually deleting three years worth of data and is now running off the original snapshot from 2013?
The 4/2016 snapshot is still there but the VM will not boot
I created a new VM from the original vmdk file (2013) and that does work, what I need to do is get the data from the 4/2016 snapshot merged into the 6/2013 image
I don't want to lose any more data accidentally.
How can I either mount the 4/2016 snapshot and copy the data somewhere else or properly merge it into the base image?
Need help soonest.
Thanks
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Problem with VM and snapshots...Help!

Post by socratis »

First and most important; read the following nice explanation about differencing disks and snapshots (which are based on the concept of differencing disks) and you'll pretty easily figure out why they can be really bad.
ChipMcK in a [url=https://forums.virtualbox.org/posting.php?mode=quote&f=1&p=276859#pr276859]recent post[/url] wrote:When a virtual disk is first created for a new virtual machine, it is considered as the base disk for the guest - data for the guest is read from and written to that disk image.

The differencing disk records changes sector-by-sector to the whole disk image, not changes to any file in the disk. VirtualBox does not know what file system is employed on the disk image and therefore can not access any individual file of/on the disk image; only the guest OS is aware of that information.

First SnapShot creates a differencing disk for read/write access while the base disk becomes read-only - as the guest modifies its data, the data is written to the differencing disk and the base disk is untouched.

Second SnapShot creates another, new, differencing disk for read/write access while the first differencing disk becomes read-only along with the base disk.

Subsequent SnapShots create additional differencing disks, with the preceding differencing disk joining the hierarchy (pecking order/chain) of read-only disks.

Keep in mind that access to/from the virtual disks is sector-by-sector, not file-by-file.

When the guest requests that a sector be read, the latest SnapShot is read first. If the sector is not found there (Sector-Not-Found is returned), the next SnapShot in the chain (youngest to oldest) is read, until the base virtual disk is reached. Then the sector on/in the base virtual disk is either read or Sector-Not-Found is returned.
Now, regarding your problem:
tsgrp wrote:Deleted newest snapshot as was informed it wasn't needed
  • Who/what informed you it wasn't needed?
  • How did you delete it, from inside the OS, or from within VirtualBox? Exactly.
  • Select your VM. On the top right of the VirtualBox Manager there is a "Snapshots" button. Select it. Post a screenshot of the VirtualBox Manager window, or just crop and focus on the snapshot tree. Something like the picture in the User Manual, Chapter 1.10 Snapshots.
On top of that, I'd like to see the "recipe" of the VM, the ".vbox" file:
  1. Right-click on the VM in the VirtualBox Manager. Select "Show in Finder/Explorer/Whatever".
  2. ZIP the selected ".vbox" file and attach it in your response.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
tsgrp
Posts: 6
Joined: 26. Oct 2016, 00:53

Re: Problem with VM and snapshots...Help!

Post by tsgrp »

The previous support person indicated it shouldn't be needed, perhaps he didn't understand how Virtual Box does snapshots? They created the snapshots

Deleted from within the Virtual Box interface
vbox.jpg
vbox.jpg (10.5 KiB) Viewed 2568 times
IIT.zip
(3.87 KiB) Downloaded 2 times
I was under the impression that the information would be merged not deleted. Well now I need to figure out how to either mount the snapshot to get the data out or properly combine the contents.

Thanks in advance for the help.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with VM and snapshots...Help!

Post by mpack »

It looks to me as if someone has been messing with the snapshot structure: a snapshot VDI has been removed and re-registered.

"Problem with snapshots" is not very useful. What precisely is the error message?

It is still unclear to me what "deleted the newest snapshot" means. Create a screenshot and draw an arrow to what you consider to be the latest snapshot?
tsgrp
Posts: 6
Joined: 26. Oct 2016, 00:53

Re: Problem with VM and snapshots...Help!

Post by tsgrp »

I have been trying things based on what I read on how to merge the contents properly, it said to go to the latest snapshot

This is what I followed
Merge source snapshots

Here’s how to merge the source snapshots to the source disk image VDI file (skip this step if you source VM doesn’t have any snapshots).

If the source VM is running close it.
From the VirtualBox window select the source VM then click the Snapshots tab.
If you want to include the current state of the disk in the merge save it as a snapshot by selecting the Current State then executing the Take Snapshot (Ctrl+Shift+S) command.
Select the most recent snapshot you want to include in the target VM and execute the Discard Snapshot (Ctrl+Shift+D) command. This merges the snapshot file into it’s parent VDI file (snapshot or base disk).
Repeat the previous step, working your way down the snapshot list until the oldest snapshot has been merged into the base VDI.

The VirtualBox snapshot commands are poorly named, in particular the inconsistent and confusing use of the word Discard:
Command Should be named Applied to Description
Discard Snapshot (Ctrl+Shift+D)

Merge with Parent

Snapshot

Merges the snapshot file into the parent snapshot or disk image file and then deletes the now redundant snapshot file.
The error on this VM is it won't boot, fails finding what looks like a volume.
The only thing that was done was deleting a snapshot from the console, it took about 1.5 hours where it said merging contents, now here we are.
I was able to create a new VM and point to the base image (from 2013) and we are running off that now.

Well, I tried to convert the non-functioning image last night but it errored our with the following
copy virtual drive error.jpg
copy virtual drive error.jpg (27.47 KiB) Viewed 2549 times
Taking a chance I decided to try to start the problem VM to get a screen shot of the error and lo and behold it booted up successfully.
But...Lots of database corruption in system, nothing works. Opening a case with mail system vendor now.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with VM and snapshots...Help!

Post by mpack »

Please say who your sources are! Give a link, or name them.

AFAIK, VERR_EOF has nothing to do with the problems you have discussed so far. VERR_EOF means that it went to read data from offset X in the file, only to find that this is beyond EOF (End Of File). That would mean that the file has been truncated, e.g. by copying to FAT formatted media, or any drive which didn't have enough space.

I won't get involved in a zillionth debate on how to name the snapshot functions. It's been done to death, and the current wording won.
tsgrp
Posts: 6
Joined: 26. Oct 2016, 00:53

Re: Problem with VM and snapshots...Help!

Post by tsgrp »

Sorry wasn't trying to be vague, this is the article followed
srackham dot wordpress dot com slash cloning-and-copying-virtualbox-virtual-machines

I just know that after trying to perform the convert last night, which you see failed, I attempted to start the failing VM, which it did.
However the content in the VM seems to be corrupted. I opened a case with their support (GroupWise) to attempt to resolve.

I was primarily concerned that when performing a remove snapshot within the VBox console(thinking it was merging the content) actually removed the data in the snapshot.
Last edited by mpack on 26. Oct 2016, 19:16, edited 3 times in total.
Reason: Add link
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with VM and snapshots...Help!

Post by mpack »

Thanks. Btw, you shouldn't need to obfuscate offsite links now, you are no longer a new participant.

Normally we don't acknowledge offsite sources of VirtualBox information: this site is the official site and therefore the definitive reference. However I looked over his advice and it seems to be correct, though IMHO it's dangerous to mix obsolete advice with current advice.

However... I don't see the connection between his advice and what you've been talking about. His first paragraph supercedes all that follows it for everyone using the more recent (post 2013) versions of VirtualBox, and that would include yourself, so I don't know why you were deleting snapshots?

Anyway, lets cut to the chase: copy all the VM VMDK elements into a folder, identify the latest snapshot (you don't want the base VMDK), and try cloning it using CloneVDI. The result should be a merged VDI which you can use as the basis of a new VM: don't attempt to use this clone in the old VM.

Because you've been attempting to merge snapshots, there's a danger that CloneVDI will be unable to see a complete snapshot chain from the file you select: you'll get an error about differencing disks not being supported. If that happens then test if you get the same result with other snapshots. Each of these secondary options will involve loss of data, all the way down to cloning down the base VMDK, which as you've already seen will mean losing all data prior to the first snapshot.
tsgrp
Posts: 6
Joined: 26. Oct 2016, 00:53

Re: Problem with VM and snapshots...Help!

Post by tsgrp »

Thanks
Was able to restore using a back that was located.
I still want to combine all snapshots to on new base image, is the clone vdi the best tool for that, point it to the latest snapshot file (with all the files in one folder) correct.
tsgrp
Posts: 6
Joined: 26. Oct 2016, 00:53

Re: Problem with VM and snapshots...Help!

Post by tsgrp »

Tried CloneVDI and pointed to the most current snapshot file, it indicates that it cannot
clonevdi.jpg
clonevdi.jpg (37.99 KiB) Viewed 2506 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with VM and snapshots...Help!

Post by mpack »

See the last paragraph of my previous post.
Post Reply