What to do after discovering that snapshots are a bad idea

This is for discussing general topics about how to use VirtualBox.
Post Reply
EliteHuskarl
Posts: 2
Joined: 30. Jul 2021, 15:32

What to do after discovering that snapshots are a bad idea

Post by EliteHuskarl »

I'm relatively new to VB and VMs in general and have been recently given network admin duties for the small company I work for. I have relatively little formal IT background or training but I'm usually a pretty quick study.

Our data and email servers are running Windows Server 2019 as guests on a Mint host using VBox (6.1.16). One of my first major tasks is to get a good backup system running. Following the VBox instructions I started taking snapshots as a first step until we could get to the point where we could take the VWs offline for cloning and regular backing up.

That was before I read on this forum about the ins and outs of how snapshots work and why they are a bad idea, not a true backup solution, and can make the VM more prone to failure. Needless to say I am concerned at the risk this poses to business critical servers. First priority of course is finding a good time to take the VMs offline and backing them up. Beyond that, is there a way to "undo" snapshots and have the VM run once again just off the base VDI? Screenshot below, apologies to all the site mods who have been patiently explaining the flaws of snapshotting for years, and as this is my first post please let me know if I've failed to observe a posting guideline. :oops:
Attachments
VBox snapshot screenshot.png
VBox snapshot screenshot.png (76.13 KiB) Viewed 5980 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: What to do after discovering that snapshots are a bad idea

Post by mpack »

You are quite correct that snapshots are a disaster waiting to happen and definitely not any kind of backup. They allow you to create alternate states, not multiple copies of one state as required by a backup strategy. Plus the fact that they are all stored on the same drive should tell you that this is definitely not the favored 3-2-1 backup approach!

The safest way to undo the snapshots decision is to shut down the VM and then make a full clone (right click|Clone...), keeping current state only (i.e. not preserving the snapshot structure). Also be sure to keep MAC addresses, and check "Keep Hardware UUIDs" so as to keep your Windows 2019 activation. Once you verify that the clone is working you can delete the original VM.

The most robust backup strategy is to shut down the VM and then copy the VM folder (containing .vbox and .vdi files) to secondary storage of some kind (e.g. server or NAS).

If offlining the server is not acceptable then you should run a backup from inside the VM, e.g. run a Macrium Reflect backup to a network folder. You should practice a recovery step too, just so you know how its done. Recovery would require an offline backup as a template, but it can be an old one, e.g. as old as the original VM. Then you run a Macrium restore session from inside that VM, accessing your most recent online backup from the NAS (or other secondary backup) folder.
EliteHuskarl
Posts: 2
Joined: 30. Jul 2021, 15:32

Re: What to do after discovering that snapshots are a bad idea

Post by EliteHuskarl »

Thank you for the helpful reply. I think out of an abundance of caution I will copy the VM folder as is, then clone it, then if the clone works I will properly back that up as well. I have not used Macrium but I will look into that. Currently we use Cobian for data backups and for our mail/web server we use ShadowProtect.

One more question: I imagine that as long as the clone is on the same host I can't run both the clone and the original with the configuration you recommend... but as long as the original is powered off there should not be an issue running the clone correct?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: What to do after discovering that snapshots are a bad idea

Post by mpack »

The whole point of a clone is that it has no affect on the original, but if you feel you need to make a backup of the original then sure, it does no harm.
arQon
Posts: 228
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: What to do after discovering that snapshots are a bad idea

Post by arQon »

EliteHuskarl wrote:One more question: I imagine that as long as the clone is on the same host I can't run both the clone and the original with the configuration you recommend... but as long as the original is powered off there should not be an issue running the clone correct?
Short answer: correct.

re your backup strategy, while what mpack says is doubtless correct, the advantages to backing up a VM as an single unit, rather than backing up the *contents* of that VM, are IMO significant enough to make it the better approach unless you absolutely can't afford any downtime at all. (In which case, again IMO, you have problems that you should probably be solving with a failover strategy etc already).
Even on consumer-grade HW, backups take ~1min of downtime per 10GB of VDI: massively more performant than a "typical" backup, and multiple orders of magnitude quicker than one to restore, which when things hit fans is a lot more important! :)
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: What to do after discovering that snapshots are a bad idea

Post by scottgus1 »

mpack wrote:The safest way to undo the snapshots decision is to shut down the VM and then make a full clone
EliteHuskarl wrote:as long as the clone is on the same host I can't run both the clone and the original with the configuration you recommend... but as long as the original is powered off there should not be an issue running the clone correct?
arQon wrote:Short answer: correct.
Just want to add a nuance to my colleague arQon's answer. There are two things to consider when running an original VM and a clone VM at the same time: The Virtualbox environment and the OS inside the VMs.

Virtualbox clones are designed to allow running both original and clone at the same time.

However, the OS inside the VMs is identical, including active services and network names. Some OS's complain if another OS having the same network name is active on the network. Both VM OS's can pick up the requests for a service from a networked client, leading to confusion over which VM is answering the client and which one now has more up-to-date data.

So the answer to the question depends on the OS inside the VM. In your case, being an active server, I would not run the original and the clone together on the same network. But if you break the original off the network so no services etc can be duplicated on the network, then you can run the original and the clone at the same time (provided your host has enough resources).
Post Reply