VMware Cloud Community
iamamit
Enthusiast
Enthusiast

How to get report of unused VMDKs?

Guys, is there a way we can get report of unused VMDKs using any free tool or PowerCLI?

I am suspecting some of the virtual machines were removed from inventory a long back instead of deleting them from disk but not sure.

Thanks

Tags (1)
3 Replies
LucD
Leadership
Leadership

iamamit
Enthusiast
Enthusiast

I dont want to delete anything for now. I just need a report of such VMDKs.

Deletion is something, I will do manually.. Smiley Happy

Additionally, when I used the command "Get-VmwOrphan" I got the error  "The term 'Get-VmwOrphan' is not recognized as the name of a cmdlet,"

Thanks

0 Kudos
LucD
Leadership
Leadership

The script doesn't delete anything if you don't add the Delete switch, just reporting.

You have to place the function in a .ps1 file, then dot-source it.

. ./script.ps1

(note the blank between the two dots)

After thatyou will be able to call the function.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference