VMware Cloud Community
Mahiee
Enthusiast
Enthusiast
Jump to solution

Unused LUNs

In my inventory understand there are some free (unused) LUNs which I would like to be make a list with any automation magic, I request please someone please help with my trick which would help me to find out all the Unused LUNs, equally I'm also looking for orphaned VMDKs in Datastore, please suggest on it. Thank you so much in Advance.

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

There were several issues in the script, most probably due to the copy/paste

Try with this version


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

View solution in original post

7 Replies
LucD
Leadership
Leadership
Jump to solution

For the LUN you can have a look at my LUN report – datastore, RDM and node visibility post.

For orphaned VMDK have a look at Orphaned files and folders – Spring cleaning


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

Mahiee
Enthusiast
Enthusiast
Jump to solution

Dear LucD, Can you help me with download of the scripts from your post, becuase copy & paste are becoming out of frame.

Thanks a lot with your post referances.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Which browser are you using?

And how did you download the scripts?

Hover over the script lines, double-click and then you can do a Ctrl-C


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

Mahiee
Enthusiast
Enthusiast
Jump to solution

I have able to copy the Script, thanks.

But when I run the script I'm getting below error, can you please suggest.

+ "@ $LunInfoDef = "public struct LunInfo" + $rndNum + "{`n" + $LunInfoDef

+    ~~~~~~~~~~~

Unexpected token '$LunInfoDef' in expression or statement.

At C:\temp\FreeLuns.ps1:13 char:17

+  $scsiTab = @{} $esxServers | %{

+                 ~~~~~~~~~~~

Unexpected token '$esxServers' in expression or statement.

At C:\temp\FreeLuns.ps1:32 char:1

+ }

+ ~

Unexpected token '}' in expression or statement.

    + CategoryInfo          : ParserError: (:) [], ParseException

    + FullyQualifiedErrorId : UnexpectedToken

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Looks like something might have gone wrong in the copy/paste.

Can you attach your copy of the script as a file to this thread?


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

0 Kudos
Mahiee
Enthusiast
Enthusiast
Jump to solution

I attached it here.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

There were several issues in the script, most probably due to the copy/paste

Try with this version


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