VMware vSphere

 View Only
  • 1.  VM .vswp files

    Posted Oct 02, 2013 08:00 AM

    Hello All, Good Day to you!

    In my customer environment, we have a 100GB LUN specified solely for swapping. However it is now full, with only 322 MB remaining - and right now it doesn't allow any host vMotion saying that there isn't enough free space. When I browse the relevant data store I can see a lot of .vswp files ans some .swp files ( I am attching the data store ). As far as I know  a VM seperates out for itself a capacity equal to it's guest memory size on the swap space. What would be the best way to figure out which .vswp files are not required, and which are ? I can easily expand this LUN on the VNX, but would that be god administering - anyways on the LUN properties, I can see that it is only using 4+% - How does that figure with what is told me in the VMware front ( I would be asking this in an EMC forum seperately ) ?

    Basically is there any adminstration guide with regards to virtual memory usage in VMware ?  Or should I simply expand the LUN and add the expanded capacity on the VMware side ? What is the difference between vmx-XXXX.vswp, XXXX.vswp and sysswp-xyz.swp , where XXXX presents VMname ?

    Regards,

    Naleendra



  • 2.  RE: VM .vswp files

    Posted Oct 02, 2013 09:07 AM

    Hi,

    Horrible i know but it depends on the configuration of your hosts.

    From that i mean how much many VM's are you running per host? how "over-subscribed" for memory are they ? eg have you got 200gb RAM total memory assigned to VM's but there is 150gb RAM total on your host? if they aren't over-subscribed you could set a reservation on your VM's to assign them their total memory that way you can reduce essentially to nothing your vswp file



  • 3.  RE: VM .vswp files

    Posted Oct 02, 2013 09:11 AM

    You should know that swap files are created by a virtual machines when they are powered on. The swap file size is always Allocated memory - reserved memory.

    If you have a VM with 4GB of memory and yo don't have any memory reserved for it then the swap file size would be 4GB. But if you have a VM with 4GB allocated memory and 2GB is reserved for it then swap file size would be 2GB.

    None of the swap files are actually required until the machine is running out of memory after which it will start swapping from swap file.

    You can't delete the swap file when the VM is running. If you want these files not to pile up next time. You could make allocated and reserved memory same for VM's so swap file is not created. But thats not a good idea coz you will not be able to over committ memory.

    What you can do now is increase the datastore size and make it thin provisioned on storage side. So you will know even though you overcommitt you will not be using all the space that is allocated. As you mention the usage is just 4+%. You could expand the LUN. that's how you can get rid of this situation.




  • 4.  RE: VM .vswp files

    Posted Oct 02, 2013 09:28 AM


    Would you know what would be the difference between vmx-XXXX.vswp, XXXX.vswp and sysswp-xyz.swp , where XXXX presents VMname ?



  • 5.  RE: VM .vswp files

    Posted Oct 02, 2013 09:39 AM


  • 6.  RE: VM .vswp files

    Posted Oct 02, 2013 09:33 AM

    What is the difference between vmx-XXXX.vswp, XXXX.vswp and sysswp-xyz.swp , where XXXX presents VMname ?

    The smaller vmx-xxx.vswp that are typically somewhere between ~64-256 MiB in size (depends on number of vCPUs, VM memory size, 32/64 bit Guest OS etc.) are overhead swap files for the VMX-process that is executing the VM on the host. This is unrelated to the actual VM memory swap files. Read more about this type of swap files here:

    http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.vsphere.resmgmt.doc%2FGUID-51767DC5-9A03-4B41-A385-9A11F6BD36F1.html

    The XXXX.vswp files are VM memory swap files. The disk space space consumed by these files is calculated as (configured VM memory size - VM reserved memory). The files are created on power-on and removed when a VM enters the powered-off state.

    I have no idea what these sysSwap-hls-xxx files are and don't remember seeing those anywhere.

    To get around your current problem you can:

    - Expand the LUN and datastore as you suggested

    - Try to temporarily reserve all memory for one or more VMs. I'm not sure if this is effective immediately and sets their memory swap files to 0 on the fly though.

    - Temporarily power-off one or more VMs. This will remove the memory (and vmx) swap file of this VM and re-create them when the VM is powered-on again

    I would size my swap disk according to something like ((total configured VM memory + (#VMs * 128 MiB)) + 20%). I personally would not take reserved memory into account in this case. Also keep in mind that if your environment grows in memory capacity and VMs, your swap disks will have to grow eventually too.

    anyways on the LUN properties, I can see that it is only using 4+% - How does that figure with what is told me in the VMware front ( I would be asking this in an EMC forum seperately ) ?

    This is because the larger VM memory swap files are usually only empty files reserving the space in case it's needed. Nothing is actually written to them unless your hosts are actively swapping VM memory to disk, which is something you usually want to avoid at any cost.

    So if you thin-provisioned this LUN, you should not see a lot of space being actually allocated from the SAN side.