General Discussion

Invalid Character '.' in Workflow Automation

Nwilkinson
4,992 Views

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.

1 ACCEPTED SOLUTION

mbeattie
4,905 Views

Hi Nick

 

Yes the workflow executes successfully. EG

vol14.png

 

 

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

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

View solution in original post

6 REPLIES 6

mbeattie
4,961 Views

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

 

vol10.png

 

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

 

vol11.png

 

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

 

inputs.png

 

Cluster:

 

cluster.png

 

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:

 

vol2.png

 

 

 

 

 

 

 

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

 

vol7.png

 

In the "incremental naming" wizard click the "enter search criteria" link

 

vol8.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Select the approprate filter (EG search for data volumes on the vserver) and click OK

 

vol5.png

 

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

 

vol4.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

nextNamePadded(last_volume.name)

The result will be:

 

  • If no volumes exist on the vserver it will create the first volume using the constant value (EG 'volume_001')
  • If a volume already exists using the naming standard defined in the constant it will increment the volume name and create the next volume (EG 'volume_002' )

For example:

 

vol9.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Hope that helps? Please let me know if you have any questions?

 

/Matt

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

Nwilkinson
4,949 Views

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? 

 

mbeattie
4,932 Views

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

 

vol13.png

 

 

 

vol12.png

 

 

 

 

 

 

 

 

 

 Is that what your trying to achieve?

 

/Matt

 

 

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

Nwilkinson
4,929 Views

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.

mbeattie
4,906 Views

Hi Nick

 

Yes the workflow executes successfully. EG

vol14.png

 

 

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

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

Nwilkinson
4,879 Views

Worked like a charm!

 

Thank you.

Public