Active IQ Unified Manager Discussions

Beginner WFA Question - Create a Qtree

A_Campbell
6,056 Views

I'm just starting out with WFA and having a hard time using NetApp's 'Create Qtree' command. I'm trying to use an existing volume I created ahead of time using 'select one volume by it's natural keys'. To make sure my parameters are correct, I use the test function in the resource selection window, and the test passes. I enter the exact information I used for the test, in the 3 parameters for cluster name, storage virtual machine name, and volume name. But, the preview is failing with 'illegal expression' on the volume:

 

Failed to evaluate resource selector. Illegal expression: Adam_TestVol1
Location: 'Create qtree' command > 'Qtree' tab > 'qtree1' variable > 'volume' property 

 

I can't figure out why the parameters pass the test during resource selection, but fail during the preview. I did notice it doesn't ask me to specify the aggregate, so maybe that has something to do with it. Any assistance would be appreciated!

 

 

Thanks

1 ACCEPTED SOLUTION

MattInCO
6,042 Views

@A_Campbell

 

My first thoughts without seeing it would be that your volume name (and cluster + SVM) string isn't enclosed in single quotes. I don’t think you have to do that to test, but you will for the actual command block.

 

If that doesn't help, then you may have to post your workflow.

 

Let me know if that helps point you in the right direction.

View solution in original post

5 REPLIES 5

MattInCO
6,043 Views

@A_Campbell

 

My first thoughts without seeing it would be that your volume name (and cluster + SVM) string isn't enclosed in single quotes. I don’t think you have to do that to test, but you will for the actual command block.

 

If that doesn't help, then you may have to post your workflow.

 

Let me know if that helps point you in the right direction.

A_Campbell
5,950 Views

Thank you! The single quotes solved my issue. Really appreciate the help!

sinhaa
5,908 Views

@A_Campbell

 

I use the test function in the resource selection window, and the test passes. I enter the exact information I used for the test, in the 3 parameters for cluster name, storage virtual machine name, and volume name. But, the preview is failing with 'illegal expression' on the volume:

 

----------

 

 

I assume you have got forward with this but I'll try to explain why this behavior is the expected behavior. This has been quizzing many WFA users. Why I can provide values in Test Filters but when I provide the same in command parameters, I need to provide them within single quotes else I get Illegal expression error.

 

 

This happens because the fields at Command parameters are MVEL enabled. It means at those places I can provide an MVEL expression to dereieve the values for the parameter.  I can provide a value like : $name + '__ext'   . So when I have to provide an absolute value, I need to provide them as a valid MVEL expression which for has to be within quotes.

 

Parameters at Test of filter, Query Inputs etc are NOT MVEL enabled. So you can provide values without any quotes. In fact you should always use without quotes, else quotes are also assumed a part of the provided value.

 

 

So how does one know which fileds are MVEL enabled and which are not.

 

Well almost all places of Input in a workflow are MVEL enabled. Except for some like Test of filters, finder, execution comments, .

 

The thumb rule is: With the cursor blinking into the field, press CTRL+<DOWN KEY>

 

If you get a drop-down list of available functions and other things, this field in MVEL enabled. Else not.

 

 

sinhaa 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

A_Campbell
5,905 Views

@sinhaa

 

Great info, Thanks!

mbeattie
6,002 Views

Hi,

 

Here are some step by step instructions for you with screenshots as a learning example to help you get started.

 

I recommend the first step in your workflow to use a "search or define" step to search for a volume to create your qtree within.

You can set the input paramater type to query and write some SQL queries to filter the cluster\vserver\volume.

This way your inputs can be selected dynamically rather than having to type in values. EG:

 

In the "Available Steps" menu type "search" and drag drop the "Search or define" step as the first step into your workflow then click in the row under the command name

 

wfa_step1.png

 

Select the dictionary object type as "Volume" for the "cm_storage" scheme.

 

wfa_step2.png

 

 

Assign a variable name for the volume (EG "Volume"), leave the default option to abort the workflow if the volume was not found and click the "Enter search criteria" link:

 

wfa_step3.png

 

In the resource selection dialogue box, click "select one volume by it's natural keys" then enter variable names for the paramaters and click ok to any prompts.

 

wfa_step4.png

 

 

 

Click on the step name to rename it to something meaningful (EG "get_volume") then click on the "User Inputs" tab.

 

wfa_step5.png

 

Double click on the input (EG 'ClusterName') and change the input type from 'String' to 'Query'

 

wfa_step6.png

 

Select the checkboxes for "lock values" and "mandatory" then click the "Enter a SQL query executed at runtime"

 

wfa_step7.png

 

Enter your SQL query for the variable and click ok. EG

 

wfa_step8.png

 

Repeat the process of changing the variable input types from String to Query for both the VserverName and VolumeName varabiles. When prompted for a SQL query enter the following:

 

ClusterName

#'--------------------------------------
#'Select the cluster.
#'--------------------------------------
SELECT
    cluster.name,
    cluster.primary_address,
    cluster.version
FROM
    cm_storage.cluster
#'--------------------------------------

VserverName

#'--------------------------------------
#'Select the data vserver.
#'--------------------------------------
SELECT
    vserver.name
FROM
    cm_storage.cluster,
    cm_storage.vserver
WHERE
    vserver.cluster_id = cluster.id
    AND (
        cluster.primary_address = '${ClusterName}'
        OR cluster.name = '${ClusterName}'
    )
    AND vserver.type = 'data'
    AND vserver.operational_state = 'running'
#'--------------------------------------

VolumeName

#'--------------------------------------
#'Select the data volume.
#'--------------------------------------
SELECT
    volume.name AS 'volume_name'
FROM
    cm_storage.cluster,
    cm_storage.vserver,
    cm_storage.volume
WHERE
    vserver.cluster_id = cluster.id
    AND volume.vserver_id = vserver.id
    AND volume.junction_path <> '/'
    AND vserver.name = '${VserverName}'
    AND (
        cluster.primary_address ='${ClusterName}'
        OR cluster.name = '${ClusterName}'
    )
#'--------------------------------------

Once all input types are set to query, move the vservername input up. EG

 

wfa_step9.png

 

Click on the "Workflow" tab and type "Create Qtree" in the 'available commands' then drag and drop it into your workflow:

 

wfa_step10.png

 

Enter a name for the command variable EG "Qtree" and in the "name" parameter enter "$QtreeName". In the security style you can enter 'volume.security_style' (assuming you want the Qtree to be created with the same security style as the volume or you could enter "$SecurityStyle" if you want that as an input). In the volume paramater click the right side. EG

 

wfa_step11.png

 

Note: You can have WFA automatically select a Qtree name based on your storage teams naming standards and automatically increment the name instead of having to type the name manually.

 

Enter input variables to filter the volume:

 

wfa_step4.png

 

Click ok and yes to update variable references then save your workflow.

 

When you preview\execute it you should now have workflow that searches for volume, enables you type in a qtree name to create on that volume. EG:

 

wfa_execute.png

 

wfa_success.png

 

EG:

 

cluster2::> qtree show -vserver vserver2 -volume v
    volume_001    vserver2_root
cluster2::> qtree show -vserver vserver2 -volume volume_001
Vserver    Volume        Qtree        Style        Oplocks   Status
---------- ------------- ------------ ------------ --------- --------
vserver2   volume_001    ""           ntfs         enable    normal
vserver2   volume_001    qtree_001    ntfs         enable    normal

I hope these instructions help. Cheers

 

/Matt

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public