The Hypothetical Scenario. Our small business server has 2x 400GB SSDs and 6 slower 7,200rpm SAS drives. We create a RAID1 array for the SSDs (henceforth Fast Disk) and a RAID10 array for the 6x SAS drives (henceforth Big Disk).
The latter is clearly fast as well. But
- Fast Disk is also Expensive Disk - every megabyte is precious
- We know our physical host system drive requirements will never increase beyond about 50GB, as it was purchased with one destiny in mind: to run Hyper-V (we are around to ensure this remains the case)
- Therefore to best utilise Fast Disk we favour storing some fixed size VHDXs on the SSDs.
(It would be ideal, of course, to avoid storing any virtual disks on our host's C:\ drive, but this hypothetical world in which we find ourselves is strangely devoid of logic and our customer or boss has expressed that she doesn't have unlimited funds for their servers. Nothing like our real world; please use your imagination.)
The Hypothetical Solution. The physical server has 128GB of RAM, and we know that if we allocate much of this to our virtual machines, and opt to enable "Save state", Hyper-V will create large BIN files.
Of course, we don't want these 30-40GB files to take up our precious Fast Disk, so we set the default location for virtual machines as the Big Disk, safe in the knowledge that these BIN files will be stored here. Our Virtual Machines therefore have configuration files and VHDXs dedicated to user data on Big Disk, and VHDXs dedicated to guest system drives on Fast Disk.
The Question. Assuming we would prefer to keep Save State enabled, i.e. we do not wish to get rid of the BIN files altogether, will there be a performance hit in having these stored on a different disk? What actually happens when Hyper-V saves state? Does it dump the whole contents of memory into that file? Or was it already there waiting? Or does some other clever black magic / optimisation take place behind the scenes to make this process happen quickly?
It dumps all of memory at the moment that you save. No I/O will occur while the VM is running. You're safe putting that file on relatively slow media.
In general, the media just needs to be able to save the VM fast enough that your host reboot, or power off due because you're running on battery backup, happens before some other problem develops.
On the other hand, I wouldn't ever recommend saving a VM in a production scenario. You'll power off most server workloads much more cleanly, and often more quickly, by shutting them down.