Subscribe
Accepted Solution

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

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

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

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.

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

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

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

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

Attached is a workflow.


Regards

Abhi

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

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

 

Thanks

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

You just need to import the .dar file. It is just a sample. You need 3.0.0 to import the .dar file.

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

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

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

That is correct. Will give you da dar file built with 2.2.1 tomorrow.

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

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.

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

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