Active IQ Unified Manager Discussions

Increment IP address with in a lif create loop

dblackwe
4,045 Views

I can do this with vol naming, but I can't seem to figure out what to do for lif.  I have to create a data lif for the new vserver on every node, so I do a node resource loop.  However I need to increment the ip address each loop from the original entered ip address. (i.e. 192.168.45.34, .35, .36) If this was a straight script I would split the value by octects and add index + 34 and get what I need, but I am not sure how to do that in WFA perl code.

1 ACCEPTED SOLUTION

shailaja
3,985 Views

Adding to the response above with some more pointers:

 

The design of the sample workflow named "Create and configure SAN Storage Virtual Machine" does the same as your description.

 

- Workflow has an input parameter named "LIFAddress"
- Second row here iterates over all nodes in the cluster and the steps in the row create an iSCSI LIF and a FC LIF.
- iSCSI LIF has the IP address configured by incrementing the given user input $LIFAddress using row Index.   nextIPAddressByIncrement($LIFAddress, index -1)
- Name of the LIF is also generated accordingly.


2. >>>I need to be able to do a command X number of times per node as well.
- If the 'x' is too low like 2 lifs in each node or maybe 3, you could add the same command more than once as subsequent columns.


- Or you could have two to three rows by copy-pasting the row and changing inputs. The sample workflow referred above follows this i.e it has two rows that does the same work.

 

- If the 'x' is quite a larger number and not just 2 or 3, then the logic of adding so many such command steps to the workflow may not work out.

You could use child workflows that has one loop and the parent workflow has the other loop.

 

- WFA does not currently support nested loops. If the requirement is strong for this feature, then we will add the details to a RFE. Let us know.


Thanks,
Shailaja

View solution in original post

5 REPLIES 5

dblackwe
4,031 Views

and shoe-horning in this as well.

 

I need to be able to do a command X number of times per node as well.

karale
4,006 Views

Can you try using functions available in WFA like nextIP() or nextIPByIncrement()

shailaja
3,986 Views

Adding to the response above with some more pointers:

 

The design of the sample workflow named "Create and configure SAN Storage Virtual Machine" does the same as your description.

 

- Workflow has an input parameter named "LIFAddress"
- Second row here iterates over all nodes in the cluster and the steps in the row create an iSCSI LIF and a FC LIF.
- iSCSI LIF has the IP address configured by incrementing the given user input $LIFAddress using row Index.   nextIPAddressByIncrement($LIFAddress, index -1)
- Name of the LIF is also generated accordingly.


2. >>>I need to be able to do a command X number of times per node as well.
- If the 'x' is too low like 2 lifs in each node or maybe 3, you could add the same command more than once as subsequent columns.


- Or you could have two to three rows by copy-pasting the row and changing inputs. The sample workflow referred above follows this i.e it has two rows that does the same work.

 

- If the 'x' is quite a larger number and not just 2 or 3, then the logic of adding so many such command steps to the workflow may not work out.

You could use child workflows that has one loop and the parent workflow has the other loop.

 

- WFA does not currently support nested loops. If the requirement is strong for this feature, then we will add the details to a RFE. Let us know.


Thanks,
Shailaja

dblackwe
3,970 Views

Nested loops are important for complex multi stage, repetative setups.

 

For example, right now the workflow I am working on is for 0-day cluster setup for a cluster of any node size that has to be able to;

 

rename all root aggrs

rename all vol0s

rename all nodes

create X number of Aggrs on each node (X won't always be the same for each node......)

Multiple options and config setting changes at node and cluster level

Create X number of SVMs

Create a lif per node per svm

Create ls mirrors on each node for each svm root

create X number of volums for each svm (X won't be the same for each SVM, and X won't be the same size even within a SVM....)

 

There is more, but I am just trying to show how multiple sub loops are important.  I am considering just writting one huge perl script that can do everything though multiple loops and making it a command and having a one command workflow 🙂

shailaja
3,936 Views

Thanks for the details.

RFE # 1050531 has been filed for the same. Added you in the CC list.

 

In my opinion, some of the steps below are single steps i.e the ones like "rename all root aggrs, vol0s, nodes", "X" svms in the cluster.

However, all the other ones like "X" number of aggrs in each node, 'X' volumes in each SVM or LIFS do not fall into single loop and would need sub looping or nested loops

 

Shailaja

 

Public