VMware Cloud Community
vmk2014
Expert
Expert
Jump to solution

wastage storage reclamation

Hi LucD,

As you recommended to open a separate mail thread, hence i'm opening a new thread for Storage reclamation.like LUN not in use/Orphaned file/Powered-off VM's deletion etc.

Any other way to reclaim the unused storage ?

Thanks

V

Tags (1)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

There are several types of in-use storage that can be reclaimed.

For orphaned files, you can use my Orphaned Files And Folders – Spring Cleaning post and add the -Delete switch.

But only after you have run the function without the -Delete switch and verified the resulting report!

For snapshots, again after verification, it is quite straightforward.

Get-VM | Get-Snapshot | Remove-Snapshot -Confirm:$false

What other kinds of in-use storage did you have in mind?


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

View solution in original post

Reply
0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

There are several types of in-use storage that can be reclaimed.

For orphaned files, you can use my Orphaned Files And Folders – Spring Cleaning post and add the -Delete switch.

But only after you have run the function without the -Delete switch and verified the resulting report!

For snapshots, again after verification, it is quite straightforward.

Get-VM | Get-Snapshot | Remove-Snapshot -Confirm:$false

What other kinds of in-use storage did you have in mind?


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

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

LucD,

if you dont mind, i did try to clean up an orphaned file using the attached script, but it always generate the Zombie file report instead of deleting the Orphaned/Zombie file. It would be nice if you can help me to fix the script for Zombie or Orphaned file cleanup. It always generate the report but never deleted when i compare with Rv tools report.

Thanks

V

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You have to use the -Delete switch when you actually want to remove the files and folders.

But make sure to check the report, from a run without the -Delete switch, first!


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

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

Thank you LucD.

you mean Remove-OrphanedData should be replaced by -Delete

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, that last line should look like this

Get-Datastore * | Remove-OrphanedData -Delete |

Export-Csv D:\DC_Zombie.csv -NoTypeInformation –UseCulture


But make absolutely sure that you know what you are doing.


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

vmk2014
Expert
Expert
Jump to solution

Thank you LucD. First, i need to run and test in a smaller environment. Will verify later.

Reply
0 Kudos