Microsoft Virtualization Discussions

Highlighted

Luns under volumes

Is there a way to script something that will show what LUNS are under which volumes?

I know you can do it with Systems Manager, but I'd like to see something more like a tree hierarchy...

Volume Name

     -Luna

     -Lunb

     -Lunc

Volume Name

     -Luna

     -Lunb

Etc

Make sense?

17 REPLIES 17
Highlighted

Re: Luns under volumes

Please do a search for one of my posts.  We wrote something a while ago that should give you what you want

Highlighted

Re: Luns under volumes

Here, I'll save you the trouble - https://communities.netapp.com/thread/23684

Highlighted

Re: Luns under volumes

I actually saw that script, but it doesnt seem to output the info I was hoping/looking for....

I would like to see the volume name and then the specific LUNS associated to that volume under it. Preferably exported to XLS or a CSV file.

Highlighted

Re: Luns under volumes

If I get some time, I will try to come up with a little bit of a sample... Not much free time these days.. 

Highlighted

Re: Luns under volumes

Hi Justin,

Yes, you can do it, But it can get little tricky, you can use awk script to run against it. Can you please paste the output of qtree status?

Thanks

RK

Highlighted

Re: Luns under volumes

*cough* awk *cough*  🙂

native powershell is the way to go....

Highlighted

Re: Luns under volumes

I see what u mean .. but with very little effort it will give the result Justin wanted.

Re: Luns under volumes

I have to be honest.. Not that i'm against it, but onCommand Reporting 1.1 seems to do a really nice job at it.

I love powershell, but heck, I can't compete with Cognos Developers...

Highlighted

Re: Luns under volumes

We do a lot of cloning of volumes from Prod to test/QA. The volumes contain a tun (spelled it like that on purpose) of luns that are un-needed when we do the clone, so we go in and delete the un-needed luns.

Long story short, the DBA's ask to refresh a DB, which is usually one or 2 luns and since we clone the whole volume, and each volume has a tun of luns, its kind of a pain to find the volume...

With a script that populates what Volume has which Luns, I could go in and filter the LUN name and bingo bango.... easy.

Highlighted

Re: Luns under volumes

Justin,

Give onCommand Report a shot..

I just went into our environment and created the report with data in it in 5 minutes. 

I'm decent in powershell, but I can't compete with that.

Highlighted

Re: Luns under volumes

Are you talking about Ops Manager?

Highlighted

Re: Luns under volumes

Installing OnCommand Report now... waiting for a eval license from my sales guy....

Highlighted

Re: Luns under volumes

How did you make out?

Highlighted

Re: Luns under volumes

Hello Justin,

Can you try this out, it might point you to the correct direction..

Just copy and paste the below scriptlet to your powershell window.

function LunName

{

    [CmdletBinding()]

    Param

    (

        # Param1 help description

        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]

        $vol       

    )

$luninfo = Get-NaLun | ?{$_.path -match "/vol/$vol/" } | ForEach-Object {$_.Path.replace("/vol/$vol/","")}

return $luninfo

}

Get-NaVol | select @{l='VolumeName';e={$_.name}},@{l='ContainedLunNames';e={([string]::Join(",",(LunName -vol $_.name)))}}

You can also export to csv as below

Get-NaVol | select @{l='VolumeName';e={$_.name}},@{l='ContainedLunNames';e={([string]::Join(",",(LunName -vol $_.name)))}} | Export-Csv "c:\volluninfo.csv"

View solution in original post

Highlighted

Re: Luns under volumes

Hi Vinith,

That is pretty neat, but it takes very longtime (50min) to generate output. I have like 34 volumes with 7 luns each,

Thanks

Ravi

Try the NEW Knowledgebase!
NetApp KB Site
Forums