VMware Cloud Community
vmhyperv
Contributor
Contributor
Jump to solution

Finding inactive VM/vmdk in datastore

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

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
nielse
Expert
Expert
Jump to solution

After connecting to vCenter via the tool you can see the list in the "vHealth" tab.

@nielsengelen - http://foonet.be - VCP4/5

View solution in original post

Reply
0 Kudos
15 Replies
nielse
Expert
Expert
Jump to solution

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.

@nielsengelen - http://foonet.be - VCP4/5
LucD
Leadership
Leadership
Jump to solution

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

vmhyperv
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
nielse
Expert
Expert
Jump to solution

After connecting to vCenter via the tool you can see the list in the "vHealth" tab.

@nielsengelen - http://foonet.be - VCP4/5
Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure, file attached


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

Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

Thanks !! LucD

I will go through your blog.

thanks

vmguy

Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

LucD,

  Can we find the last modified Date for Orphaned vmdk file and size in GB.As

Thanks

vmguy

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try this version


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

Reply
0 Kudos
vmhyperv
Contributor
Contributor
Jump to solution

Thanks !! can this be more faster  as i tried the earlier one which was taking long time to query.

thanks

vmguy

Reply
0 Kudos