Recently, I had a rather simple demo for an audience that required me to have multiple systems running simultaneously and at different phases of a 2 hour migration to Windows 7. The original plan of attack was to use a single base image, Windows XP SP2, and create differencing disks for each of the 3 virtual machines. This is seemed to be the most reasonable approach.
In today’s post, I’m going to talk quickly about how I rather abruptly decided to get away from this model (single source, multiple differencing disks) and move to multiple sources using snapshots. There are most experts that would argue that this is splitting hairs (or tomato vs. tomatoe) as snapshots utilizes the same principles of differencing disks.
When moving to this model, I had to make duplicate copies of the original source VHD (also known as the parent) and then use the Edit Virtual Disk wizard to “merge” the differencing disks (including some snapshots) until I ended up with a single VHD.
Attributes of a Differencing Disk
The one thing that many might miss about differencing disks is that the source disk is marked by the system as Read-only. This is to avoid any “clobbering” of the file and causing all virtual machines based on the source from self-destructing. This little tid-bit of information can save a lot of your time when you are attempting to merge to the parent and the system (e.g. Hyper-V) believes there to be additional virtual machines to still be using this source disk. (This is my theory because I don’t know at what point Hyper-V removes the read-only attribute or if it ever does – I’m trying to follow up with folks internally to see if I can get an answer). I digress…
Checking Source Disk Attributes
For those not familiar, to check to verify that the Read-only attribute is not enabled, do the the following:
- Locate the source parent file (NOTE: Not the snapshot\child file)
- Right-click on the file, select Properties
If the Attribute for Read Only, un-check.
It is important to note that when using Snapshots the parent file does not have the Read-only attribute.
Ouch: General Access Denied Errors (0x8007005) during Merge
So here goes… you are attempting to merge your differencing disk to the parent when Hyper-V throws you a nice little error that says “General Access Denied” which leads most Admins to run to the file system directory and start reviewing the NTFS permissions. If you were like me, you didn’t panic at all and then checked the permissions. Wow, the permissions are fine and the panic sets in….
The first steps are to go through the process of merging…
- In Hyper-V Administrator Console, right-click on the Server and choose Edit Disk
- Locate the VHD\AVHD you wish to merge (e.g. d:\VM\MyTest.VHD)
- It will then ask you whether you would like to compact or merge…
- Select Merge
- Click Next
- Select to Merge with Parent
- Click Finish
…and then it Happens!
For protection, some folks set the source VHDs to read-only to avoid anyone using them incorrectly. As mentioned, I haven’t found a solid repro whereby the read-only attribute is done by the system (aka – Hyper-V\Windows) so for now I’m going to assume humans were involved in the conspiracy. Nonetheless, the general 8007005 error seems related to the inability of Hyper-V to merge the disks to a single file is the read-only for the source. This problem doesn’t occur when the merge takes place to another filename whereby Hyper-V copies the two files to a new file.
Remove the read-only and you are in business…