I came across a few issues while doing some scripting work related VHDShellExt project. In this series, I will list a few issues I found around differencing disk usage.
First one: Adding differencing disk as a new VHD to an existing VM
If that section title is too complex to understand, here is the step-by-step of what I tried. One assumption: You have integration components installed inside the guest OS.
- Right-click on a VM and select settings
- Select “IDE Controller 0”, select “Hard drive” on right pane and click “Add”
- In the subsequent window, click on “New”
- In the “New Virtual Hard disk” wizard, select “differencing disk” and click “next”
- Give it a name and location and click “Next”
- On the “configure Disk” screen, click on “Browse”, locate the VHD connected to this VM and click on “Open”
- Click “Finish”
Now, when you try to power-on this virtual machine, you will see a nice error message like below
Now, let us try one more experiment. Let us remove the previously attached differencing VHD from the IDE controller and attach it to a SCSI controller. Now, try powering-on the virtual machine. In this scenario also, you will see a very similar message as above.
The reason behind these errors is simple. You cannot have the parent and child VHDs attached to the virtual machine at the same time. When you have a differencing disk, remove the parent VHD from the VM settings and try booting. It works.!
However, that is not the real technical explanation. When you try to mount a differencing VHD, it’s parent gets auto-mounted. Similarly — when you connect both Parent VHD and it’s child to the same VM — during VM initialization, both VHDs get initialized and are now “in use”. So, when you try booting from the differencing VHD now, it is not possible because the VHD is already in use. That is it…!