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!