Active IQ Unified Manager Discussions

Dynamically select a Dataset (Add volume to Dataset)

GARDINEC_EBRD
6,115 Views

Hi All,

Scratching my head here - wonder of someone can help?

I have 4 datasets which do the same thing, but at staggered schedules.  This is because I can't update all our Oracle mirrors using the same schedule as it overloads the source filers.

So I have datasets called  'ORA 1', 'ORA 2', 'ORA 3' & 'ORA 4'.  When we provision storage for a new database, it gets added to the dataset with the least resources (thus keeping them evenly balanaced, more or less).  So I want to do the same thing within a workflow using the 'Add volume to dataset' command.

I've created a filter which finds datasets by name prefix, and returns the dataset names in order of the number of resources, using the following SQL:

SELECT

    dataset.name,

    dataset.qtree_id,

    dataset.id,

    dataset.dfm_name,

    dataset.volume_id,

    dataset.uuid,

    count(*)

FROM

    storage.dataset

WHERE

    dataset.name like '${name}%'

GROUP BY

    dataset.name

ORDER BY

    count(*) asc

So, if $name is 'ORA %' then it returns my 4 datasets in the correct order.

The question is, how can I use this filter/finder in the 'Add Volume to Dataset' command?  In the Dataset tab, I only get the option of using an 'Incremental Naming Wizard' for the dataset name field, but not sure this is what I'm looking for.  Any thoughts?

WFA 2.0, Windows.

Many thanks,

Craig

1 ACCEPTED SOLUTION

kandati
6,115 Views

Hi Craig,

In the Dataset Tab, instead of selecting "Fill-in attributes for OraDatafiles and execute this command", select either "Abort Workflow" or "Disable command" drop-down option for "If OraDataFiles was not found" condition, I have attached this settings in my first post. "Disable command" option can be selected if you have use-case that in your workflow, there are some other commands after this "Add volume to Dataset" command and those commands needs to be executed irrespective of this command's execution status.

After this correct option selection,  you would be able to see the proper condition in Advanced Tab as you wished..!

Hope this helps.

Warm Regards

Sivaprasad K

View solution in original post

6 REPLIES 6

kandati
6,115 Views

Hi Craig,

There is a easy way to use the existing dataset (using filter/finder)  in 'Add Volume to Dataset' command.

In the "Add Volume to Dataset" command details-> Dataset Tab, select "by searching for an existing Dataset" drop-down option against "Define Dataset: " field as shown in the attachment.

And in the search criteria, select your filter/finder for dataset selection.

For, "If dataset1 is not found" condition, you can select any one of the drop-down option according to your use-case.

And that's it, you are done!!

Warm Regards

Sivaprasad K

GARDINEC_EBRD
6,115 Views

Hi Sivaprasad K,

Thanks for the reply.  That works, but it introduces another problem for me:- I'm also using the Advanced tab in the command to determine whether to run the command based on the value of the user variable $ProtectionLevel.  So, if $ProtectionLevel is Gold, Silver or Bronze it will execute the command, otherwise it will not.  When I set the Dataset name option to "by searching for an existing Dataset" as you suggest, it changes the 'Advanced' tab for the command - it now only executes the command if the Dataset was not found AND $ProtectionLevel is Gold, Silver or Bronze.

What I want to do is run the command if the $ProtectionLevel variable is correct and if the Dataset was found

Thanks in advance,

Craig

kandati
6,115 Views

Hi Craig,

I'm trying your use case in my environment..!

In meanwhile, can you please share Dataset tab & Advanced tab images to get better understanding, like what option you have chosen for "If dataset1 is not found" condition in Dataset tab.

Thanks

Sivaprasad K

GARDINEC_EBRD
6,115 Views

Thanks Sivaprasad K, I appreciate your help with this!!

Here's how I had it set up originally (by specifying the dataset name implicitly):

Here's the new setup (searching for dataset by name):

kandati
6,116 Views

Hi Craig,

In the Dataset Tab, instead of selecting "Fill-in attributes for OraDatafiles and execute this command", select either "Abort Workflow" or "Disable command" drop-down option for "If OraDataFiles was not found" condition, I have attached this settings in my first post. "Disable command" option can be selected if you have use-case that in your workflow, there are some other commands after this "Add volume to Dataset" command and those commands needs to be executed irrespective of this command's execution status.

After this correct option selection,  you would be able to see the proper condition in Advanced Tab as you wished..!

Hope this helps.

Warm Regards

Sivaprasad K

GARDINEC_EBRD
6,115 Views

Ah, OK, I see:- so if either of those options are selected it changes the criteria from 'do this if not found" to "do this if found".  Subtle difference, but it works as you say.

Thank you very much for the help,

Craig

Public