Active IQ Unified Manager Discussions

Only executing a volume creation workflow if aggregate is less than 90%

mdaly1234
5,716 Views

I have a workflow that creates a volume, but before it executes the volume create it checks that the aggr is below 90% full (including new volume size). I have got this MYSQL query which calculates the relevant aggregate % used:

 

SELECT
round(((((aggr.used_size_mb/1024)+'${DataSize}'))/(aggr.total_size_mb/1024)) *100,
0) as 'Aggr Used (%)'
FROM
storage.aggregate AS aggr,
storage.array AS array,
storage.volume as volume
where
aggr.name = '${aggr}'
and array.name = '${ArrayIP}'
and aggr.array_id = array.id
group by
aggr.name

 

In the create volume Advanced tab I have got it only to run if $aggrfree <=90. 

 

I see that as I preview the workflow it calculates the % fine, but when i hit go i get one of these 2 errors:

 

The value 29.0 for input $aggrfree has to be within [29] - 29 being the % full of aggregate

or

Illegal expression: $aggrfree <90 At command 'Create volume', tab 'Advanced'

 

Has anyone successfuly got something like this working, or see where I am going wrong?

 

Thanks

1 ACCEPTED SOLUTION

trentino123
5,080 Views

Hi Mdaly,

 

In the Create Volume command, I assume that you have a $aggr on the aggregate box.

 

If you hover the mouse over that box you will see three dots ( ... ) on the right. If you click there you will see the filters.

 

Did you consider the use of a filter ?

 

There is one called " filter aggregates by available capacity percentage " , there you can specify your threshold of 90 ( that could also be a constant ).

Then you would also choose a filter that let's you specify the $array_ip .

 

So those filters will execute the SQL code without you having to write it down, and you could also check the SQL code for the ' filter aggregates by available capacity percentage ' which is the following :

 

SELECT
    aggr.name,
    array.ip AS 'array.ip'
FROM
    storage.aggregate AS aggr,
    storage.array AS array
WHERE
    (
        available_size_mb/total_size_mb > ${decimal_pct}
    )
    AND aggr.array_id = array.id

 

 

So if you don't use filter but want to use your query, the modified version to dropdown aggregates on a certain array with less than decimal_pct% of utilization  could be :

 

'

 

SELECT
    aggr.name,
    array.ip AS 'array.ip'
FROM
    storage.aggregate AS aggr,
    storage.array AS array
WHERE
    (
        available_size_mb/total_size_mb > ${decimal_pct}
    )
    AND aggr.array_id = array.id

   AND aggr.array_ip = ${ArrayIP}'

   AND aggr.name = '${aggr}'

 

 

 

Thanks!

View solution in original post

14 REPLIES 14
Public