Link to home
Start Free TrialLog in
Avatar of danbrown_
danbrown_Flag for United States of America

asked on

Manually delete old .vswp files in ESXi 6.0?

Hello experts - I have a datastore which is low on space.  When browsing, I see a couple of large .vswp files with old dates on them.  Can they just be deleted while the VM is running without causing issues to the VM?
Avatar of Alex
Alex
Flag of United Kingdom of Great Britain and Northern Ireland image

Those are swap files, have you overprovisioned the memory on your hosts?
Avatar of danbrown_

ASKER

Yes, and the LUN I'm on doesn't have any room for expansion so I need to delete what I can.  Milking it until Jan when my new SAN comes in.
You'll not be able to delete them if they are in USE ?

They are used by virtual machines and usually deleted when the VM is powered off

Are you sure that the VM is not powered on and using them ?

VSWAP space (file) = Assigned Memory in the VM. (normally). When powered on, each VM will have one.

(the can be diverted to another datastore, but you need to change config and power off and power on)

Check no snapshots lurking around, and be careful because you should always have 20% storage free for vSWAP files and Snapshots... do not use all the allocation, other wise you'll not be able to power on all your VMs, with zero swap space!
I get that, but the date stamps on both files are 4/21/2017 and 2/12/2016.  Wouldn't they have current date stamps if they were currently in use?  Or does VMware just continually reuse the same files without updating the date?
As Andrew stated, if they are on and in use you can't remove them. Essentially having overprovisioned your memory, it'll need somewhere the VM can utilise in case the host actually runs out of memory.

Essentially, overprovisioning your memory this much isn't ideal, the VM will move anything it needs to, to this file for processing which is considerably slower than physical RAM. I'd say run something like RVTools, get a utilised memory count and then reduce the memory assigned to the VM if possible.

And no idea for that question unfortunately
So if the file is in use and I try to delete it I won't be able to since it would be locked, right?  So any harm that you can think of in trying it?
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys!
Date of the vSWAP file is in the PAST, when it was created, which was when the VM was powered up! (usually!)