Active IQ Unified Manager Discussions

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

mdaly1234
5,704 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,068 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

karale
5,654 Views

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.

mdaly1234
5,637 Views

Thanks, but that hasn't seemed to help.....

abhit
5,628 Views

($aggrfree <=90). The two parentheses seems to make it work.

Attached is a workflow.


Regards

Abhi

mdaly1234
5,622 Views

could you re-upload the dar file, I extracted it and found 2 XML files and a META folder.

 

Thanks

abhit
5,615 Views
You just need to import the .dar file. It is just a sample. You need 3.0.0 to import the .dar file.

mdaly1234
5,611 Views

we are running 2.2.1 as 3.0 isnt GA yet. assuming that is why WFA doesnt recognise the file(s)?

abhit
5,604 Views
That is correct. Will give you da dar file built with 2.2.1 tomorrow.

sinhaa
5,587 Views

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

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

mdaly1234
5,575 Views

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

 

abhit
5,044 Views

Please check the attached dar made with 2.2.1.

Please look into the advanced tab of the "Test" command in the "Test Workflow".

 

Regards

Abhi

trentino123
5,069 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!

mdaly1234
5,010 Views

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!

Adai
4,986 Views

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

trentino123
4,980 Views

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.

Public