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.

Active IQ Unified Manager Discussions

Aggr Expansion

venkate_SAN
4,247 Views

Hi ,

 

I have created scrip for aggr expansion, command executing properly however workflow failing for success and failure.

 

Log

 

06:38:01.958 INFO [Aggregate Expansion] ### Command 'Aggregate Expansion' in 'POWER_SHELL' ###
06:38:07.700 INFO [Aggregate Expansion] Successfully decrypted the input password
06:38:28.903 INFO [Aggregate Expansion] Addition of 1 disk to the aggregate has completed.
06:38:29.122 ERROR [Aggregate Expansion] wfatest expanded.
06:38:30.372 ERROR [Aggregate Expansion] Command failed for Workflow 'Aggr_Expansion' with error : wfatest expanded.
06:38:30.372 INFO [Aggregate Expansion] ***** Workflow Execution Failed *****

 

Script

 

$a = $null

$aggradd = Invoke-nassh -Command " aggr add $AggregateName -g $RaidGroupName -T $DiskType $NumberOfDiskToAdd@$DiskSize " -ErrorAction Stop

if($aggradd -eq $a)
{
Get-WFALogger -Error -message $aggradd
throw "$AggregateName not expanded."
}
else
{
Get-WFALogger -Info -message $aggradd
throw "$AggregateName expanded."
}

 

1 ACCEPTED SOLUTION

venkate_SAN
4,159 Views

If i use WFAlogger workflow completing successfully even wrong input.below script is working fine now.

 

02:12:24.794 INFO [Aggregate Expansion] ### Command 'Aggregate Expansion' in 'POWER_SHELL' ###
02:12:26.747 INFO [Aggregate Expansion] Successfully decrypted the input password
02:12:47.536 ERROR [Aggregate Expansion] wfatest not expanded.
02:12:47.661 INFO [Aggregate Expansion] Command completed, took 22867 milliseconds

 

 

$a = $null

$aggradd = Invoke-nassh -Command " aggr add $AggregateName -g $RaidGroupName -T $DiskType $NumberOfDiskToAdd@$DiskSize " -ErrorAction Stop

if($aggradd -eq $a)
{
#Get-WFALogger -Error -message $($aggradd)
throw "Aggregate $AggregateName not expanded, Please check the input parameters and disk availability."
}
else
{
Get-WFALogger -Info -message $aggradd

$aggrstatus = Invoke-nassh -Command " aggr status -r $AggregateName "

Get-WFALogger -Info -message $aggrstatus
#throw "$AggregateName expanded."
}

View solution in original post

2 REPLIES 2

dkorns
4,204 Views

I'm pretty sure what you want to do for the 'expanded correctly' case is just issue the Wfa-GetLogger statement saying so and let PowerShell exit. When you do the 'throw', that tells WFA there was a problem.

 

 

venkate_SAN
4,160 Views

If i use WFAlogger workflow completing successfully even wrong input.below script is working fine now.

 

02:12:24.794 INFO [Aggregate Expansion] ### Command 'Aggregate Expansion' in 'POWER_SHELL' ###
02:12:26.747 INFO [Aggregate Expansion] Successfully decrypted the input password
02:12:47.536 ERROR [Aggregate Expansion] wfatest not expanded.
02:12:47.661 INFO [Aggregate Expansion] Command completed, took 22867 milliseconds

 

 

$a = $null

$aggradd = Invoke-nassh -Command " aggr add $AggregateName -g $RaidGroupName -T $DiskType $NumberOfDiskToAdd@$DiskSize " -ErrorAction Stop

if($aggradd -eq $a)
{
#Get-WFALogger -Error -message $($aggradd)
throw "Aggregate $AggregateName not expanded, Please check the input parameters and disk availability."
}
else
{
Get-WFALogger -Info -message $aggradd

$aggrstatus = Invoke-nassh -Command " aggr status -r $AggregateName "

Get-WFALogger -Info -message $aggrstatus
#throw "$AggregateName expanded."
}

Public