Orphaned vmdk’s

While doing a “mini-healthcheck” at a customer site I noticed a specific Datastore with less than 2% of free diskspace. After a bit of research an orphaned VMDK was found. Orphaned vmdk’s are virtual hard-disks that are not connected to a VM. Probably because they were removed from the inventory without deleting the files.

You can easily find these orphaned vmdk’s via the Service Console:

find -iname “*-flat.vmdk” -mtime +7

For those that don’t like using the Service Console you can also check this with Powershell Ad van Bokhoven created a nice script which he describes as follows:

This script asks the virtual center what the disk are of each VM and puts this into an array. After this, it reads all files on all datastores. If the file is a vmdk file, it will check wheter this file is in the array. If it’s not, you’ve found a orphaned vmd.

I would advise to regularly check your environment on orphaned disks, it can save precious diskspace.




You can skip to the end and leave a response. Pinging is currently not allowed.

13 Responses to “Orphaned vmdk’s”

  1. Arnim says:

    If you have multiple clusters you can use plink.exe to execute this script on each cluster and redirect output to a file. You can also schedule this task if you like.

  2. mpoore says:

    I was going to work out how to do this today. It’s like you read my mind. Thank you.

  3. You can use plink indeed… or just the powershell script.

  4. Garry says:

    find -iname “*-flat.vmdk” -mtime +7

    This could find some valid vmdk from VMs that haven’t been power on in a week,doesn’t it?

  5. Duncan says:

    that’s correct, you will need to verify the list. but it’s a good indication.

  6. Garry says:

    Yes, anyway, that command is a VERY good indication

  7. ToddH says:

    What should I see for an output? When I run the command on all our ESX Hosts I am dropped back to #.

  8. Duncan says:

    No result means no orphaned vmdk’s!

  9. ToddH says:

    Great — then call me “lucky”.

  10. bsr says:

    Hai,

    I want find the vmdk files alignment status from one of my cluster environment. The cluster having 110 VMs. So how can i find the all VMDK file alignment status from virtual center console .

    If any share this its great help …..

    Thanks & Regards,
    BSR Krishna

  11. bsr says:

    How to check the un aligned vmdk status from virtual center console

  12. bsr says:

    How to check the un aligned multiple vmdk status from a data store .

  13. bsr says:

    How to check the un aligned multiple vmdk status from a data store and Virtual center console

    Rgds,
    BSR

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!