Save to My DOJO
Table of contents
Exporting checkpoints is one of those features that is very handy but not commonly used since it’s pretty situational. For example, picture this scenario: let’s say we just applied an update to a VM and the update went south. Thankfully, we created a checkpoint of the VM before we did the upgrade and we can use that checkpoint to revert the VM.
However, we want to perform more troubleshooting on this issue in a test environment to work out all the kinks with the upgrade. To do this, we take a checkpoint of the server after the upgrade was done, in its broken state, and then apply the previous checkpoint to revert the VM back to the point when everything was working. Now we can export the checkpoint of the VM from before the upgrade to a test environment for further analyzing.
How to export from a Checkpoint
If you are planning on importing a checkpoint into a Hyper-V environment that is using a different processor manufacturer, make sure to shut the VM down before you create the checkpoint. I will explain why when we go over importing the checkpoint. To export a checkpoint from a VM, left click on the VM in Hyper-V Manager to select it. In the Checkpoints window pane the checkpoints will be displayed. Right click on the checkpoint you wish to export and select Export. Also, notice in the screenshot below that the VM is currently running from the checkpoint of the VM state before we did the upgrade, as indicated by the green triangle:
The Export Virtual Machine window will appear. Click the Browse button to save the checkpoint to another location. Click Export to begin the export process:
Hyper-V Manager will indicate the progress of the export job in the status column of the VM:
When the export job has finished, a copy of the VM is created from the checkpoint that we selected. When we look at the directory that was specified during the export, we can now see that a new VHDX file was created:
The VM configuration and saved state files have also been created:
We are now ready to copy the folder containing our checkpoint export over to our testing environment, which will allow us to perform more analysis on the update that broke our server.
How to import from a Checkpoint
To import the checkpoint as a VM, simply open up Hyper-V manager and select the option to Import Virtual Machine:
Select the folder where your checkpoint was exported to and click Next:
The VM name will be displayed. Select the name and click Next:
Now we must choose the type of import to perform. There are three options available:
- Register – Use this option if the VM and its files are already stored in the desired location and you just need to register the VM. It will keep the same unique VM ID as before. The VM ID is a globally unique identifier (GUID) that Hyper-V assigns to each VM for identification purposes. This option is also handy if you run into an issue where the VM is missing from Hyper-V Manager. You can simply register the machine again.
- Restore – This option will copy the VM and its files to a desired location and keep the same existing VM ID. This is useful if you exported a VM to a flash drive and want to run the VM directly from the flash drive without copying the VM files.
- Copy – This option will copy the VM (just like in the restore option) and will also register it with a new VM ID. You would normally choose this option if you are copying a VM and using that VM copy in the same environment as the original VM.
In our example we will select the option to Register. This is because I have already copied the VM over to the location I want it to run from and since our test lab is in a separate environment from our production environment we don’t need to change the VM ID:
The following error will appear if the server we are importing to contains a different processor manufacturer than the one we exported it from. In our example we exported the checkpoint from a Hyper-V server configured with an AMD processor, and imported the VM to our test Hyper-V environment which runs off an Intel processor. This is also true when using Live Migration.:
This basically means that we can’t import the VM and restore it to the “running” state that it was in before. Instead, we will have to click Delete Saved State. The VM will now import as in a “crash consistent” state. If we would have shut down the VM before we created the checkpoint in the example above, we wouldn’t have run into this issue.
Next, we have to configure the VM networking components since the virtual switch in our test lab is not the same as in our production environment:
Then, click Next and then Finish. Now our VM is imported:
We can now power up the VM and perform out testing and analysis.
Not a DOJO Member yet?
Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!