[Fixed] PowerOffRestoringSnapshot piles up snapshots

Postings relating to old VirtualBox pre-releases
Post Reply
socratis
Site Moderator
Posts: 27330
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

[Fixed] PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

Launch VirtualBox. Start a VM. Close the VM and select to Power Off, while choosing to restore the last snapshot. Instead of returning to the last snapshot, a new snapshot is added. For example the following VM started with a single snapshot:
<HardDisk uuid="{99c68b8b-114d-48ad-b82f-13f86b4f8e77}" location="Mac OS X 10.6.vdi" format="VDI" type="Normal">
  <HardDisk uuid="{efa95eda-89e7-4954-afe5-574bd1f5471a}" location="Snapshots/{efa95eda-89e7-4954-afe5-574bd1f5471a}.vdi" format="VDI">
    <HardDisk uuid="{5d15bb91-d4ba-45d5-b4c1-e70716ca5dca}" location="Snapshots/{5d15bb91-d4ba-45d5-b4c1-e70716ca5dca}.vdi" format="VDI">
      <HardDisk uuid="{648097d4-eddd-4a86-b0e2-ce843f3e72b1}" location="Snapshots/{648097d4-eddd-4a86-b0e2-ce843f3e72b1}.vdi" format="VDI">
	<HardDisk uuid="{7c5b8e91-1e5e-4954-8ed7-e918c6620b87}" location="Snapshots/{7c5b8e91-1e5e-4954-8ed7-e918c6620b87}.vdi" format="VDI">
	  <HardDisk uuid="{da30e40d-cc55-41ad-91f7-9bde20ad48f3}" location="Snapshots/{da30e40d-cc55-41ad-91f7-9bde20ad48f3}.vdi" format="VDI">
	    <HardDisk uuid="{d3484d25-f780-438f-824f-28d13bdf1f21}" location="Snapshots/{d3484d25-f780-438f-824f-28d13bdf1f21}.vdi" format="VDI">
	      <HardDisk uuid="{73846932-5a05-4fa9-b7a2-234df50988a1}" location="Snapshots/{73846932-5a05-4fa9-b7a2-234df50988a1}.vdi" format="VDI"/>
	    </HardDisk>
	  </HardDisk>
	</HardDisk>
      </HardDisk>
    </HardDisk>
  </HardDisk>
</HardDisk>
This happens ONLY the first time that you close the VM after you've started VirtualBox. In other words, if you launch VBox, launch VM, close w/ restoring VM it creates a snapshot. Subsequent open/close VM do not create additional snapshots. If you close VBox and repeat the procedure, a new snapshot is created.

Host: OSX 10.9.5.
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.
socratis
Site Moderator
Posts: 27330
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: PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

OK, this really bit me in the behind. Just wanted to say that thankfully I have several .vbox backups.

I usually make a clone when dealing with the betas. One time I forgot and launched a quick test with 5.1.0b3 (my mistake is the underlined one).
Tested, shut down the VM (restoring to the previous state), uninstalled the beta, installed 5.0.24.
My VM still thought that I had the 5.1.0b3 GAs. It took me a while to figure it out and revert back to the originals.

Are you guys not seeing this? Is it a 10.9 issue? This and the deletion of the ExtraData section make it impossible to work with the beta unfortunately.
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.
klaus
Oracle Corporation
Posts: 1115
Joined: 10. May 2007, 14:57

Re: PowerOffRestoringSnapshot piles up snapshots

Post by klaus »

Tried reproducing, and failed. Can you please attach your .vbox files?

What you're reporting regarding lots of diff files being created sounds like a very serious bug which was in 5.1.0_BETA1 (trashing _all_ snapshots by making them identical to current state whenever VirtualBox writes the .vbox file, causing diff image pileup as a side effect). It has been fixed in time before 5.1.0_BETA2. Note that the fix can't cure the diff image pileup and the snapshot trashing, but it will not do any further damage, in the sense that restoring the latest snapshot will create at most one additional diff image ever (not for every VM start/close+restore) and that future snapshots will work properly again.

The snapshot config trashing means that restoring a particular snapshot is doing something completely different than you expect, it'll be much newer. It's possible to manually repair the .vbox file, bringing the old snapshots approximately into the state they should have, but it's tedious work already to get the disk images right, leave alone possible settings changes (which you'd have to remember). This is especially true with non-trivial snapshot hierarchies.

