A. Before we talk about snapshots, you need to understand a type of virtual hard disk (VHD) called a differencing disk. A differencing disk is an additional VHD file that effectively sits on top of another VHD file and works with the existing VHD. Any write operations are written to the differencing disk, so that no changes are made to the existing VHD. Read operations are first checked against the differencing disk to see whether updated content was written to the differencing disk; if the content isn’t in the differencing disk, then the content is read from the additional VHD. This setup effectively freezes any changes to existing content by storing changes separately on the differencing disk.
Let’s start with a snapshot of an offline virtual machine (VM)—that is, a VM that’s turned off. When you take a snapshot of an offline VM, to avoid any changes to the existing VHD file, the snapshot process creates a differencing disk in a new subfolder of the VM’s Snapshots folder; the subfolder’s name includes the VM’s globally unique identifier (GUID). The name of the differencing disk includes the snapshot’s GUID and the extension .avhd. In addition, a copy of the current configuration is stored in the VM’s Snapshots folder; the configuration filename contains the snapshot’s GUID.
If the VM is running (i.e., online) when the snapshot is taken, two additional files are created in a Snapshots subfolder (named with the snapshot’s GUID) containing two files: a .bin file that contains the contents of the VM’s memory and a .vsv file that contains supporting process information, as the following screenshot shows.
This means that when you restore back to a snapshot’s state, not only the disk is restored to the previous point in time but also the VM’s memory and any processes that were supporting its operation. The next screenshot shows the memory and process content and the .avhd files used by the snapshots.
If you create additional snapshots, the process is exactly the same: A new .avhd file is created, which is a differencing file over the differencing file currently being used since the last snapshot. (A bit confusing, I know!) The following screenshot shows the new snapshot.
If you delete a snapshot, then Windows deletes memory and process files and rolls the content of any differencing disks into the preceding VHD the next time the VM is shut down.