How to: relocate Hyper-V VM smart paging file to another location

Just a how to post on how to relocate Hyper-V VM smart paging file to another location. Contrary to idea (from the past) of placing Paging File to a fast/dedicated storage idea with Smart Paging storage is to drop it to less expensive storage tier as it is only used for VMs startup, period.

For existing VM you can set SmartPaging file location using either Set-VM or Move-VMStorage cmdlets as well as Hyper-V manager GUI.

Set-VM example:

Set-VM Win7 -SmartPagingFilePath D:\

Move-VMStorage example:

Move-VMStorage "Win7" -SmartPagingFilePath F:\

Viewing/changing this option in Hyper-V manager GUI:

Hyper-V Smart Paging files location

In case you want to set the same SmartPaging File Location for all VMs on specific Hyper-V host you can pipe results from Get-VM to Set-VM cmdlet, see example below:

get-vm | set-vm -SmartPagingFilePath F:\SmartPaging

For those who wonder what is Hyper-V Smart Paging and how it is different from Paging File. Pagefile is a legacy Windows OS component left from the days when physical memory was super expensive (IMO it is expensive still, but in the past it was much worse 🙂 ). The idea was that hard disk storage space could be used to compensate for shortages of physical RAM and today the Windows Pagefile is also used to accommodate crash dump information.

Smart Paging is purely Hyper-V technology related with Dynamic Memory feature and Startup RAM setting. Hyper-V allows to maximize your host server RAM utilization allowing memory to be dynamically reallocated between VMs according to their current load. As you may guess your goal here is to maximize RAM utilization and avoid physical RAM over commitment at the same time. Giving the fact that very frequently VM boot requires more RAM than normal operations minimum RAM setting is accompanied with startup RAM setting which is normally set to be larger than Minimum RAM. It allows you to do “over commitment” of physical RAM on condition that VMs do not start simultaneously. On the other hand massive restart of VMs can cause something similar to “broadcast storm” from networking world for your Hyper-V host server RAM (I guess term “VM boot storm” is already coined 🙂 though not fully established). Smart Paging is safeguard measure which allows VM to boot, even if your physical RAM over committed – missing RAM can be allocated using Smart Paging feature on a specified disk drive. Unlike the Windows Pagefile the Smart Paging File is only used by the boot process.

To reiterate/better define Smart Paging:

Smart Paging ensures that the difference between minimum and startup memory is available using a temporary page file stored on the disk,

Poulton, Don; Camardella, David. MCSA 70-410 Cert Guide R2: Installing and Configuring Windows Server 2012 (Kindle Locations 15680-15681). Pearson Education. Kindle Edition.

4 Comments

  • Florisz says:

    I tried changing the smart paging file path of a VM(that was turned off) with all of the above options with the latest Hyper V version on Windows 10.\r\nAlthough the commands are successful and the GUI does show the new location. When the VM is started, it just keeps using the old file location…

    • Florisz says:

      Sorry I was confused with the configuration files. \r\nThe easiest way for moving parts of an VM is to use the GUI ‘move..’ option.\r\nIf set the checkmarkt for ‘Choose Move Options’ on the second option where you can specify, then you can specify for each part the new location.

  • Kevin Russell says:

    Very important note: If you don’t choose to move the ‘Current Configuration’ checkbox through the ‘Move..’ GUI command, the Smart Paging file will NOT move. I kept wondering why I couldn’t update this location and make it change drives – and when I finally included the ‘Current Configuration’ checkbox, low and behold the Smart Paging file moved instantly. Even with the Virtual Machine running – which was surprising.

    Guessing this might be by design – but curious why they don’t mention this or require you to move the Config if attempting to move the Smart Paging File.

    • DmitryAB says:

      Dear Kevin,

      Could you please to explane me where i must choose Current Configuration option… For example screenshot.

Leave a Reply

Your email address will not be published. Required fields are marked *