Link to home
Start Free TrialLog in
Avatar of grizrules
grizrules

asked on

Hyper-V 2012 Checkpoints

I wanted to ask a question about Windows 2012 R2 STD Hyper-V Checkpoints (formally known as snapshots)

There is a lot of misinformation out there on the internet about how to PROPERLY go about removing snapshots.

I have read a GUI way to remove them, but I have also read that you should use PowerShell to remove them (if PowerShell is the best way, which PowerShell version.  There are so many different kinds of PowerShell.  Such as AD Module for Windows PS, Windows PS, Windows PS ISE, etc )

If anyone can provide the best method, preferably both GUI (manual) and PowerShell on how to remove a snapshot that would be great.

Here is the information I have read so far but have not tried:
For virtual machines running on Hyper-V or VMware hosts
The Remove action removes the selected checkpoint and you can no longer restore the virtual machine to the checkpoint that you removed. No other checkpoints are removed, whether they were created before or after the checkpoint that you removed.
To remove a checkpoint
-In Virtual Machines view, navigate to the host on which the virtual machine is deployed.
-In the results pane, click the virtual machine, and then, in the Actions pane, click Manage checkpoints.
-In the Available checkpoints tree, select the checkpoint that you want to remove, and then click Remove.
-If the virtual machine is running on Virtual Server virtualization software, you will receive a confirmation prompt explaining that all checkpoints created after the selected checkpoint will also be removed. Click Yes to proceed.
ASKER CERTIFIED SOLUTION
Avatar of Steve Whitcher
Steve Whitcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cliff Galiher
Regarding Hyper-V, it makes absolutely no difference whether you use Powershell or use the GUI. They both send the exact same command to the VMM service via its API and it does the merging and deleting.  The GUI doesn't do it, nor does Powershell.  They just initiate the process. And that is a known and documented API.

As far as the rest, it depends.  The Hyper-V Manager GUI is different than the SCVMM GUI. There are 3rd-party GUIs too.  And Powershell is the same whether run as a command line or in the ISE.  The AD Module is like any module. It isn't a different version of Powershell. It is just a module that loads into the existing version of Powershell and in so doing, offers new cmdlets.  If you loaded the AD module, you'd be able to run cmdlets to manipulate Active Directory. And if you didn't, you wouldn't be able to run those cmdlets. For Hyper-V you usually don't need the AD module, but if it happens to be loaded it won't hurt anything either.
It depends which Snapshot is selected when you issue the DELETE. As for from the GUI or Powershell, it makes no difference.
Avatar of grizrules
grizrules

ASKER

Here is the link I was viewing:
https://technet.microsoft.com/en-us/library/cc956007.aspx

I don't find the link very help at ALL because using the Hyper-V GUI on Win2012 R2 Has NO RESULTS PANE clearly marked as such that I cannot locate.

 Within the Action PANE (which is not listed as the Action Pane) "Manage Checkpoints" as this article refers to, is no option named "manage checkpoints".
If I click on any of my Virtual Machines that has an existing Checkpoint I have the options (see attachment)
I can see "delete checkpoint..." , but no manage.

Also the Hyper-V Machine that I currently have no checkpoints on , have a Checkpoint option under, I guess under the Action's pane, but there are no elipses (....) so If you click on checkpoint it automatically creates one without any prompts and just automatically creates a checkpoint is a default location.

Lastly I was told that in Hyper-V if you want to backup your Hyper-V machine you simple can do it while it's running or turn it off and select Export.  Apparently you can export this to a backup device.
I have tried this and when I go to my backup device I do not see the .vhd file when I do an import.  Only when I use INPECT DISK does it recognize the any .vhd .  

I have used VMWARE and Virtualbox.  Those are so simple.   You can merely just copy the .vhd file from one location to another and POW, it's backs up the entire VM.

The company I'm at now uses Hyper-V and I have been learning a lot about Hyper-V, but this issue has me a little baffled.

Thank you
Well, your link is to a page for System Center.  So unless you've bought, installed, and configured SCVMM (as I mentioned above, that is an option) then almost nothing on that page applies.

To keep from muddying the waters, I'd recommend taking the backup stuff to a different question. Otherwise we can play whack-a-mole with each new random confusion that crops up during this conversation.
I've not messed with VMWare in years, so I'm not sure how they handle it, but for Hyper-V, a .vhd file is not the whole VM, it's just the disk.  Moving or copying only the .vhd file to a new location is like pulling the hard drive out of a computer.  The hard drive needs the rest of the computer to make it work.  However, the "rest of the computer" in this case is just some tiny config files that contain the details of the VM, so it's trivial to move them around as well.

That said, I agree with Cliff, it's probably best to move the backup questions into another discussion to keep this one on track.
Understood, and Yes I have read up on SCCVM, but unfortunately we are not in a position to purchase that.

How would I move this thread somewhere else?  Would the MOD's do it or should I start a new one elsewhere?
Grizrules -- I'm not suggesting you need to move the thread, but rather keep it focused on just the snapshot issue, and start a new thread with questions about backups.  

I think Cliff's point was that you were looking at the wrong documentation.  The link you posted is about VMM, not about Hyper-V in general.  On top of that, it's for a version of VMM that is several years old.  Anything you read in that document is very likely not relevant to using Hyper-V manager, and/or out of date.
@Steve & @grizrules

VMware vSphere and Workstation, Player are exactly the same, substitute VMDK for VHD.

What is different between VMware vSphere, Workstation or Player and Hyper-V - the folder structure for the VM contains all the files, this is somewhat different with Hyper-V, the data disk (vhd) and meta data (machine config), are in different folders.

Rightly or Wrongly, this has led users, to copying random files from the folder, when distributing VMs, which to be honest is not the correct method of distributing a VMware VM. - however it can work!

Copy/Moving a VM, that are better methods, like Exporting and Importing, the Microsoft Hyper-V way!
So Andrew Hancock
You stated "Copy/Moving a VM, that are better methods, like Exporting and Importing, the Microsoft Hyper-V way!"

What would be the best way step by step to take a snapshot (checkpoint) in Hyper-V running on Windows 2012R2
Step-1
Step-2 etc..
Then what can you do to ensure a backup of a checkpoint if you do not have the SCCVM software?
Thank you all very much
Snapshots are not backups.

If you want to backup/keep the current state of the VM, Backup the VM at that point in time.

e.g. Export the VM, this will give you a backup of the VM, at this point in time.

You cannot backup a snapshot.

Keeping a VM running on a snapshot, you will experience performance issues. Snapshots are designed as a quick method of rolling back applied changes, but we personally do not use them.

Snapshots on either platform VMware or Microsoft are evil!
FWIW, according to MS, snapshots have always been intended for test/dev environments, and not for use in production.  Still, many people do use them in production, generally as a quick replacement for backing up the VM before making potentially dangerous changes.  Then they can roll back if something goes wrong, or delete the snapshot if everything goes right.  Snapshots weren't originally designed for this, and it can cause problems in some cases.  Basically, it's more like taking a "Crash Consistent" backup, and doesn't actually play nice with applications or do anything to prepare the machine for backup.
Windows 10 server will introduce a new feature, Production Snapshots, which IS designed for this use.  When this feature is enabled, any VM will only be able to have one snapshot at a time, but when you take a snapshot it will use vss and prepare things for backup properly before creating the snapshot, so that if you do have to roll back, it will bring everything back up cleanly.
I installed the Windows backup Server on my HOST1 and HOST2 machines.  This was a suitable backup solution until we have a better one.

So Steve are you saying I should DELETE my CHECKPOINTS?

IF SO, what is the best way to delete a checkpoint without leaving any metadata behind?

I do not have SCCVM, only the HYPER-V Management.
From what I can see (I'm not an expert at Powershell) I can go via the GUI to DELETE checkpoints and the CHECKPOINT TREE for each HYPER-V machine I have (running 2012R2 and Running within Win2012R2)

See Attachment.

I thought at least one checkpoint every now and then would be a GOOD idea, especially if you need to roll back incase of a windows update issue or any install that screws up something.

I do have it where each HYPER-V machine replicates to an offline copy on a different physical host.
So all Hyper-V's on HOST1 will replicate to HOST2 and vice a versa.
This is good is case we have a crash, however it provides no use if an windows update is applied for within 15 minutes the offline copy of the VM will be replicated.

-Original question:
-Checkpoints or No checkpoints?
-Best way for ME to delete checkpoints?

Thank you
As a rule, you should not have any checkpoints on production VM's.  Checkpoints add significant overhead in the form of CPU and disk i/o.  Based on the purposes you're describing, regular backups of the VM's would be the right solution, not checkpoints.

Deleting checkpoints from the hyper-v gui is what I have always done.  I rarely delete an entire tree, but that's probably because I rarely have more than one checkpoint on any given VM other than in my test environment.
So delete the tree or delete just one checkpoint?

As you said " I rarely delete an entire tree, but that's probably because I rarely have more than one checkpoint on any given VM other than in my test environment"

Which means you have ONE checkpoint on a production machine.   However you stated above that you discourage checkpoints in a production environment?
I do use checkpoints in production periodically, for short periods of time.  For example, before installing a major service pack or similar.  Once the install is complete without issues, I delete the checkpoint.  (That's the kind of use that MS doesn't recommend/officially support, but will support in Windows 10 server.)  I try to never leave a checkpoint for a VM more than just for the short time I need it, and I virtually never keep multiple checkpoints on a production VM.  Each checkpoint adds another layer of indirection that the host has to process when reading/writing to the drive, so the more checkpoints, the worse the performance gets.
10-4 Thank you