You may have heard that Redhat is going to be offering an official way to create and manage snapshots of virtual machine images with the upcoming RHEL 7.1 release. That’s true. However, many of my customers have asked me about how to create, restore and delete snapshots. So, in this blog, I want to show you how to do so.
RedHat Virtualization is a hypervisor that permits the use of multiple operating systems, such as Hyper-V or RedHat Enterprise Linux, on the same physical hardware, while reducing the amount of virtual machines that are required for a given workload. RedHat Virtualization allows you to create, restore, and delete snapshots of virtual machine images, which can be useful for testing new OS updates and performing a variety of other maintenance and troubleshooting tasks.
Snapshot virtual machine
A snapshot is a representation of the operating system and applications of the virtual machine on one or all available hard disks at a given time. The administrator can take a snapshot of the virtual machine before making changes. This protects against errors that can have unintended consequences. If a problem occurs, the administrator can reset the state of the virtual machine to the state captured in the snapshot.
With Red Hat Virtualization, you can take live snapshots of running virtual machines, as well as snapshots of suspended virtual machines. RHVM supports multiple snapshots of the state of the virtual machine, but can only use one snapshot at a time.
You can stop the virtual machine and permanently restore the hard disk image to a previous snapshot. The RHVM rejects all images taken later. Before going back, you can temporarily check a particular snapshot by downloading it to make sure it is the one you want to use.
Snapshots can also be used to create new virtual machines. You can clone a virtual machine from an old snapshot instead of cloning directly from the current virtual machine. A clone is a copy of this virtual machine on new hardware. This has the advantage and disadvantage that the new virtual machine may contain machine-specific data and configuration settings from the old virtual machine. A snapshot can also be used to create a sealed template that can be used to create virtual machines from an image in which some machine information has been removed.
Create a snapshot of the virtual machine
With Red Hat Virtualisation, you can manually create snapshots for virtual machines through the management portal. The virtual machine needs the RHV gas agent to provide a consistent snapshot.
The following procedure describes how to create a snapshot for the virtual machine through the administration portal.
1. In the Virtual Machines tab, right-click the virtual machine in the original snapshot. Select Take snapshot from the menu. A window with the title Take snapshot appears.
2. In the Create Snapshot window, enter a description of the snapshot in the Description field. Under Disks to Include, select the disks you want to include in the snapshot.
When the virtual machine is running, you can select the Save Memory check box to save the memory status of the virtual machine in a snapshot. The resulting snapshot looks like a suspended version of the virtual machine.
Press OK to take a snapshot.
3. Check the Snapshot tab and make sure the Snapshot Status field is OK. It can take about a minute for this value to change from Locked to OK.
Back to a previous image
Once the snapshot is created, you can shut down the original virtual machine and restart with a previous snapshot. You have the option to view a snapshot before performing a rollback. In this mode, the virtual machine runs with a virtual snapshot. This way you can be sure that you have chosen the right recording.
When you’re done, you can finally fix the reverse. If you do this, the active image of the virtual machine will be restored to this snapshot and all snapshots newer than the one you select for rollback will be permanently deleted.
To view and restore the state of a virtual machine using a snapshot :
1. Click on the Virtual Machines tab in the Administration Portal. Select your virtual machine from the list and make sure it is turned off.
2. Select the Snapshots tab for your virtual machine at the bottom of the user interface. Find the photo you want to restore and select it from the list.
3. Click on the Preview item. If the snapshot has retained a memory condition, a window will open informing you of this and asking if you wish to restore the memory. The snapshot changes to the In Preview status, i.e. it is ready to be launched.
4. At this point, you have the option to run a temporary preview. Just start the virtual machine. If you decide to return to this snapshot, you can shut down the virtual machine again.
5. If you want to return to this snapshot permanently, click the Commit entry in the Snapshots tab. This permanently resets the state of the virtual machine to that snapshot and removes all snapshots that are newer than the one that was reset to. You can then run the virtual machine in normal mode to restart it.
If you do not wish to cancel this snapshot, click Cancel on the Snapshots tab. The photo changes from In Preview to OK and your original photo changes from Locked to OK. Again, you can now run the virtual machine normally or try to revert to another snapshot.
NOTE: The decision to engage with a particular image is irrevocable. The previous and current state of the image, as well as all snapshots more recent than the one you took, and all their inherent data, will be irretrievably lost.
Clone the virtual machine from snapshot
Any existing snapshot can be used to clone a virtual machine. Remember that a clone is a copy of a virtual machine created on new hardware. It may be useful to make a clone of the snapshot instead of the current virtual machine if you want to make a copy of an older state of that virtual machine.
Cloning a virtual machine from an existing snapshot
1. Click on the Virtual Machines tab in the Administration Portal. Select your virtual machine from the list.
2. Select the Snapshots tab for your virtual machine at the bottom of the user interface. Find the photo you want to clone and select it from the list.
3. Click on the Cloning item. A new Clone VM from Snapshot window opens, which is very similar to the New Virtual Machine window. Set at least one name for the cloned virtual machine. You can also define other details. Then click OK to create the cloned virtual machine.
Check the status of the virtual machine on the Virtual Machines tab. Once the status has changed to Disabled, you can start the new machine.
NOTE: The cloned virtual machine can retain the data from the original image. This may not be necessary if you are trying to create a new virtual machine with a similar configuration, rather than an exact copy. It is also possible to use a snapshot to create a sealed template cleaned of unique data, and then create virtual machines from that template. A template can be created from a snapshot using the create template element instead of cloning.
Delete a snapshot
The following procedure describes how to delete the snapshot through the management portal.
1. In the Virtual Machines tab, select the row of the virtual machine connected to the snapshot. Select the Snapshots tab at the bottom of the user interface. Select the photo you want to delete and press the Delete button.
2. A window labeled Delete Snapshot will open where you must confirm that you want to permanently delete the snapshot. If yes, press OK to delete the image.
3. On the Snapshot tab, verify that the snapshot is no longer displayed. Deleting the snapshot may take about a minute.
Related Tags:
ovirt delete snapshotred hat virtualization snapshotovirt restore snapshotlive snapshot,People also search for,Privacy settings,How Search works,ovirt delete snapshot,red hat virtualization snapshot,ovirt restore snapshot,live snapshot