Solved

Vmware Swap file

Posted on 2014-02-23
5
733 Views
Last Modified: 2014-03-10
per vmware  whenever a VM is powered on , it creates a swap file with the same size as the dedicated RAM, and if it has memory reservation, then the swap file will be equal to Dediated RAM minus size of reserved RAM.

can someone explain the latter (why when there is memory reserved, the swap file will be smaller)?



Also I wonder if this swap file gets automatically removed without powering off the VM, seeing that VMs swap files can take a lot of disk space, if many of them are powered on.
by the way, is swap file the same as windows memory page (temporary memory)?

i
Thanks
0
Comment
Question by:jskfan
  • 2
  • 2
5 Comments
 
LVL 119

Assisted Solution

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Andrew Hancock (VMware vExpert / EE MVE^2) earned 250 total points
ID: 39880916
Because that is the guaranteed size of memory which is required to start the VM, as you have defined by RESERVING the Memory requirement.

a virtual machine is configured with a reservation then the swap file will be an empty file with the size of (virtual machine memory configuration – VM memory reservation). e.g. , an 8GB virtual machine is configured with a 1024MB memory reservation, the size of the swap file will be 7168MB.

If the VM is Powered OFF, the SWAP file is removed, from the datastore, it's not required.

Remember this SWAP file is emprty, and only EVER used, if there is memory contention on the host, e.g. Host runs out our memory, and the VMs will then swap to disk!

If this happens performance will be poor, never let the host run out of memory.
0
 

Author Comment

by:jskfan
ID: 39881108
<<>Remember this SWAP file is emprty, and only EVER used, if there is memory contention on the host, e.g. Host runs out our memory, and the VMs will then swap to disk!>

even if it is empty , it will count on the capacity of datastore?

for instance if there is 2 GB disk space free on datastore and you power up a VM that has 4GB of RAM provisioned, VMware will not let it power on.
0
 
LVL 119
ID: 39881135
Correct, the space is allocated, but it's empty!

and it does not contain any zeros, or zeroed out!

see here......

http://frankdenneman.nl/2012/11/14/alternative-vm-swap-file-locations-qa/

for instance if there is 2 GB disk space free on datastore and you power up a VM that has 4GB of RAM provisioned, VMware will not let it power on.

correct, because the hypervisor, cannot create the swap file, because you have no storage space.
0
 
LVL 13

Accepted Solution

by:
Abhilash earned 250 total points
ID: 39882415
A swap file is always created when the VM is powered on.
Remember that Swap space = Allocated memory- reserved memory.
It is needed only when the VM runs out of memory and it is the last step VMKernel takes after trying Transparent page Sharing, memory compression and Ballooning.
This is to ensure that guest does not run out of memory.
The swapping causes a high performance degradation so always avoid it.

<<Also I wonder if this swap file gets automatically removed without powering off the VM, seeing that VMs swap files can take a lot of disk space, if many of them are powered on.
by the way, is swap file the same as windows memory page (temporary memory)?>>

Yes swap file goes off when you power off the machine.
As you have already mentioned. If you have enough RAm you can reserve the memory so swap file creation does not take place.

Windows paging is controlled by OS. And happens on the disk assigned to VM. The swapping to the swap file is controlled by kernel and it is triggered by kernel only when it runs out of memory.
They are totally different from one another.
0
 

Author Closing Comment

by:jskfan
ID: 39918755
Thank you Guys!
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Esxi management service 10 64
How do I use a wireless dongle on a VMWare host? 22 65
Same network with one NIC each in VMware 6 51
VM delta disk 2 18
If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question