Active IQ Unified Manager Discussions

WFA - Creating multiple volumes

JOHNGARRETT
4,079 Views

OK, new to WFA here. What's the secret to creating multiple volumes?

 

Here's what I'm trying to do: Create, say, 5 volumes all starting with "test1" and then use incremental naming to give them a "2", "3", "4" etc suffix. 

 

Here's what happens in the preview:

preview.PNG

 

I can see in the details that the name increments successfuly only once:

details.PNG

 

Here are my inputs:

 

userinputs.PNG

 

Here are the parameters for the 'Create Volume' step. As you can see they're straight out of the box using the Space Efficient Settings for NFS Datastores template, with the exception of the name parameter, which I'll show later:

 

createvolume.PNG

 

Here's the name parameter settings:

 

incrementalname.PNG

 

Here's the search criteria:

 

searchcriteria.PNG

 

And the final piece of the puzzle, row repetition:

 

rowrepetition.PNG

 

So you can see I'm not trying to reinvent the wheel here, just create a whole lot of volumes. What am I missing? 

4 REPLIES 4

coreywanless
4,061 Views

I'm taking a stab at this without validating. I don't do the increments very often 🙂

 

I think the issue is that your $VolumeName variable needs to be without the number.  IE just 'test' and not 'test1'.

 

Then, in the 'incremental naming wizard' you need to specify it as '$VolumeName+'1'. Notice the description above the field entry how it states 'Enter a value for Name if no Volume matches..' This implies that this is your initiating volume.

 

Now, the other issue you have is that your filter is looking for volume name that equals the VolumeName variable.  Now your selection needs to be something other than equals.

 

I think once you do that it should increment just fine.

JOHNGARRETT
4,032 Views

Thanks for the reply, @coreywanless. Actually I tried just "test" as the $volumename and it gives me the same results. 

 

preview2.PNG

 

As for changing the filter operator to be something other than equals, it grabs other volumes with the name test (there are a few) and discards the user defined $VolumeName altogether, which is no good. 

 

Turns out you were right about my $VolumeName being part of the problem. I got it to work using the index value of the iteration, in this case it looks like $volumeName+Index1. 

 

However what I'd really like is to add a "-" and then zero pad for single digit numbers. This can be done easy enough with .NET via "{0:D2}" -f $a where $a is the iteration number. This would leave me with test-01, test-02, test-03, etc. I have zero experience with MVEL though. Any ideas on how to accomplish this in MVEL?

 

Another issue is that if I came back later and wanted to create a test4 (assuming zero padding won't work out), just using the iteration Index1 value, it would probably fail because that value would be 1, not 4.

 

 

coreywanless
4,024 Views

If you have other volumes that start with 'test' or whatever you are defining as your prefix, it will discover those other volumes. 

 

You need to make sure whatever you are defining as your search criteria, only gives you the volumes you want to compare against.

IE:

The correct results of your query:

  • test1
  • test2
  • test3
  • etc

The results you don't want to see in you search:

  • testmyapp01
  • test1
  • testconqueringtheworld1
  • test2

It looks like you might be running on 4.0. I believe this search feature is new. 3.x only had the filters that are listed at the bottom of that window.   (I have not upgraded yet)  My suggestions on the search part, would be to include additional parameters to lookup to narrow down the results. IE array/vfiler/cluster/svm. Use the Test button to your advantage on that screen.

 

You can easily add the dash in the volume,  you don't need to know how to build a MVEL function. You just need to use "($VolumeName + '-')" instead of just $VolumeName in your search criteria, and "($VolumeName + '-01')" for the 'Enter a value for name if no Volume...' field.

JOHNGARRETT
4,010 Views

Yeah, I'm on 4.0. The problem is if I change "name if no volume matches" value from $VolumeName+Index1, it fails to increment again. There's an MVEL for last_volume.name but I don't know where to use it. I should also mention this is my first WFA workflow and I'm learning as I go.

Public