Hyper-V and deleting Snapshots
-
@DustinB3403 said:
Ok so that makes a bit more sense, now the last part.
Why if you went to delete a VM and it's snapshots would the system merge them into one large file before dumping the entire item?
Because otherwise you would lose your data and users would be pretty upset if that happened.
-
@DustinB3403 said:
Ok so that makes a bit more sense, now the last part.
Why if you went to delete a VM and it's snapshots would the system merge them into one large file before dumping the entire item?
That one I don't know.
My guess is that the original files and proceeding snapshots are locked for writing. So they have to merge the snapshots one at a time to release them. That is only a guess though.
-
@DustinB3403 If you want to delete the entire VM (and its snapshots), it shouldn't try to merge. It would just delete all of the VHD's associated with that particular VM.
-
StrongBad I get the part about being upset, but if your goal is to "free space" on your hyper-v server, presumably you know what you're wanting to do, which is the topic of the SW links in the original post.
If the only way to free space on your server is to delete the VM's Snapshots, you're effectively deleting the delta changes to the VM.
So you're telling the server to "go back to when I first installed the VM" in effect.
-
@DustinB3403 If you delete the snapshots, then yes.... But if you merge them, then that is when it will free up the space.
Typically what I do is merge in the oldest snapshots to free up space...
-
@DustinB3403 said:
StrongBad I get the part about being upset, but if your goal is to "free space" on your hyper-v server, presumably you know what you're wanting to do, which is the topic of the SW links in the original post.
Deleting snapshots is not an action for freeing space but for merging changes. If someone was doing snapshot deletion for the purpose of savings much space (other than the deltas) then presumably they don't know what they wanted to do.
-
@dafyre which this will initially bloat the file size on the Hyper-V server, correct?
Until the merge is completed, what would happen if you attempted this merge, and didn't have enough free space on your Hyper-V server?
-
@DustinB3403 said:
If the only way to free space on your server is to delete the VM's Snapshots, you're effectively deleting the delta changes to the VM.
So you're telling the server to "go back to when I first installed the VM" in effect.
No, it might seem that way once you learn how each system works under the hood, but all VM platforms work the same - deletions DO remove the snapshot file but they don't kill the data, they merge it. VMware started this because it has a different kind of snapshot file and if HyperV did not keep the terminology you would have people killing their data right and left from confusion.
-
@StrongBad I can't speak for the SWOP, I'm just trying to understand Hyper-V as I avoid it here in our environment.
I prefer XenServer as the process is much more straight-forward.
-
@DustinB3403 said:
StrongBad I get the part about being upset, but if your goal is to "free space" on your hyper-v server, presumably you know what you're wanting to do, which is the topic of the SW links in the original post.
If the only way to free space on your server is to delete the VM's Snapshots, you're effectively deleting the delta changes to the VM.
So you're telling the server to "go back to when I first installed the VM" in effect.
You are mixing up terms. you said delete the VM at one point. that to me means the entire VM gone. I have no idea if Hyper-V merges the checkpoints (proper term in hyper-v) or not before deleting. It would seem to be a waste of resources to do so.
If you just meant delete the checkpoints, then yes, of course it has to merge them. They are deltas. This is NO DIFFERENT in Xen or VMWare.
A snapshot is not a backup by itself. You make use of a snapshot to cause the system to cease writing to the .vhdx in order for it to then be copied to a backup medium.
You then merge the snapshot back in unless you need to have some on system return to this point for some reason.
You never keep snapshots for long periods because all you do it create an ever growing delta file.
-
@DustinB3403 said:
@dafyre which this will initially bloat the file size on the Hyper-V server, correct?
Until the merge is completed, what would happen if you attempted this merge, and didn't have enough free space on your Hyper-V server?
Should not cause any bloat.
-
@DustinB3403 I'm fortunate enough to have never been in that situation, so I really don't know.
And @StrongBad is right... My brain is not working right this morning...(still waiting on caffiene to kick in)...
-
In xenserver, when I create a snapshot of my VM's they can be used as a complete restore. I export these off-host, and they are now "backups". They are intact backups that I can use at any time to recover a vm at any point in time.
I keep 4 backups (4 weeks worth of delta).
On Xen there isn't a merge of the files, at least from what I'm able to see. The VM size remains the same at the time of a Snapshot and export to a Backup.
I guess I'm just misunderstanding where the SWOP is having this file bloat that he's mentioning.
-
@DustinB3403 Don't confuse what NAUBackup does with regular snapshotting. There is a difference.
-
I'm not trying to confuse the two, simply trying to explain what I see.
And trying to understand the process of Hyper-V snapshot creation.
So the baseline is Hyper-V will create an original snapshot (when the vm is brand new), and everything else afterwards is a delta change snapshot.
Hyper-V then uses the 2 most current snapshots to run the VM? Is that correct?
or Hyper-V uses the original snapshot, and the most current to run the VM?
-
@DustinB3403 said:
I'm not trying to confuse the two, simply trying to explain what I see.
And trying to understand the process of Hyper-V snapshot creation.
So the baseline is Hyper-V will create an original snapshot (when the vm is brand new), and everything else afterwards is a delta change snapshot.
Hyper-V then uses the 2 most current snapshots to run the VM? Is that correct?
or Hyper-V uses the original snapshot, and the most current to run the VM?
Hyper-V uses all of them, the same with VMWare and Xen. It only writes changes to the most recent one but it looks at all of them to read data.
-
@coliver So then it would be smart to regularly merge the Hyper-V snapshots to free up space on your server.
And that seems really odd IMO. . .
-
Not quite... Because you can take a Snapshot of a Snapshot... (Hyper-V calls these Checkpoints)...
So if you have multiple snapshots anytime a READ occurs... It looks for it in the Current snapshot file... If it can't find it there, then it goes up to the previous snapshot file... and then it repeats that until it gets back to the original VHDX (I've heard some folks call this walking up the chain, lol).
Any time a WRITE occurs, it happens to the current snapshot file.
Edit: It is my understanding this is how pretty much all Hypervisors work with snapshots, please somebody correct me if I am wrong!
-
@DustinB3403 said:
@coliver So then it would be smart to regularly merge the Hyper-V snapshots to free up space on your server.
And that seems really odd IMO. . .
Right... the same as VMWare and I am pretty sure Xen.
Regardless of Hypervisor it is generally considered a good idea to merge your snapshots (or checkpoints) when you no longer need them. As has been said they shouldn't be used as backup there are much better tools for that.
-
@DustinB3403 said:
I keep 4 backups (4 weeks worth of delta).
This is where you are wrong. If you were only keeping 4 delta's, you would have no way to restore.
VM disk file: bob.vhdx - 100GB
Click snapshot button: bob_s1.ss - 0GB-XXGB growing as the system is used bob.,vhdx stops getting wrote to.
Click snapshot again: bob_2.ss - 0GB-XXGB growing as the system is used bob_1 stops getting wrote to.Click delete on snapshot 2 and it merges the changes back into snapshot 1.
Click delete on snaphot 1 and it merges the changes back into bob.vhdx.bob_s1 and bob_s2 are deltas of things changed since they were created. they are useless for a backup or recovery.
When you use a backup tool, it makes a snapshot so that the bob.vhdx is no longer being changed in order to let the it be copied off. The backup tools generally then merge the snapshot back in after it is done copying the core virtual disk.
Thus, there is no possible way that you have valid backups as you describe them. As you use a valid tool to perform your backups, I am sure you actually do have good backups. Just your understanding of the process or ability to describe it is what is lacking.