Active IQ Unified Manager Discussions

simple query help needed

MPERIYAK
3,552 Views

I am new to this and need some basic help on a query.

All I need is, the list of vfiler names and the corresponding Array IP's to be populated in the first column

I then choose a vFiler and array IP from the list and it lists all the corresponding volumes on that vFiler

This is not sufficient

SELECT

    vfiler.name

FROM

    storage.vfiler

WHERE

    (

        vfiler.name <> "vfiler0"

}

and secondly

select

    storage.volume.name,

storage.volume.size_mb

from

storage.vfiler,

storage.volume,

storage.array

where

    storage.array.ip = '${PrimaryArrayIP}'

group by

    storage.volume.name

3 REPLIES 3

jakob_scheidler
3,552 Views

Hey,

something like this? Actually I would use three select fields mostly because it looks nicer in my eyes. Like filer -> vfiler -> volumes. Problem is, if you can't be sure that there are never duplicate vfiler names you will need the filer for selecting the volumes.

SELECT

CONCAT(vfiler.name,'  -  ',array.ip)

FROM

storage.vfiler

JOIN storage.array ON vfiler.array_id = array.id

WHERE vfiler.name NOT LIKE 'vfiler0'

SELECT

volume.name

volume.size_mb

FROM

storage.volume

JOIN storage.vfiler ON volume.vfiler_id = vfiler.id

JOIN storage.array ON volume.array_id = array.id

WHERE vfiler.name LIKE TRIM(SUBSTRING_INDEX('${ResultOfFirstQuery}','-',1))

AND array.ip LIKE TRIM(SUBSTRING_INDEX('${ResultOfFirstQuery}','-',-1))

Regards

shailaja
3,552 Views

Hi,

Even I would agree that having three inputs like the above mentioned by Jakob would be nice. If you are fine with that, you can look at the queries used in the sample workflow named "Create a Qtree CIFS share in a vFiler"

There are queries that list the filers, the vfilers in the selected filer and finally the volumes of the selected vFiler.

Thanks,

Shailaja

MPERIYAK
3,552 Views

Thanks to both. Your suggestions helped me.

Public