Build a VM, snapshot it, break it, and restore it

short · 45 min · Objective 1.2

Task

Prove to yourself what a snapshot does and does not protect, by making a change you cannot undo any other way and then reverting it. The lesson claims a snapshot reverts EVERYTHING; this lab is how you find out that it means it.

Steps

  1. Create the guest and record its virtual hardware in lab/vm.txt: vCPU count, memory, disk size, disk provisioning mode (thick or thin), and the network mode.
  2. Inside the guest, write a file /root/before.txt containing the current date, and install any small package.
  3. Take a snapshot and name it clean. Note the time and the space it consumed on the host.
  4. Break the guest deliberately: as root, rename /etc/fstab and remove the package you installed. Write a second file /root/after.txt. Reboot and observe what fails.
  5. Revert to the clean snapshot. Confirm /root/before.txt exists, /root/after.txt does NOT, and the package is back. Record in lab/vm.txt the one sentence this proves about snapshot granularity.

Verify

grep -Eci 'thick|thin' lab/vm.txt
grep -Eci 'before.txt' lab/vm.txt
grep -Eci 'everything|all changes|granular' lab/vm.txt

All three must be non-zero. The third is the point of the lab: a revert is not a way to recover one file, because it takes back the ones you wanted too.

Notes

The disposable guest is the whole safety model here: it is a throwaway VM that holds nothing you need, and you snapshotted it before breaking it.

This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.