Configure swapping for virtualized Windows guests under KVM

1

I’m setting up a server at home with Ubuntu and KVM running a number of Windows guests. The host OS and swap reside on an SSD while the VMs are placed on a zraid2 storage volume on mechanical disks. The host has 32GB RAM and I want to be prepared for committing (or overcommitting) a lot of RAM to the VMs.

Should I set up the Windows guests without pagefiles and instead let the host’s virtual memory take care of this in one large swap partition?

Or is it better to configure each Windows guest with its own pagefile? Possibly mount these pagefiles on the SSD?

mikewse

Posted 2016-08-11T16:24:12.963

Reputation: 135

Answers

0

This is probably a better question for Server Fault, but...

Set up the host with a pagefile on the SSD as big as you plan to overcommit. Then set up each Windows VM with the main OS partition (C:) with Windows Managed pagefile and set all the other disks pagefile to off.

NotoriousPyro

Posted 2016-08-11T16:24:12.963

Reputation: 101

Big thanks for sharing your experience! Just to check that I understand you correctly; the VMs' swap on their respective C: will reside inside their VM disk files on the zraid2 disk volume, right? It'd be great if you would like to share the reasoning (pros/cons) behind your choice :-) – mikewse – 2017-07-13T20:16:56.327

I read it here. It is my understanding by the 3rd paragraph, underneath important, that this means memory is assigned as part of the host process. Swap file is part of that memory and as long as you have the drivers then this should be exposed to the host so the host decides what happens.

– NotoriousPyro – 2017-07-14T08:34:24.023

In fact I'm lying. I tried it myself and created some raw disk images on each VM, on different SSDs, with cache set to none/unsafe and it performs better. – NotoriousPyro – 2017-07-14T10:37:57.190