Subscribe
Accepted Solution

Aggr Expansion

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."
}

 

Re: Aggr Expansion

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.

 

 

Re: Aggr Expansion

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."
}