Fix Virtual Machine snapshot restore buttons are grayed out

Scenario

In this scenario, a Virtual Machine named exercise7 is currently in the Running state and has an existing snapshot the user wants to restore. However, the user has noticed that the snapshot’s buttons are grayed out, making it impossible to proceed with the restoration.

  • The button on Virtual Machine

01 restore button
  • The snapshot button

02 restore button

Your task is to investigate the steps taken by the user to restore the snapshot and resolve the issue.

The objective is to successfully restore the snapshot of the Virtual Machine exercise7.

The steps to fix exercise7 are:

Console

  1. Login to OpenShift console using the assigned user account.

Username
userx
Password
{password}
  1. Go to virtualization → Virtual Machines - select project for the assigned user account

07 break03
  1. Stop the exercise7 virtual machine

07 break04
  1. Click on exercise7 virtual machines and Snapshot tab.

07 break05
  1. On snapshot click Restore VirtualMachine from snapshot

07 break06
  1. Click Restore

07 break07
  1. Check the virtual machine snapshot has been restored.

07 break08
Run grade to validate the exercise
lab grade exercise7

Command line (CLI)

  1. Login to Openshift server API using the assigned user account with oc command if not logged in.

OpenShift login command
{login_command}
  1. Go to the assigned namespace-userx

oc project namespace-userx
  1. Stop the virtual machine exercise7

virtctl stop exercise7
VM exercise7 was scheduled to stop
  1. Restore the virtual machine snapshot. In the userx home directory there’s exercise7-restoresnapshot.yaml file. Check it.

cat /home/userx/exercise7-restoresnapshot.yaml
  1. Apply it

oc apply -f /home/userx/exercise7-restoresnapshot.yaml
virtualmachinerestore.snapshot.kubevirt.io/restore-exercise7-snapshot created
  1. Check that VirtualMachineRestore has been created

oc get VirtualMachineRestore restore-exercise7-snapshot \
-n namespace-userx
NAME                         TARGETKIND       TARGETNAME   COMPLETE   RESTORETIME   ERROR
restore-exercise7-snapshot   VirtualMachine   exercise7    true       38s

What you learned

In this exercise, you learned that restoring a snapshot of a virtual machine requires shutting it down, as KubeVirt does not support memory snapshots.