vmhyperv
Contributor
Contributor

Finding inactive VM/vmdk in datastore

Jump to solution

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)
0 Kudos
1 Solution

Accepted Solutions
nielse
Expert
Expert

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

0 Kudos
15 Replies
nielse
Expert
Expert

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

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

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

0 Kudos
vmhyperv
Contributor
Contributor

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

0 Kudos
nielse
Expert
Expert

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

0 Kudos
vmhyperv
Contributor
Contributor

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

0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
vmhyperv
Contributor
Contributor

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

0 Kudos
LucD
Leadership
Leadership

Sure, file attached


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

0 Kudos
vmhyperv
Contributor
Contributor

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

0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
vmhyperv
Contributor
Contributor

Thanks !! LucD

I will go through your blog.

thanks

vmguy

0 Kudos
vmhyperv
Contributor
Contributor

LucD,

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

Thanks

vmguy

0 Kudos
LucD
Leadership
Leadership

Try this version


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

0 Kudos
vmhyperv
Contributor
Contributor

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

thanks

vmguy

0 Kudos