I am encountering unexpected behavior with the “Search or Define” command block when searching for an aggregate, AND using the “If…was not found” with “Fill-in attributes for… and execute the command.” I know this will be a little wordy - I’m just trying to convey relevant information (hopefully).
If I use the option to just disable the command (default behavior) if an aggregate meeting the criteria was not found, then things work exactly as expected. That being if an aggregate meeting the criteria was found, then it returns that, otherwise the command is disabled. However, as soon as I use the option to fill in attributes then the command appears to ALWAYS be disabled.
A difference in behavior can be observed in the Advanced tab (let’s assume “myaggr” is the variable name here):
When using the default behavior (disable command if a suitable aggregate was not found), then under the advanced tab we see “Execute this command: If the variable myaggr was found AND Always”
However, when using the fill-in attributes option then this reflects: “Execute this command: If the variable myaggr was not found AND Always.”
Since I haven’t stated what I expect to see yet, it would be that if I select the “fill-in attributes…” option then the command will search on the criteria given and return an aggregate meeting that criteria. If an aggregate was not found meeting that criteria, then it would return whatever aggregate that I have filled in.
I hope that all makes sense.
-WFA 4.0 on Server 2012 R2, WFA Pack for managing Clustered Data ONTAP v1.2.1, OnCommand Unified Manager 7.1-
Thanks for the feedback. I threw together a workflow to help visualize just this issue as to not overcomplicate things. It is now attached.
In my environment, the second step (called Find Preferred Aggregate) is always coming back as disabled, which is not expected, while the first step does return an aggregate, as expected. I've attached a screen shot of this scenario.
In my case if I change the second step from "If aggregate2 was not found: Fill-in attributes for aggregate2 and execute the command" TO "Disable this command" only then does it return an aggregate (as seen in the next image).
I'll be interested to know if you see the same results in your environment.
As a side note, the ultimate goal of this is to be able to find an aggregate meeting optimal criteria, but if one isn't found then return an aggregate that meets slightly less optimal criteria without failing, while returning whichever aggregate is selected under a single variable name to be referenced throughout the workflow.
Thank you in advance for any assistance that you may be able to provide.
-WFA 4.0 on Server 2012 R2, WFA Pack for managing Clustered Data ONTAP v1.2.1, OnCommand Unified Manager 7.1
Sinhaa is right, this is not very easy to discuss in general terms, but I'll make an attempt.
One thing you need to realize is that the planning phase of workflow execution is not a linear process. When the advanced tab talks about "if this object was found/not found", it does not mean in a previous step. It means after planning is complete, possibly in a later step. This is why you cannot have a search step that says "find this object now, if you haven't already found it."
So how can you actually achieve what you are trying to do? I can think of two ways, but both are a bit clumsy.
1. Create a search step for aggregate1. Create a second search step for aggregate2. Every time you wish to use your aggregate in a subsequent step, create two instances. Set one to "if the following variable was found: aggregate1" and use aggregate1. Set the other to "if the following variable was not found: aggregate1" and use aggregate2.
2. Create search steps for aggregate1 and aggregate2 as before. Create a third search step for aggregate3 and use the filter "Select one Aggregate by its natural keys" . For the keys, enter something like "aggregate1._found == true ? aggregate1.node.name : aggregate2.node.name". Use aggregate3 in all subsequent command steps.