SENNAF1
Enthusiast
Enthusiast

Orphaned vmdk files

Hello all,

I have recently started in a new position and have a dilemma.   I know I have some .vmdk files that are orphaned but I don't know which ones.  Last week I came across a 250GB .vmdk in a shared datastore.  The modified date is from 7 months ago so I don’t think it is being used.   I have cross-referenced the file name to any VM name in vCenter and it is not connected to it anything close to what I searched for.   But I have found VMs connected to .vmdks with completely different names than the VM so I can not be sure if it is connected.

So my question, is there any way to find out what [if any] VMs are using this file without going to every .vmx file and looking manually?

Thanks,

0 Kudos
9 Replies
vmroyale
Immortal
Immortal

Hello.

The free RVTools (http://www.robware.net/) are very useful for identifying orphaned VMDKs.

Good Luck!

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
SENNAF1
Enthusiast
Enthusiast

This is a great tool and definitely a helpful answer.  Let me use it and get familiar with it to see if it gives me what I need.

Then I will give you a correct answer.

Thanks again I can really use this tool.

0 Kudos
UmeshAhuja
Commander
Commander

Hi,

Log into the ESX host terminal directly, or via SSH.

Run this command to search for all of the virtual machine configuration files seen by the ESX and check if there is a file which looks like the disk you are getting.

find /vmfs/volumes/ -iname "*.vmx" -exec grep -Hie "-*.vmdk" {} \;

Thanks n Regards
Umesh Ahuja

If your query resolved then please consider awarding points by correct or helpful marking.
0 Kudos
a_p_
Leadership
Leadership

The modified date is from 7 months ago so I don’t think it is being used.

This is no indication on whether a .vmdk file is being used or not. In case this .vmdk file in the a snapshot chain, the time stamp is the date/time when the following snapshot was created. Usually there are no orphaned .vmdk files on a datastore, except there was an issue which has been resolved manually.

To find out which files are currently in use, you need to either verify the snapshot chains (in case you have snapshots) or check the vmware.log files for your VMs. In any case, instead of deleting any files right away, first power off the VM then move the files - which you think are orphaned - to a sub-folder and try to power on the VM.

André

0 Kudos
SENNAF1
Enthusiast
Enthusiast

Andre’

Thanks for the reply but I don’t think you understand my problem.   I have inherited a mess in vCenter,  I have found some vmdk files I think are no longer attached to VMs.  I have also noticed that on my registered VMs the name of the vmdk file doesn’t match the VM name at all.  I am in a new position and am trying to cleanup my datastores.  Using the RVTool above I have found 17 vmdk files on my shared storage that may be zombies.   What I want is a way to find out if the .vmdk files are attached to a registered VM other than reviewing the logs or .vmx file for 400 VMs.    I am going to try Umesh’s string and cross that against the RVTool results.

-Vince-

0 Kudos
SENNAF1
Enthusiast
Enthusiast

The command isn't working because some of the vmx files are locked.  I assume this is because the VM is running.   I am able to "cat" the vmx and see the contents but can't get it to work in the string.

Any ideas?

Thanks again

0 Kudos
SENNAF1
Enthusiast
Enthusiast

I have run the tool and cross checked the Zombie vmdk files against the .vmx for all my VMs and it was correct that these are not used.

This is an excellent tool for me to keep in my arsenal.

Thanks for this

0 Kudos
foxy1977
Contributor
Contributor

Am I right in saying there is a third party tool available to do this type of thing.  I cannot remember for the life of me what it is called.  Anyone any ideas?

I need to do a reviwe of a couple of vmfs partitions and see if there's any space I can free up.

0 Kudos
continuum
Immortal
Immortal

just scroll a few posts up - and see Andres reply


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos