Active IQ Unified Manager Discussions
Active IQ Unified Manager Discussions
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
Solved! See The Solution
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!
May be because comparing decimal and interger value. See if converting decimal to integer works. I see FLOOR fuction which can be used around round function. I believe round will return decimal if argument is decimal.
Thanks, but that hasn't seemed to help.....
could you re-upload the dar file, I extracted it and found 2 XML files and a META folder.
Thanks
we are running 2.2.1 as 3.0 isnt GA yet. assuming that is why WFA doesnt recognise the file(s)?
mdaly1234,
The Advanced tab for the option: "Execute this Command : If the following expression is true" expects an MVEL expression which returns a boolean true or false to WFA. So ($aggrfree <=90) will return a booloean true if $aggrfree is <=90. So abhit's solution should work.
You can also use the following MVEL expression which clearly states the action:
$aggrfree <= 90? true: false
sinhaa
That comes back with the same error when running from WFA:
The value 29.0 for input $aggrfree has to be within [29] - 29 being the % full of aggregate
would it be helpful for me to send you guys the workflow to see what is going on?
Thanks
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!
This is a great solution and also is probably better than the aggrfree <90 solution as the user cannot select the aggr that doesnt match criteria. Thanks alot!
Hi Trentino,
If in the same, one would like to calcuate the aggr over commitment as well and then take a decesion if the resize should be permited or not ?
Do we have a filter for that ?
Esp if its a case of resize volume and not create volume. AS in case of resize volume the aggr is already there, the filter is only say if the resize operation should be allowed or not ?
Regards
adai
Hi Adai,
You can add a filter to the aggregate dropdown search that is called : Filter aggregates by a given overcommitment threshold
If the volume dropdown to resize is linked to the aggregate dropdown then when you add the overcommitment threshold filter the volume that cannot be resized will not appear in the dropdown ( and neither will the aggregate with overcommitment ).
Hope it helps.
Thanks.