In this exercise, you will create and restore virtual machine snapshots.
Outcomes
You should be able to:
Create a snapshot of a virtual machine.
Revert a virtual machine to an earlier state using a snapshot.
Log in to workstation as the student user with student as the password.
On workstation, run the lab snapimex-snapshots start command.
This command runs a start script that determines if the Red Hat Virtualization environment is configured and working.
[student@workstation ~]$lab snapimex-snapshots start
Create a snapshot of the rhel-vm1 virtual machine.
If there is more than one rhel-vm1 virtual machines, use the one located in clusterone.
Using the https://rhvm.lab.example.com URL log into the Administration Portal as admin with the internal profile.
Use redhat as the password.
In the menu, click , then .
Right-click the row for the rhel-vm1 virtual machine in the development data center, and then click Create Snapshot.
The Create Snapshot window displays.
Enter rhel-vm1-snapshot as a description for the snapshot in the Description field.
Verify that the rhel-vm1_Disk1 disk is selected in the Disks to include section.
Click to create the snapshot.
In Compute >> Virtual Machines, select the row for the rhel-vm1 virtual machine and click on the machine name.
Select Snapshots.
Click on the rhel-vm1-snapshot snapshot.
Click on General.
Verify that the value of the Status field is OK.
It may take up to a minute to create this snapshot.
Modify the Message of the Day (MOTD) on the rhel-vm1 virtual machine.
In the menu, click , then click on .
Highlight the row containing the rhel-vm1 virtual machine by clicking an empty cell in that row.
Click on to start the virtual machine.
Right-click the row for the rhel-vm1 virtual machine, and then select .
Accept the opening of the console.vv file using Remote Viewer by clicking the button.
When the warning box displays, click on .
Log into the rhel-vm1 virtual machine as root using redhat as the password.
Verify that the MOTD file for the rhel-vm1 virtual machine is empty.
[root@localhost ~]#cat /etc/motd[root@localhost ~]#
Modify /etc/motd to contain the string RHV managed virtual machine.
[root@localhost ~]#vi /etc/motdRHV managed virtual machine
Log out of rhel-vm1.
[root@localhost ~]#logout
Revert rhel-vm1 back to the rhel-vm1-snapshot snapshot.
In the menu, click , and then click on .
Highlight the row for the rhel-vm1 virtual machine by clicking on an empty cell, and then select .
The Shut down Virtual Machine(s) window displays.
Click to shut down rhel-vm1.
Verify that the value of the Status field for the rhel-vm1 virtual machine is Down.
You may need to scroll the virtual machine list window to the right.
It may take a few seconds for RHV-M to mark rhel-vm1 as Down.
Click on the name of the rhel-vm1 virtual machine.
A new window opens with the virtual machine configuration.
Click on the Snapshots tab.
Select the snapshot with the description rhel-vm1-snapshot.
Click the Preview drop-down menu and select .
The Custom Preview Snapshot window displays.
Select the radio button for the snapshot with the description rhel-vm1-snapshot.
Verify that the check box for the rhel-vm1_Disk1 disk is selected.
Click to revert rhel-vm to the rhel-vm-snapshot snapshot.
Click on at the top of the page.
In the row for the rhel-vm1, verify that the value of the Status field transitions from Image Locked to Down.
Click on the name of the rhel-vm1 virtual machine, and then click on Snapshots.
Click on the General menu for the rhel-vm1-snapshot.
Verify that the value of the Status field for the rhel-vm1-snapshot snapshot is IN_PREVIEW.
Click the button.
When the Commit Snapshot window displays, click on .
In the menu, click on Events.
Verify that the message Commiting a Snapshot-Preview for VM rhel-vm1 has been completed displays.
This confirms that RHV-M successfully restored the rhel-vm-snapshot snapshot in the rhel-vm virtual machine.
Verify that rhel-vm1 properly rolled back to the state in the rhel-vm1-snapshot snapshot.
In the menu, click , and then select .
Right-click the row for the rhel-vm1 virtual machine, and then select .
Verify that the value of the Status field for the rhel-vm1 virtual machine is Up.
It may take up to a minute for the rhel-vm virtual machine to start.
Right-click the row for the rhel-vm1 virtual machine, and then select .
Log in using root as the user and redhat as the password.
Using the cat command, verify that the MOTD for the rhel-vm1 virtual machine is empty.
[root@localhost ~]#cat /etc/motd[root@localhost ~]#
Log out of the rhel-vm1 virtual machine.
[root@localhost ~]#logout
Delete the rhel-vm1-snapshot snapshot.
In Virtual Machines, select the rhel-vm1 virtual machine by clicking on the name.
The rhel-vm1 virtual machine is in clusterone.
Go to Snapshots.
Select the rhel-vm1-snapshot snapshot.
Click .
The Delete Snapshot window displays.
Click .
Confirm that RHV-M removes the rhel-vm1-snapshot snapshot from the snapshot listing.
It may take up to a minute.