Set Pagefile to other drive fails – Hyper-V

Takeaway

Pagefiles in Hyper-V VMs can only be placed on Virtual IDE disks, not on Virtual SCSI disks.

IDE?  SCSI?

A not-so-well-known “feature” within Hyper-V VM’s is the fact that the disk with the boot/OS parttion in a Hyper-V VM always needs to be connected to a Virtual IDE controller.

This has to do with the fact that the IDE Controller is natively supported in Windows, so no special drivers need to be loaded first.

The virtual SCSI controller however, requires a driver which is provided by the Hyper-V Integration Services. This driver is loaded later in the boot sequence, so the OS partition cannot boot from a SCSI virtual disk.

Pagefile

Another thing that is very hard to find, is that the Pagefile (swapfile) in a Windows VM can ONLY be located on a (virtual)  IDE disk.

Or, to be more precise, the Virtual Disk on which the pagefile is located, needs to be attached to a virtual IDE Controller in the properties of the VM.

Usually, this is not a problem, because by default Windows manages the Pagefile size and location by itself, thereby locating it on the systemdrive, which in Hyper-V will allways be attached to an IDE controller.

The Problem

The problem however, comes when you manually want to configure the pagefile to move it to a different partition/disk.

This might be the case when your systemdrive has filled up to a point where you’re in need of more space on it.

If the partition/disk where you want to move your pagefile to is attached to a Virtual SCSI controller, things get messy.

The Windows OS in the VM will not give you any warnings about this, and just tell you to reboot the VM for the changes to take effect.

However, when you reboot the machine, you will find that the pagefile simply has not been created on the SCSI drive.

If you have also set the pagefile to a very small size on the systemdrive, you might get warnings about an incorrectly set pagefile-size.

Workaround

So, what can you do to move the pagefile to another disk/partition in a Hyper-V VM?

Option 1: Add a new IDE disk for the Pagefile

Shut down the VM.

Create a new virtual disk, attached to a virtual IDE Controller.

Size the disk according to your pagefile needs (IE for an 8 GB pagefile, create a 10 GB disk) . I would advise to use a fixed size disk, not an expanding one.

Boot the VM. Initialze the new disk in Disk Management, and create a partition on it.

Now change the pagefile settings, creating a fixed size pagefile on this new disk. Set the pagefile on your system drive to a small one, like 256 MB.

Option 2: Change the SCSI disk to an IDE disk

Another option is to simply modify your Virtual SCSI disk, to connect it to a Virtual IDE Controller.

With this, you basically turn your virtual SCSI disk into a virtual IDE disk

For this, a reboot is also required.

Performance

But wait, doesn’t a Virtual SCSI disk offer MUCH better performance then a virtual IDE disk?

When you use the Integration Components (like every sane Hyper-V user would) then the answer is No, no and no.

Or, as Technet states:

Although the I/O performance of physical SCSI and IDE devices can differ significantly, this is not true for the virtualized SCSI and IDE devices in Hyper-V. Hyper-V.

IDE and SCSI devices both offer equally fast I/O performance when integration services are installed in the guest operating system.

Further Reading:

Technet: Planning for Disks and Storage in Hyper-V

Ben Armstrong: Why Hyper-V cannot boot off SCSI disks (and why you should not care)

Advertisements

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: