VMware Cloud Community
Leffingwell
Contributor
Contributor

Orphaned Files

Greetings all !

I had stumbled across a post where LucD had created a script to add a 'remove-OrphanedData' commandlet to PS/PCLI.  The commandlet doesn't function for me.  This seems like an involved script - so I don't want to reinvent the wheel.

Does anyone have in house scripts/methods they use to scrape their environment for files/artifacts/folders - basically anything that doesn't specifically relate to VM's in inventory...

The ability to preview the list and then delete en masse would be preferable!  Pending no response - I'll look into doing this from scratch - looking forward to the communities response on this Smiley Happy

ALAN

0 Kudos
6 Replies
LucD
Leadership
Leadership

What exactly doesn't function for you ?

Do you get error messages ?


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

0 Kudos
Leffingwell
Contributor
Contributor

Hey LucD!!

No, no error messages it just "completes" and goes to a new line.

What's also interesting about it is after I source the function in, I do a get-help remove-orphaneddata and it shows the contextual help for the commandlet.

I've tried it with a couple of different switches and in a couple of different environments (power CLI/powershell ISE etc) and it just says 'completed' with no output and moves on.  I've even tried storing the results in a variable and outputting the variable and it's empty.

My powerCLI version is 4.1 u1!!

ALAN

0 Kudos
LucD
Leadership
Leadership

The function should work with that PowerCLI version.

It could mean that there are no orphaned folders and/or .vmdk on your VMFS datastores.

Areyou sure there are some orphaned files/forlders?

Perhaps create a folder with 1 or more files in there on a datastore and check if the functions repports on that folder/files.


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

0 Kudos
Leffingwell
Contributor
Contributor

Hey LucD,

Really appreciate the response given all of the stuff going on this week!

I know for a fact there is a large amount of orphange on several datastores, our team discovered this by hand and were looking for mass ways to handle it since it's such an issue with our environment.  Anything else I can provide to you let me know!

ALAN

0 Kudos
Leffingwell
Contributor
Contributor

Bump - if no change just going to go ahead and marked closed for now!

0 Kudos
LucD
Leadership
Leadership

If you could show me a screenshot of one of the folders that has snapshots for a VM but doesn't turn up in the script, that could perhaps give me clue.

If you don't want to show that in this public community, feel free to email the info to me


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

0 Kudos