This video will look at the configuration and data files that are used with HyperV. Having a good understanding of these files allows the administrator to backup and move the virtual machine and also help them decide which files can be removed if the size of the virtual machine needs to be reduced.
File Types Used with Hyper-V00:18 Hyper-V uses a number of different file types. These are used to store configuration and data for the virtual machine.
XML: XML files are used to store configuration files which contain information like the hardware for the virtual machines and also information is regards to the checkpoints of the virtual machines.
VHD and VHDX: VHD and VHDX are virtual hard disk file. They contain all the data from a since virtual disk in the virtual machine. VHDX is a newer standard and thus supports larger virtual hard disks then VHD. VHD is limited to just under 2 Gigabyte. VHDX also offer performance improvements over VHD files. VHD files will work with all versions of Hyper-V, however VHDX will required Windows 8 or Windows Server 2012 or above.
AVHD and AVHDX: When a checkpoint is created on a virtual machine, this file contains the information from the checkpoint. This information for example contains all hardware device information and memory contents. The AVHDX file is used with newer versions of Hyper-V.
BIN: This file is used to save the virtual machine memory when it is saved. Saving a virtual machine essentially stops the virtual machine. Later on, the virtual machine can be started again from where it left off. This is different from checkpoints in that there can be many checkpoints. BIN files are only used when the virtual machine is saved and do not effect performance. Checkpoint can have an effect on performance on the virtual machine.
VSV: These files are used to store virtual hardware information when the virtual machine is saved. So when a BIN file is created a VSV file will be created as well. The BIN and VSV file allow the virtual machine to continue where it left off when it was saved.
Demonstration
03:04 Open Hyper-V Manager.
3:14 Right click on the virtual machine and choose Export
3:50 Switch to Windows Explorer and navigate to the folder you exported the files to
4:02 Open the folder and there are 3 more folders, one called Snapshots that would contain snapshot files, one called Virtual Hard Disks that contains the VHD and VHDX files and a folder called Virtual Machines which contains the configuration files. The XML files there are named according to the GUID of the virtual machine.
4:38 To view the file type, select the View menu and then Options from the far right. Select the View tab and uncheck ‘Hide extensions for known file types’
5:52 Switch back to the virtual manager.
5:54 Right click on the virtual machine and select Checkpoint
6:22 Click on Hyper-V settings on the right hand panel
6:30 You can see the folder path where the files are stored.
6:34 Copy and paste the folder path into Windows Explorer
6:42 You will see the AVHDX files for the checkpoint. Each checkpoint will have a separate file
7:04 Go back to Hyper-V Manager and open Hyper-V settings again
7:13 Select the second option down, Virtual Machines. This shows the path to the virtual machine files
7:18 Copy and Paste the path into Windows Explorer
7:26 Open the Snapshots folder. The configuration file is stored here. If you go up a folder level and click on Virtual Machines, you will see the files containing the data. The configuration files and data files are kept in different directories
8:10 Go back to Virtual Machine Manager
8:14 Right click and select Delete on the first virtual machine.
8:24 Click OK to confirm Delete
8:30 Select Import Virtual Machine from the right hand side
8:39 Click Next
8:42 Browse to the folder location you exported the virtual machine to earlier and click Next
8:52 This screen summarizes which virtual machines are found, click Next
9:02 Select how to import the machine, whether you want to move the virtual machine files or not and if you want to duplicate the machine and click Next.
9:34 Decide where to store the virtual machine or leave it on the defaults and click Next
9:58 On next, I get an error saying the virtual machine already exists.
10:06 In order to import the machine, I need to remove the virtual hard drives. Even if the virtual machine configuration files are removed, the data remains.
10:38 Click on Finish to complete the import
10:54 The virtual machine now appears with the other virtual machines
11:04 Right click the virtual machine and click Pause
11:24 Navigate to the folder location in Windows Explorer and open up Virtual Machines
11:33 Open the GUID folder for the paused virtual machine.
11:42 You should see a BIN file the same size as the virtual memory assigned to it.
11:52 The VSV files below it contains the current state of the devices connected to the machine
Summary
12:14 By default Hyper-V virtual machine files are stored in “C:\ProgramData\Microsoft\Windows\Hyper-V”. This can be changed in required by the administrator. The main configuration file is XML. This file contains all the configuration for the virtual machine, which includes hardware and virtual hard disks that it may be using. This folder also contains the BIN and VSV files. These files are only created if the administrator pauses or saves the virtual machine. The second default folder that Hyper-V uses is “C:\users\Public\Documents\Hyper-V\Virtual Hard Disks”. This stores the virtual hard disk files and the checkpoint files. As the administrator, it is important to backup both these locations in order to ensure all the data from the virtual machine is recoverable.
References
“Installing and Configuring Windows Server 2012 R2 Exam Ref 70-410” pg 139-140
“Understanding where your virtual machine files are [Hyper-V]” http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/03/10/understanding-where-your-virtual-machine-files-are-hyper-v.aspx
“Registering a virtual machine with Hyper-V in Windows 8 / Windows Server 2012” http://blogs.msdn.com/b/virtual_pc_guy/archive/2012/06/26/registering-a-virtual-machine-with-hyper-v-in-windows-8-windows-server-2012.aspx
Credits
Voice Talent: HP Lewis http://hplewis.com
Video Production: Kevin Luttman http://www.KevinLuttman.com
Companion Document: Phil Townsend http://philtownsend.net
Quality Assurance: Edward M http://digitalmaru.com/