You might be noticing damage which actually had been done almost a month ago.

I have no explanation for losing ExtraData, because that's 'VM global', not related to snapshots at all. The 'cached' GA infos would show up in GuestProperties, and that's affected by the snapshot trashing mentioned above.
socratis
Site Moderator
Posts: 27330
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: PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

klaus wrote:Tried reproducing, and failed. Can you please attach your .vbox files?
Sure thing. Let me describe here my modus operandi.
After I get the VM to the state that I want, I create a snapshot. Then I can experiment at will and always revert back. There is always one snapshot and one snapshot only. When I "shutdown" the VM, I usually don't even shut it down. I "Power off the machine" and have the "Restore to previous snapshot" enabled. That deletes the previous {snapshot}.vdi and creates a new, empty of content, 2.1MB in size, {new_snapshot}.vdi.

So I start with Main.vdi + {1}.vdi.
Work on the VM, restore it, I end up with Main.vdi + {2}.vdi.
Work on the VM, restore it, I end up with Main.vdi + {3}.vdi.
Work on the VM, restore it, I end up with Main.vdi + {4}.vdi.
...

The problem now is:
Start with Main.vdi + {1}.vdi.
Work on the VM, restore it, I end up with Main.vdi + {1}.vdi + {2}.vdi.
Work on the VM, restore it, I end up with Main.vdi + {1}.vdi + {2}.vdi + {3}.vdi.
Work on the VM, restore it, I end up with Main.vdi + {1}.vdi + {2}.vdi + {3}.vdi + {4}.vdi.
...

Hope it makes more sense now.

Attached is the .vbox file for one of my typical machines.
OS X 10.9.vbox.zip
(3.84 KiB) Downloaded 23 times
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.
klaus
Oracle Corporation
Posts: 1115
Joined: 10. May 2007, 14:57

Re: PowerOffRestoringSnapshot piles up snapshots

Post by klaus »

I hear your words... but still can't reproduce. The .vbox file you provided is clearly not tainted by the broken BETA.
socratis
Site Moderator
Posts: 27330
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: PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

Yes, I know, it's from 5.0.24 (it still says innotek.de ;)) . As I said the beta is very dangerous in my case so I don't use it. But, I will get you the data what you want. It's simply going to take some time to do all the backups plus installs/uninstalls, plus I have to be somewhere for a while. Later today I'll present my evidence your honor!

I'll start with this reference VM and I will try to illustrate both my issues; the multiple snapshots and the ExtraData getting deleted. Two birds with one stone.
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.
socratis
Site Moderator
Posts: 27330
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: PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

Can't reproduce the multiple snapshot problem with 5.1b3 and I think I know why. My post was on 4/Jun. 5.1b2 was released on 7/Jun. Based on your comment about the bug that was fixed between 5.1b1 and 5.1b2 I believe that I was stuck somewhere in between and as you said, it doesn't get fixed by itself. I tested it multiple times and no issues so far. I think we can close this one.

I still have all the ExtraData sections removed, but I will post my findings in the relevant thread: viewtopic.php?f=15&t=78000 . It may actually be the same issue with another section having problems, the DeviceFilters section: viewtopic.php?f=15&t=78023 More on that on another episode...

Thanks again Klaus for your patience.
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.
socratis
Site Moderator
Posts: 27330
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: [FIXED] PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

Seems to be fixed with 5.1.0_RC1 r108607.
Actually it seems it was fixed with b2, but I was too scared to test it... :oops:
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.
klaus
Oracle Corporation
Posts: 1115
Joined: 10. May 2007, 14:57

Re: [Fixed] PowerOffRestoringSnapshot piles up snapshots

Post by klaus »

Oops... realized that I misread your original post, otherwise it would've been clear that you were affected by the bug in the first beta. Thought that it was a very fresh post from early July which was brought to my attention, not a month old one.
socratis
Site Moderator
Posts: 27330
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: [Fixed] PowerOffRestoringSnapshot piles up snapshots

Post by socratis »

Thanks, I just re-read the release notes for b2 myself and that was there. But between that and the <ExtraData> I was unfortunately unable to test the beta, until RC1. Oh well... :(
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.
Post Reply