Our previous article looked at Hyper-V Server backups, and the differences between full server and guest only backups. In this article, we take a closer look at how to make a Hyper-V guest only backup.
Selecting the right data when doing a guest only backup is important because you need to ensure that you are backing up the guestâ€™s VHDs as well as their configuration file, which may be on different volumes.
For this reason, understanding the data Selections step is the key to creating guest only backups.
The Selections screen
When creating a Hyper-V backup, the Selections screen is the first and the most important step. So letâ€™s take a close look at what the different parts of the Selections screen are for, and what you should select for a guest only backup job.
Microsoft Hyper-V VSS
This part of the Selections screen displays the Hyper-V guests on the server. Selecting a guest in the left pane will display the data required to back up that guest in the right pane. The data displayed will be the guestâ€™s VHD and configuration file/s.
In the example below, guest TECH-SRV212R2 has been highlighted and reveals that data on two different volumes is required to back up the guest.
The data required is as follows:
- The guestâ€™s VHDX image file, which is on the E:\ drive.
- The guestâ€™s XML configuration file, which is on the C:\ drive.
Windows Server 2012 R1 and later, allows you to use either VHD or VHDX.
As we will explain later in this article, the VHD and XML files of each guest to be backed up should be on the same volume, and that volume should only contain data that is to be backed up.
This part of the Selections screen displays the volume(s) that Windows Server is installed on.
Note: You must select Critical Volumes if you want to be able to use the backup for a bare metal recovery.
Data and backup volumes
This part of the Selections screen displays the volumes that contain the guest VHDs. The VHD files (or virtual hard disk files) contain the virtual machineâ€™s operating system, applications and data.
The guestsâ€™ files should have their own volume and that volume should not contain system files, such as the physical serverâ€™s swap file. This is important for performance and to remove conflicts.Â As we will explain later in this article, dedicated guest volumes are also important if you want to create guest only backups.
Full VSS mode and Copy VSS mode
Selecting Full VSS mode means that VSS will clean up log files in the guest after the backup has been created. For example, the logs of an Exchange Server on a guest. If Copy VSS mode is selected, VSS will not perform a post backup cleanup and the size of logs will continue to grow and take up disk space.
Guest volume configurations
The TECH-SRV212R2 example above shows guest VHDX and XML files on different volumes. This is not an ideal configuration but it does illustrate the importance of where guest data is stored. The separation of VHD and XML files occurs when only the guest VHD is configured for a different volume.
VHD and XML files often end up on separate volumes because:
- One of the first steps in creating a Hyper-V virtual machine, the Specify Name and Location step, determines the virtual machineâ€™s location, which defaults to the local system volume in C:\Program files\Microsoft\Windows\Hyper-V. It is common for this default to be accepted.Â Later in the Connect Virtual Hard disk step, you specify the virtual machineâ€™s storage and where the VHD will go. If you select a different volume to the host, the VHD will be stored on a different volume but the XML files will still be stored on the system volume. This will result in the guestâ€™s VHD and configuration files being on separate volumes.
- We have also found that some administrators select the default local system volume on both steps and configure the virtual machineâ€™s VHD for a different volume after it has been created. This will also leave the configuration files on the system volume.
We recommended configuring the guests so that their VHD and configuration files are on the same volume. To do this, the volume where the guest is to be stored should be selected in both steps – Specify Name and Location and Connect Virtual Hard disk.
It is also important to note that the guests to be backed up should not share a volume with data that is not to be backed up.
In the following sections, we will explain why these recommended configurations are important.
How to select Hyper-VÂ guests
Guests must be selected under Microsoft Hyper-V VSS as follows:
- To select all of the guests, tick the box next toÂ Microsoft Hyper-V VSS.
- To select some of the guest, tick the box next to the guest in the Microsoft Hyper-V VSS list.
Selecting any guest will select the volume that contains the guestâ€™s VHD and volume that contains the guestâ€™s configuration file(s). In a best practice configuration, the VHD and configuration files will be on the same volume.
The host component folder under Microsoft Hyper-V VSS does not need to be selected, because the whole volume has been selected.
Note: If you do not select the guests using the Hyper-V Serverâ€™s VSS section, BackupAssist will not be able to restore the guest and the VSS writer will not be able to make an application-consistent backup of the guest and any VSS applications inside it.
Note: You can restore a guest without its configuration file(s) by creating a new guest and using a backup of a guestâ€™s VHD. However, you still need to configure the backup job correctly using the Hyper-V Serverâ€™s VSS section so that the backup is application-consistent.
Using the Hyper-V Serverâ€™s VSS section, ensures that both the guest VHD and configuration files are included in the backup.
If the guest volume contains data that you do not want to back up, you can exclude that data using the process described in the next section.
To learn more about VSS and application-consistent backups, see our VSS resource page.
How to exclude non guest data
When you tick a guest in the Selections screen under Microsoft Hyper-V VSS, both the volume containing the guest VHD and the volume containing the guestâ€™s configuration file(s) will be selected.
The entire volume is selected because the backup job does not know what backup destination you are using. Some backup destinations (like RDX) do not support individual file backups, which means they cannot be used to back up just the guest VHD and configuration file(s).
Destinations that support VSS:
- Removable drives. For example an external USB drive.
- A local drive.
- A network location. For example an iSCSI Target, network share or a NAS device using a Data container.
- An RDX drive using a data container.
If your backup destination supports VSS, you can de-select the data you donâ€™t need AFTER the backup job has been created. Ideally, the guest volume will only contain guests to be backed up so the whole volume can be selected.
DO NOT use the Selections screen to de-select data.
How to select guest only data
A best practice guest backup job will back up a full volume that contains the guestsâ€™ VHDs and configuration files, and the volume will not contain data that is not to be backed up.Â Backing up a full volume (rather than selected files) is faster, more efficient and stores more backup history.
If you have data on the guest volume that you do not want to backup, or guest data on the system volume, you can deselect data after the backup job has been created, as long as the backup destination supports VSS.
De-select data as follows:
- Open the BackupAssist Manage
- Select the backup job.
- Select Files and Applications from the left menu.
- De-select the volumes under Critical Volumes and Data and Backup Volumes.
- The guest selections under Microsoft Hyper-V VSS will stay selected.
- Select Apply changes and the guest only selection will be saved.
Partially selected guest volumes
If you only selected some of the guests on the volume and have Full VSS Mode selected, you will receive an Implicit Selections Warning when you save the changes. This warning appears because VSS thinks the whole volume is being backed up, and may therefore clean up the logs of all guests on the volume, even guests that are not backed up. This could result in a VSS application losing data (truncating logs) on guests that were not backed up, and lead to a loss of data on those guests.
If you select Ignore to the warning message, the additional guestsâ€™ host data will be added to the backup so that the relevant guests are be backed up before data is lost.
Selecting Copy VSS Mode means that only your selections will be backed up and VSS applications will not clean up any data, so no data loss will occur. At least one Full VSS Mode backup must be performed on a regular basis, otherwise old data like Exchange log files will never be cleaned up.
To learn more, see our Hyper-V best practices article.