Active IQ Unified Manager Discussions

Make One User Input Depend on the Other

TABER_BRANDEN
3,677 Views

I've been playing around with this for a while and think it can probably be done. I just can't seem to do it. How can I make a user input change based on what a user chooses up above.

For example...

If a user chooses the source controller for a new volume to be: "testnas"

I want the backup controller to automatically change to "testnas2"

Any ideas? Maybe I'm going about this the completely wrong way.

Thanks in advance.

4 REPLIES 4

shailaja
3,677 Views

Hi,

I do not know the exact rules for how your backup controller is chosen based on source controller. Lets say its purely based on names (source controller suffixed by '2') going by the example provided above.

Assumption: User inputs for the controllers are named as "SourceController" and "BackupController"

You can write the query for the "Backup Controller" something in the lines of:

SELECT

    array.name AS 'Array Name',

    array.ip AS 'Array IP',

    array.os_version AS Version

FROM

    storage.array

WHERE

    array.name = CONCAT('${SourceController}', '2')

Thanks,

Shailaja

TABER_BRANDEN
3,677 Views

Thanks Shailaja. While that solution would work for the example it won't accomplish what I'm trying to do overall. I just made up those NAS names for the example. I'll see if I can explain a bit better.

Each source controller is snapmirrored to a backup controller for disaster recovery purposes. The backup controller name is typically different from the source controller name so CONCAT will not do it.

Better Example:

If source controller is n1base01 then backup controller should be mtbase02

If source controller is ttbase01 then backup controller should be qtbase02

etc...

Thus I need to somehow do a "If source controller is this, backup controller equals this" kind of statement.

Thanks!

TABER_BRANDEN
3,677 Views

Sorry. 10 minutes later I figure it out by just changing a small thing in Shailaja's query. Here is what I came up with if anybody else needs to do something similar.

Assumptions: $ArrayName is the variable for the source filer.

                      

SELECT

    array.name AS 'Array Name',

    array.ip AS 'Array IP'

FROM

    storage.array

WHERE

'${ArrayName}' = 'sourcebase.x.x.com'

AND array.name = 'destbase.x.x.com'

OR

'${ArrayName}' = 'othersourcebase.x.x.com'

AND array.name = 'otherdestbase.x.x.com'

goodrum
3,677 Views

Another option would be to create a new dictionary/datasource (https://communities.netapp.com/videos/3351) and linking the arrays that way.  This would allow you to ultimately grow or have multiple 'potential' targets.  This would be a fairly simple data source to add and could be extended to have more 'resource pool' type of information.

Just my two bits,

Jeremy Goodrum, NetApp

The Pirate

Twitter: @virtpirate

Blog: www.virtpirate.com

Public