Active IQ Unified Manager Discussions

Question: Spare disks in Filer

raovolvoadmin
4,212 Views

Hi,

I m working on the "aggr create" workflow.I want to display the existing available "Spare disks" with the size in the workflow using the SQL query.

How to get the Spare disks info using the SQL query?.

Regards

Rao.

1 ACCEPTED SOLUTION

shailaja
4,212 Views

Hi,

 

Disk information in WFA cache is available only from 2.0.1 release and so I hope you are using the 2.0.1 release which is the latest.

Once the cache acquisition is done from your OnCommand data source, you can use queries to know spare disk information.

Something like:

 

Array user input:

------------------

SELECT

    array.ip AS 'Array Primary Address',

    array.name AS 'Array Name',

    COUNT(disk.name) AS 'Spare Disk Count',

    SUM(disk.size_mb) AS 'Total Spare Disk Size (MB)'

FROM

    storage.array,

    storage.disk

WHERE

    disk.array_id = array.id

    AND disk.role = 'spare'

GROUP BY

    disk.array_id

Spare Disk list:

------------------

SELECT

    disk.name AS DiskName,

    disk.type AS Type,

    disk.size_mb AS 'Size (MB)'

FROM

    storage.disk,

    storage.array

WHERE

    role = 'spare'

    AND array.id = disk.array_id

    AND array.ip = '${ArrayIP}'

These queries can be modified based on what exactly you would like to display or in filters based on your workflow design.

Attachments:

- A sample output of the first query from some test systems.

- A sample output of the second query from some test systems.

- Definition of "storage.Disk" dictionary entry which internally becomes the cache table definition.

Thanks,

Shailaja

View solution in original post

4 REPLIES 4

shailaja
4,213 Views

Hi,

 

Disk information in WFA cache is available only from 2.0.1 release and so I hope you are using the 2.0.1 release which is the latest.

Once the cache acquisition is done from your OnCommand data source, you can use queries to know spare disk information.

Something like:

 

Array user input:

------------------

SELECT

    array.ip AS 'Array Primary Address',

    array.name AS 'Array Name',

    COUNT(disk.name) AS 'Spare Disk Count',

    SUM(disk.size_mb) AS 'Total Spare Disk Size (MB)'

FROM

    storage.array,

    storage.disk

WHERE

    disk.array_id = array.id

    AND disk.role = 'spare'

GROUP BY

    disk.array_id

Spare Disk list:

------------------

SELECT

    disk.name AS DiskName,

    disk.type AS Type,

    disk.size_mb AS 'Size (MB)'

FROM

    storage.disk,

    storage.array

WHERE

    role = 'spare'

    AND array.id = disk.array_id

    AND array.ip = '${ArrayIP}'

These queries can be modified based on what exactly you would like to display or in filters based on your workflow design.

Attachments:

- A sample output of the first query from some test systems.

- A sample output of the second query from some test systems.

- Definition of "storage.Disk" dictionary entry which internally becomes the cache table definition.

Thanks,

Shailaja

raovolvoadmin
4,211 Views

It's worked.Thanks you very much.I really appreciate your help.

I always have trouble to create SQL queries:-(.Where do i get the help for SQL queries?.

shailaja
4,211 Views

Glad to know it worked for you.

>> I always have trouble to create SQL queries:-(.Where do i get the help for SQL queries?.

Well, two points on this:

1. In order to help in this area, we are providing auto-complete functionality when writing SQL queries (user input queries as well as filter queries) in the upcoming release of WFA.

2. Additionally, the following link can also help

http://dev.mysql.com/doc/refman/5.1/en/select.html

Thanks,

Shailaja

raovolvoadmin
4,211 Views

ok.thanks for your help:-).

Public