VMware Cloud Community
TIANZAN
Enthusiast
Enthusiast

Basic doubt with moving vswap file

Hi, Noobie here. I joined a new job and inherited a Vcenter Server 6 setup.
There are multiple datastores and one is having around 5 GB space and is filling up fast. So I need to make space in few days max.
I checked the data store and found a folder which contain a 300gb VMDK file and 32 GB .VWSP file.
I think these are Disk and Ram SWAP files for some VM. I checked in settings of each VM and cannot find this VMDK attached to any of them.
Does that mean that it is a zombie file and I can safely move/delete it?

If incase I moved the VMDK or VSWP file to some other datastore with space, and found out that some VM are not working after the move, What shall I do? Is just moving that file back to the same folder gonna work? Or do I have to edit some configuration somewhere before it will identify it again and continue working?

9 Replies
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the vSphere area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

How do the names of the files compare to the names of all of your VMs?

A VSWP file is only present when a VM is powered on, and is by default the same size as the memory allocated to the VM it belongs to, so which of your VMs have a 32GB memory allocation?

Might there be VMs outside of the scope of your vCenter Server? For example another ESXi host which is not managed by that vCenter Server which has access to the datastore where you see these files?

When were the files last used?


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
TIANZAN
Enthusiast
Enthusiast

Hi Scott,

Thanks for the suggestion. I checked and 4 VMs have 32 GB Ram. But I went into the path mentioned in settings for disks and I can find their VMDK and VSWP ( around 32 GB) there.

Last modified date for VMDK is 23/10/2016 and for VSWP file it is 02/01/2017.

I just noticed that the vswp file may not exactly be that. Cos its name is SQL-Server -8ab6f3e9.vswp.28422

So its extension ends in 28422. Any way to ascertain if its still in use?

Reply
0 Kudos
TIANZAN
Enthusiast
Enthusiast

Name of the vmdk is SQL Server_3.vmdk.  But we dont have any VMs called SQL Server or SQL Server_3.  As I recently joined I am not sure if they had one with that name long back.

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

From what you've said it sounds more likely that these are orphaned files.

You could use this script to check if the VMDK is indeed orphaned: https://www.lucd.info/2016/09/13/orphaned-files-revisited/

You could also check for locks on the files: How To Identify The VMware Virtual Machine File Locks | TechCrumble


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
TIANZAN
Enthusiast
Enthusiast

Would it be ok if I move the .vswp file to some other datastore, and incase something does fail, Just move it back? Would it work?

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

If the files are locked you won't be able to move them anyway.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Kassadin
Contributor
Contributor

Hello,

You can search vmdk pointers in all vmx files automatically with following script:

find /vmfs/volumes/* -name *.vmx -exec grep -Hi <name-of-the-file.vmdk> {} \;

TIANZAN
Enthusiast
Enthusiast

I haven't yet found the courage to try to move the file to another datastore. Thought I will read a bit more before I do.
Just found this article https://vmice.net/2012/07/vm-swapfiles-leftover-swapfiles/
I see many places mention .vswp.xxxxx (where x is a number) to be created after an esxi crash.
But in all examples they mention another additional new .vswp file with no number extension. In that case we can infer that this new .vswp file without the number extension is the one in use.
In my case though this folder has only two files that is this 315 gb .vmdk file and 32 GB .vswp.28422 file. Has anybody any previous experience with this .vswp.number files? Any chance that they are in use?

Reply
0 Kudos