VMware vSphere

 View Only
  • 1.  Deleting orphan files and folders

    Posted Mar 24, 2016 12:23 PM

    On a datastore accessed via NFS from 4 ESXi 5.5 hosts members of a vSphere 5.5 infrastructure I see lots of "orphan" files and folders.

    Each folder name is related to a VM that either:

    • Does not exist anymore
    • Was moved to a different datastore

    Can I simply delete the folders (maybe after connecting to an ESXi host via WinSCP) or should I perform any additional check?

    What damage can I cause besides maybe damaging a given VM if the files are not really orphan?

    Is there any risk to damage the datastore itself?

    Regards

    Marius




  • 2.  RE: Deleting orphan files and folders

    Posted Mar 24, 2016 12:34 PM

    You should absolutely check! Do not just delete the files.

    Right click on the vm, select the hard disk option and get the datastore path.  Verify that either files do not exist, or that is is a true duplicate, then you can delete. Other wise a remove from inventory might be the action you need to take.

    The datastore is not at risk.

    Typically orphans are caused because a change was make directly with an ESX host vs. the vCenter. So the vCenter is unaware of the changes.



  • 3.  RE: Deleting orphan files and folders

    Posted Mar 29, 2016 01:34 AM

    Hi MariusRoma,

    It is completely safe to delete the orphaned files. If they are really being used by ESXi, it will not be possible to delete the files.



  • 4.  RE: Deleting orphan files and folders

    Posted Mar 29, 2016 11:53 AM

    > It is completely safe to delete the orphaned files. If they are really being used by ESXi, it will not be possible to delete the files.
    If the VMs are temporarily powered off this suggestion is not safe at all.
    In cases like this the safest approach is to create a directory "delete-me-next-monday" and move all possible orphaned files into the temp-directory and wait with the delete until you are really sure the files are not needed anymore.
    If a rarely used VM still needs the moved files they can easily be moved back to the original location.
    Undeleting them is way more work and in no way reliable.



  • 5.  RE: Deleting orphan files and folders

    Posted Mar 29, 2016 12:30 PM

    This is almost exactly the process that I use. I have several clients with EMC Networker and for the longest time, there was a VADP bug that caused snapshot delta files to not get unlocked and deleted. EMC spent like 6 months before they said "it's a bug, no fix ETA." Anyway, I had to clear 3-6 delta files a week. My method, while slow, is as safe as it gets. Storage vMotion and VMs out of the datastore until vSphere shows you zero VMs. Then go inside the datastore and add "(space)Delete(space)Me" to the folders of the remaining folders and then wait a day or two. The spaces in the folder name are important because it will break the folder. Do not just go pruning "orphaned" files without doing everything in your power to make sure they are unused.



  • 6.  RE: Deleting orphan files and folders

    Posted Mar 29, 2016 05:18 PM

    > The spaces in the folder name are important because it will break the folder.
    ? - can you explain this ?
    Whats the difference between renaming
    /vmfs/volumes/datastore/this-may-be-an-orphan to

    "/vmfs/volumes/datastore/this-may-be-an-orphan delete me"

    or just to
    "/vmfs/volumes/datastore/this-may-be-an-orphan-deleteme"



  • 7.  RE: Deleting orphan files and folders

    Posted Mar 29, 2016 05:44 PM

    "/vmfs/volumes/datastore/this-may-be-an-orphan delete me"

    This might just be old info that no longer applies but back in the ESX/GSX days(been working with VMware since I was in high school...so I've been through a lot of products) browsing the datastore and inserting a space anywhere in the name would make it inaccessible by virtual machines.

    I just always did that so they were easy to pick out of a crowd. You and I have the same logic regardless of the little differences.