We're using Hyper-V Server 2008 R2 in a development/test environment, and using the differencing and snapshot features to run multiple VMs with several snapshots for each so we can rollback to previous states for install and version testing.
However, we've run into the commonly-reported issue of VMs going into the 'Paused' state due to lack of disk space. After reading-up on how this state comes about, I want to clarify my understanding of how Hyper-V allocates or reserves disk space for differencing disks and snapshots, so that we may correctly anticipate and size the storage of our Hyper-V testbeds.
Below are 3 scenarios involving disk setups and snapshots, and there is a common theme running through them all. Please forgive my redundancy.
Scenario A ---------- 1. The VM uses a default-sized 127 GB vhd 2. A snapshot is taken
Questions: ---------- - If I continue to operate with the snapshot present, does this mean that the 127 GB vhd is wasted, as no further writes to it may occur, yet Hyper-V has "reserved" 127 GB from my total storage space for the original vhd?
- Regarding the snapshot, will Hyper-V similarly reserve 127 GB of space for the snapshot to use? If so, if I then take another snapshot, does this mean that the first snapshot's 127 GB reservation has likewise been locked up, and now I have 250 GB of useless storage space on my host machine?
Scenario B ---------- 1. A 'base' VM uses a default-sized 127 GB vhd 2. Four 'differencing disk' VMs are attached to the base VM 3. Snapshots are taken of the four differencing disk VMs
Questions: ---------- - Is the 127 GB 'base' VM storage space no longer useable after the differencing VMs are created and attached? Has Hyper-V carved out 127 GB from my total storage space and I'm now that much closer to running out of disk space? Perhaps the 'base' machine should have been created with a minimal 16 GB vhd? - Will the differencing disks be dynamic and only take the space they need, or will Hyper-V reserve 127 GB for each of them? - If Hyper-V did reserved 127 GB of disk space for the differencing disks, then when a snapshot is made for each, will I be down 127 GB(base VM) + 4*127 GB(diff VMs) = 635 GB of storage space?
Scenario C ---------- 1. The VM uses a default-sized 127 GB vhd 2. A fixed-size vhd is created, with 127 GB of space, and attached to the VM 3. A snapshot is taken
Questions: ---------- - Assuming I don't delete the snapshot, do I now have 250 GB of wasted storage space on my Hyper-V host machine?