General Discussion
General Discussion
Hi all,
So i'm trying to create a workflow that will populate the volume name off of exisiting varibles that the user defines, such as SVM, Cluster and CIFS name.
So I have two questions.
1. If you have done it, how did you go about doing it?
2. I am currently getting "Failed to create new volume: ffs_$cluster$svm$cifs. Message: Invalid character '.' in volume name. It can have '_' and alphanumeric characters. Location: Row '1' step 'Create volume'."
Why is a period being added to the end of my volume name?
I have checked and made sure and there is no period to be found.
Thanks in advance.
Solved! See The Solution
Hi Nick
Yes the workflow executes successfully. EG
The MVEL expression i used was:
#name toLower(sanitizeVolumeName('ffs_' + vserver.cluster.name + '_' + vserver.name + '_' + $ShareName)) #junction_path '/' + toLower(sanitizeVolumeName('ffs_' + vserver.cluster.name + '_' + vserver.name + '_' + $ShareName))
The SQL query for the $ShareName variable is:
SELECT cifs_share.name FROM cm_storage.cluster, cm_storage.vserver, cm_storage.cifs_share WHERE vserver.cluster_id = cluster.id AND cifs_share.vserver_id = vserver.id AND cifs_share.path <> '/' AND vserver.name = '${VserverName}' AND ( cluster.primary_address = '${Cluster}' OR cluster.name = '${Cluster}' )
Please let me know if you have any questions?
/Matt
Hi,
I'm not sure why you are getting that exact error message as i'd need more information and would likely have to import the workflow to troubleshoot the issue however it might be help to have a "how to" reference with some screen shots so you can follow along...
In the "create volume" command in your workflow, click on the button on the right side of the "vserver" field so you can set input variables values for the cluster and vserver. EG
Click the "Filter Storage Virtual Machine by Key" filter and set input variable values and click OK (twice to return the the workflow designer). EG
In the workflow designer, click on the "user inputs" tab. Set the input type to "Query" and add a SQL query (this ensures the user can select from a list of clusters\vservers) EG
Cluster:
SELECT cluster.primary_address, cluster.name, cluster.version FROM cm_storage.cluster
Vserver:
SELECT vserver.name FROM cm_storage.cluster, cm_storage.vserver WHERE vserver.cluster_id = cluster.id AND vserver.admin_state = 'running' AND vserver.cifs_allowed = 1 AND vserver.cifs_is_up = 1 AND ( cluster.primary_address = '${Cluster}' OR cluster.name = '${Cluster}' )
As for the volume name, you can increment it using an MVEL function and set a constant for the starting volume name to create if it's the first data volume to be created on the vserver. EG:
Note: set the constant value to match your naming.
Set incremental naming for you volume by clicking on the "incremental naming" button (on the right side of the "name" field" in the "Create Volume" command. EG
In the "incremental naming" wizard click the "enter search criteria" link
Select the approprate filter (EG search for data volumes on the vserver) and click OK
In the incremental naming wizard enter the constant name for the volume (if the filters returned no results) IE set the volume name if no data volumes exist on the vserver. Then select "providing a custom expression" and use the "nextPaddedName" MVEL function to increment the volume name. EG
nextNamePadded(last_volume.name)
The result will be:
For example:
Hope that helps? Please let me know if you have any questions?
/Matt
Thanks for your reply.
Just to clarify I'm not wanting to increment each volume that is created, what I'm aiming for is the following.
My workflow requires the users to specify a Storage Virtual machine, Cluster and CIFS Share, these are all stored as variables using. $svm for $cluster and $cifs.
Now when the new volume is created I want the name to be created automatically without the user choosing the name. The way I want it to be named is ffs_$cluster_$svm_$cifs.
So the volume name is defined by the users' input if that makes sense?
Hi,
Okay, so something like this? User can select cluster\vserver (and cifs share so they can see what shares already exist on the vserver OR type the name of a new CIFS share). EG
Is that what your trying to achieve?
/Matt
Thanks for that!
Yes, this is what I am wanting and your preview looks exactly like mine. So when I ran the preview it would complete without any issues, but when I actually attempted to run it for real I got the character issue that I mentioned at the start. If yours works outside of the preview I would appreciate a run through on how to set it up.
Cheers,
Nick.
Hi Nick
Yes the workflow executes successfully. EG
The MVEL expression i used was:
#name toLower(sanitizeVolumeName('ffs_' + vserver.cluster.name + '_' + vserver.name + '_' + $ShareName)) #junction_path '/' + toLower(sanitizeVolumeName('ffs_' + vserver.cluster.name + '_' + vserver.name + '_' + $ShareName))
The SQL query for the $ShareName variable is:
SELECT cifs_share.name FROM cm_storage.cluster, cm_storage.vserver, cm_storage.cifs_share WHERE vserver.cluster_id = cluster.id AND cifs_share.vserver_id = vserver.id AND cifs_share.path <> '/' AND vserver.name = '${VserverName}' AND ( cluster.primary_address = '${Cluster}' OR cluster.name = '${Cluster}' )
Please let me know if you have any questions?
/Matt
Worked like a charm!
Thank you.