Active IQ Unified Manager Discussions

Correct syntax for "Execute this command:" in WFA

Jim_Robertson
3,989 Views

I am attempting to create a workflow where certain steps will not run if a volume is offline or doesn't exist.  To achieve this, I was trying to the use "Execute this command" on the advanced tab of the workflow step, but I can't seem to get the syntax correct.  Or, maybe it's because I'm trying to use a previously defined object?  The dropdown allows me to select the object, so it seems like it should work.  I've tried putting the "online" word in single quotes, double quotes, and no quotes.  All give me the same error.

snapmirror1.volume.state == 'online'


WFA1.JPG


When I do a preview, I get the error message: 
Failed to evaluate the conditional execution expression 'snapmirror1.volume.state = "online"'. Illegal expression: snapmirror1.volume.state = "online"

What am I missing?

1 ACCEPTED SOLUTION

Girton
3,826 Views

As best I can tell snapmirror1.volume.state == 'online' is the correct syntax.

 

As a test, I cloned the "Remove SnapMirror relationship" certified workflow, and added a condition in the parameter section of 2nd command block ("Remove SnapMirror - Perl"), using a similar conditional expression (snapmirror.volume.state == 'online'), and it worked as expected.

The only additional thing I can think of to look at is the filter you used to find the SnapMirror.  Are you using a custom filter?  It appears that you might be, as all of the certified filters I can see in WFA require more than the source volume to find a SnapMirror relationship.  If you're using a custom filter, is it possible that the filter isn't returning the state of the source volume?  If so, then such would cause the error you're seeing.

 

View solution in original post

4 REPLIES 4

Girton
3,867 Views

I don't know if this reply is too late, but here goes:

One thing that comes to my mind is to search for the SnapMirror source volume before this step, using a "Search or define" block.  Then reference this object's state in the advanced tab of the workflow step.  I suspect the cause of your issue that you're referring to an object defined in that step, something I've seen before.  It's a frustrating problem, for sure.

 

Please update this thread if you get a chance to try my suggestion.

Jim_Robertson
3,852 Views

Thanks, @Girton.  Thankfully, this got put on the back burner for right now, but I'm sure I'm going to start getting pressured for it again soon, so any help is definitely appreciated.

Unfortunately, I think I'm already doing what you are suggesting.  The first step of the workflow is to find and define a Snapmirror relationship based on a given volume name that the user enters:

Capture2.JPG

Then, it will wait until any running Snapmirrors are finished before continuing on.  This part works as long as I don't have a condition in the Advanced tab.  So, I know it's defining it correctly.  It will even let me use the dropdowns to create the condition (see screenshot), I'm just not sure what the syntax is after defining the parameter I want to look at to judge the condition.  Is snapmirror1.volume.state == 'online' the correct syntax?  I only want it to wait for the Snapmirror update to complete if the source volume is online.

 

 2018-11-27_16-08-08.jpg

Girton
3,827 Views

As best I can tell snapmirror1.volume.state == 'online' is the correct syntax.

 

As a test, I cloned the "Remove SnapMirror relationship" certified workflow, and added a condition in the parameter section of 2nd command block ("Remove SnapMirror - Perl"), using a similar conditional expression (snapmirror.volume.state == 'online'), and it worked as expected.

The only additional thing I can think of to look at is the filter you used to find the SnapMirror.  Are you using a custom filter?  It appears that you might be, as all of the certified filters I can see in WFA require more than the source volume to find a SnapMirror relationship.  If you're using a custom filter, is it possible that the filter isn't returning the state of the source volume?  If so, then such would cause the error you're seeing.

 

Jim_Robertson
3,714 Views

Thanks, @Girton, it looks like that syntax was correct after all.  After not looking at it for all this time, I went back and checked on it with fresh eyes.  It looks like I set the correct syntax on an early step of the workflow, but didn't set it correctly on later steps.  So, the error message was coming from steps later in the workflow.  Doh!   Sorry for the wild goose chase, but I think I have it working now.

Public