VMware Cloud Community
satheeshsatz
Enthusiast
Enthusiast

Find Orphaned Disks and Remove it

Hi,

I am looking for simple script to collect the Orphaned disks in my vcenter.

where my most of the VMs will have snapshots too, so need to get the report exclude of the snapshot disks.

i found from LuCD (Orphaned Files Revisited - LucD notes ) it is high advanced.

so please help me with simple method to collect the information.

Regards, Satheesh
Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership

What is the problem with running that function?

In the end it's nothing more than calling the function with parameter that indicates the datastore.


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

Reply
0 Kudos
satheeshsatz
Enthusiast
Enthusiast

HI LuCD,

Yes it shows perfectly, but i was thinking incase if snapshot is present on that VM, will it consider  that VM or not.

so only, i have decided to create with excluding that.

in that case, can you please help.

Regards, Satheesh
Reply
0 Kudos
LucD
Leadership
Leadership

The script uses the LayoutEx.File property to get the files that belong to a VM.

So even if there are multiple snapshots, all the files will be included, and hence not shown in the list of orphaned disks.


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

satheeshsatz
Enthusiast
Enthusiast

Thankyou!

so even if the vm is holding snapshot, report will show only the genuine orphaned disks right?

Regards, Satheesh
Reply
0 Kudos
LucD
Leadership
Leadership

That is correct.

But as always, make sure you know what you are doing before you start deleting files :smileygrin:


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

Reply
0 Kudos