Build a VM, snapshot it, break it, and restore it
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
- 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. - Inside the guest, write a file
/root/before.txtcontaining the current date, and install any small package. - Take a snapshot and name it
clean. Note the time and the space it consumed on the host. - Break the guest deliberately: as root, rename
/etc/fstaband remove the package you installed. Write a second file/root/after.txt. Reboot and observe what fails. - Revert to the
cleansnapshot. Confirm/root/before.txtexists,/root/after.txtdoes NOT, and the package is back. Record inlab/vm.txtthe 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.