Hi Everyone,
We have in our environment users while decommisioning/deleting the vm from VI Client they deleted by removing the vm from Inventory rather than delete from Disk and due to this lot of VMDK still existing in data store folder unused.Is it possible to find the through powercli how many such VM/vmdk existing in the datastore folder which are not being used.Any help on this will be greatful. Thanks
vmguy
After connecting to vCenter via the tool you can see the list in the "vHealth" tab.
There is a doc about this which can be found here.
You could also try "RVTools". This tool can find orphaned and zombie vmdk's.
When you're looking for an automated way of doing this, you could try my script from Orphaned files and folders – Spring cleaning
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi,
I would like to say Thanks to both of you.But LucD i have question i need to find out such orphaned vmdk/vm and then need to compare to our internal DB to check when its was decommisioned and then delete it to avoid mistake.So is it possible to get list ? Many thanks !!
thanks
vmguy
Hi,
Can you tell me where in RV tools Tab it will show because i extracted it but no able to trace it.
thanks
vmguy
After connecting to vCenter via the tool you can see the list in the "vHealth" tab.
Hi LucD,
I am waiting for your reply.Is it possible to get the list of Orphaned vmdk or can we modify (Alan) vCheck script to list out Orphaned or zombie vmdk file with path in the data store. Thanks !!
Thanks
vmguy
You can easily list the paths.
Just call the function and export to a CSV file
Remove-OrphanedData | Export-Csv .\report.csv -NoTypeInformation -UseCulture
As long as you don't add the -Delete switch, the function will only list the orphaned files and folders.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Thanks for prompt reponse. Is it possible to list out full script with the modified line "Remove-OrphanedData | Export-Csv .\report.csv -NoTypeInformation -UseCulture"
Thanks
vmguy
Sure, file attached
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks !! LucD
Just to confirm it will not delete the Orphaned vmdk rather it will list out in csv format ?I want to delete after confirmation whether there was any change control raised for deleting vm (Decommission VM) but some how missedout.
thanks
vmguy
That is correct.
Read the Usage section on my blog post to see how the function can be used.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks !! LucD
I will go through your blog.
thanks
vmguy
LucD,
Can we find the last modified Date for Orphaned vmdk file and size in GB.As
Thanks
vmguy
Try this version
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks !! can this be more faster as i tried the earlier one which was taking long time to query.
thanks
vmguy