NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

Check if aggregate exists

LUKASPRELOVSKY
6,483 Views

Hi all,

is it possible to check if an aggregate exists? If yes, how to do it? If not how to catch and hide the error?

Thank you,

Lukas

Best Regards,
Lukas
1 ACCEPTED SOLUTION

bsti
6,483 Views

Hi Lukas,

  I use this: 

if ( Get-NaAggr | ? { $_.Name -ieq "aggrname" } )

{

  ..  Aggr exists, do this

}

else

{

  .. Does not exist...

}

View solution in original post

4 REPLIES 4

LTDCLSERGAO
6,483 Views

hello,

there is many way to list existing aggregat

aggr status,

aggr status -r ( to show raid detail)

df -Ag

aggr show_space -g

LUKASPRELOVSKY
6,483 Views

Hi,

yes, i know, but can you provide me a sample script with options when a aggrete not exists?

thx

Best Regards,
Lukas

bsti
6,484 Views

Hi Lukas,

  I use this: 

if ( Get-NaAggr | ? { $_.Name -ieq "aggrname" } )

{

  ..  Aggr exists, do this

}

else

{

  .. Does not exist...

}

LUKASPRELOVSKY
6,483 Views

Hi,

thank you very much! This is what I looking for!

Lukas

Best Regards,
Lukas
Public