Subscribe

WFA - Set user selection of environment which sets source cluster/svm & destination cluster/svm

I have built a workflow in our lab for provisioning new NFS exports which deploys the following:

 

Source - 

export policy + export rule + volume mounted as namespace

 

Destination -

export policy + export rule + volume creation, then establishs the mirror releationship & schedule, initializes the mirror followed by the mounting of the DR volume namespace

 

In my lab I have constants defined for ClusterNameSource, VserverSource, ClusterNameDestination, VserverDestination.

 

I want to take this workfow to my production environment which currently has 6 different possible deployment combinations which would determine the constants above.  I am trying to figure out how to allow the 6 environment variables to be selected as a user input which then sets the four constants as listed above.  I tried setting up a new dictionary, using a new scheme which is based off a csv file with these entries that I added as a datasource being loaded into .\ via powershell script but that simply lists the name fields versus taking the csv inputs so looking to see if someone can point me in the right direction.  Below is a mock version of the csv I used for my scheme & load as a data source which shows what I am trying to do by selecting the environment it then setting the four constants.

 

        Environment                        ClusterNameSource           Vserver Source     ClusterNameDestination  VserverDestination

1APROD-1BDR1A-1234-cluster00p1A-1234-svm01p1B-5678-cluster00p1B-5678-svm01p
1BPROD-1ADR1B-5678-cluster00p1B-5678-svm01p1A-1234-cluster00p1A-1234-svm01p
1ANONPRD-1BDR1A-1234-cluster50t1A-1234-svm51t1B-5678-cluster50t1B-5678-svm51t
1BNONPRD-1ADR1B-5678-cluster50t1B-5678-svm51t1A-1234-cluster50t1A-1234-svm51t
1ANONPRD_DMZ-1BDR1A-1234-cluster50t1A-9775-svm63t1B-5678-cluster50t1B-9185-svm63t
1BNONPRD_DMZ-1ADR1B-5678-cluster50t1B-9185-svm63t1A-1234-cluster50t1A-9775-svm63t

 

If someone can get my pointed down the right path I would greatly appreciate it.  My current user inputs only request SIZE, NAME, NFS ACCESS SOURCE & NFS ACCESS DESTINATION.  I would really like to add ENVIRONMENT which then sets the four constants based on the environment.

 

Thanks!

Re: WFA - Set user selection of environment which sets source cluster/svm & destination cluster/

@jimmychicago

 

From what I understand your requirement.

 

This didn't require you to do a new Data Source creation and acquistion. But since you have done it, lets see how to proceed now. 

 

I assume after your acquistion data looks like the table you have mentioned below.

 

  1. In the workflow, in 'Constants' tab, add a new constant called ENV and value $ENV
  2. Now in User-Inputs tab, change the  parameter for $ENV from string to Query-MultiSelect. Provide your query to your acquired Database to select all rows.
  3. In the same page for attribute 'Row', change from multiple to single.
  4. Now for your  

ClusterNameSource = getColumnValues($ENV,2)

          

VserverSource = getColumnValues($ENV,3)

 

ClusterNameDestination = getColumnValues($ENV,4)

 

VserverDestination = getColumnValues($ENV,5)

 

Let me know if this worked for you.

 

sinhaa

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

Re: WFA - Set user selection of environment which sets source cluster/svm & destination cluster/

Sinhaa - Thank you for your response.  I don't want to overcomplicate my workflow or depend on a new datasource if that is not necessary so what would you recommend as a better alternative?

 

In my current workflow the Source(Primary) and Destination(DR) were known constants which I hardcoded into the workflow steps.  I want to edit this to allow it to be based on the 6 different possible environments I had listed for Source Cluster/SVM & Destination Cluster/SMW.  Here is some screenshots of my current setup:

 

Constants - as you can see I hardcode the primary(source) cluster/svm and secondary(DR) cluster/svm.  If I want to continue down this path I need to create 6 seprate workflows which I don't want to do; I want 1 workflow that can be used for all six environments and modified when new ones are added or current ones are removed.

 

CONSTANTS.jpg

 

Here are my current user inputs which I would like to be able to add a 5th that asks for LOCATION which would be one of the six possible setups.  Based on the LOCATION selected it would then determine the Primary Cluster/SVM and Secondary(DR) Cluster/SVM.

 

USER INPUTS.jpg

 

Below are examples of the search parameters for the source and destination commands that determine Cluster/SVM and use the user inputed $Volume_Name, which if it already exists aborts the workflow but if not used those constants to execute the commands for deploying export policy, export rule, creation of volume, etc.

 

PRIMARY:

PRIMARY.jpg

 

SECONDARY:

 

SECONDARY.jpg

 

Here is the overall view of the command set that makes up this workflow:

 

NFS WORKFLOW VIEW.jpg

 

Thank you for your time and assistance!

 

 

Re: WFA - Set user selection of environment which sets source cluster/svm & destination cluster/

@jimmychicago

 

Okay dump your dataSource and

 

Do this

 

1. In 'Constants' tab add a new constant called : ENV  , Value $ENV. The Value of a Constant doesn't have to be a constant inside a quote.

2. Now go to user-inputs tab and edit this vaiable $ENV from type string to Query (Multi-Select)

3. Select Row to Single

4. In query Add a query as below. I've taken 2 rows from the CSV data you provided. You can add the remaining rows yourself.

 

Do a TEST and see your rows are getting shown as you want.

 

Make this parameter Mandatory

 

SELECT '1APROD-1BDR' AS 'Environment',
       '1A-1234-cluster00p' AS 'ClusterNameSource',
	   '1A-1234-svm01p' AS 'VserverSource',
	   '1B-5678-cluster00p' AS 'ClusterNameDestination',
	   '1B-5678-svm01p' AS 'VserverDestination'
	   
UNION

SELECT '1BPROD-1ADR' AS 'Environment',
       '1B-5678-cluster00p' AS 'ClusterNameSource',
	   '1B-5678-svm01p' AS 'VserverSource',
	   '1A-1234-cluster00p' AS 'ClusterNameDestination',
	   '1A-1234-svm01p' AS 'VserverDestination'
	   

Jimmy1.png

 

5. Back to 'Constants' tab. Now for your constant, modify the value as given

 

ClusterNamePrimary => getColumnValues($ENV,2)

VserverPrimary => getColumnValues($ENV,3)

 

etc..

 

See image.

 

Jimmy2.png

 

 

6. Now you may optionally even Remove the Parameter $ENV. Its presence too won't harm you in any way.

 

7.That's it. you are done. Now your constant will be derieved based on the environment you select.

 

 

sinhaa

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