I recently ran into some issues streaming VMs and taking advantage of the local storage on the hypervisors for the local cache.
Many of these issues were due to my lack of experience with the product, so I am making notes here for future use.
First, if you are not familiar with Provisioning Server or have not taken a look at it for a few revisions, go download the latest version. There have been a lot of improvements since the last time I looked at it (a few years ago).
Cache on Device Hard Drive is actually from the PVS feature to stream to bare metal. In the VM world it allows me to use local storage that is relatively inexpensive (unless you use SSDs – but hey, just another possibility) and just fine when you don’t want to persist the cache disk.
Okay, enough of that, back to my cache disk issue notes.
Firstly, when you create your Template VM, be sure to create the local cache disk as its local drive.
Secondly, don’t forget to format this disk for your streamed OS. So, for Windows, format it NTFS (I am just booting the VM that will be my template to WinPE and using DiskPart to avoid ACLs.)
Third, make that cache disk large enough. This was my most perplexing puzzle and I fiddled for a couple days with this off and on.
When I booted the VM and login I would get this strange error message: “Windows created a temporary paging file on your computer”
This issue is specific to using the Cache on Device setting when your vDisk is set to shared mode. The root is that the default page file location cannot be written to as it is the shared vDisk image. The ancillary detail is that the page file gets moved to the device cache disk which is some drive other than %system%.
So, I had my local cache, all formatted, as small as it thought it needed to be. I booted my vDisk and the error. I set the vDisk to private mode and fiddled around with paging file settings. I went back to my template VM, booted in shared mode, no paging file.
I searched and found all kinds of related errors; moving it off C:, using a SCSI attached VHD instead of IDE (I happen to be using XenServer so this was not it), ACLs on files within the VHD, also obscure errors where the programs are expecting specific folders to exist on the cache disk. All of these are totally valid errors and entirely possible in their scenario, just not mine.
Very frustrating. It was when I booted with the VM template in private mode with the cache disk attached and I attempted to move the page file that I got a useful error: the destination is not large enough.
Duh! My device cache disk (the virtual disk of the VM) was not large enough for the caching of temporary files AND the page file of the VM operating system. So silly.
I went back and recreated my template VM, with a larger cache disk – taking into account any dynamic memory settings.
Once I made this larger VHD (formatted with Diskpart) and booted using private image mode with cache on device hard drive all was good.