Storage Tiering Rule Engine Plugin question

78 views
Skip to first unread message

kxk...@gmail.com

unread,
May 27, 2021, 11:35:35 AM5/27/21
to iRODS-Chat
Hi,

I am trying to setup Storage Tiering Rule Engine Plugin on y local instance of irods server  (version 4.2.8) and it does not seem to work. Any help is appreciated. 
Here is a list of what I did.

1) Added the following to the 'rule_engines'  section of /etc/irods/server_config.json and restarted irods server via irodsctl restart 
            {   

                "instance_name": "irods_rule_engine_plugin-unified_storage_tiering-instance",

                "plugin_name": "irods_rule_engine_plugin-unified_storage_tiering",

                "plugin_specific_configuration": {

                }

            }

2) Created 2 storage resources and added them as children to a coordinating resource. This would be the fast tier.

iadmin mkresc storageResc1 unixfilesystem 7b7f768cbf5c:/var/lib/irods/storageVault1

iadmin mkresc storageResc2 unixfilesystem 7b7f768cbf5c:/var/lib/irods/storageVault2

iadmin mkresc replResc replication

iadmin addchildtoresc replResc storageResc1

iadmin addchildtoresc replResc storageResc2

3) Created a storage resource. This would be slow tier.

iadmin mkresc tapeResc unixfilesystem 7b7f768cbf5c:/var/lib/irods/storageVaultTape

4) Created a tier group

imeta add -R replResc irods::storage_tiering::group example_group 0

imeta add -R tapeResc irods::storage_tiering::group example_group 1

5) Set tiering policy so files are copied to slow tier after 5 seconds

imeta add -R replResc irods::storage_tiering::time 5

6) Added a file to fast tier

iput -R replResc foo.txt

The problem is file is never copied to the slow tier (tapeResc) -- It should after 5 seconds passing. but it remains on fast tier (replResc)

Thanks for your help.

Coposky, Jason Matthew

unread,
May 27, 2021, 11:41:50 AM5/27/21
to irod...@googlegroups.com
Hi,

I did not see a step where you launched the asynchronous tiering rule with irule?

You can follow these training slides which will demonstrate how to implement and test storage tiering:

iRODS User Group Meeting 2019 - Administration Training Module

Thanks,

------

Jason Coposky
Executive Director, iRODS Consortium
RENCI at the University of North Carolina at Chapel Hill
w: (919)445-9675
m: (919)522-0517
jas...@renci.org



From: irod...@googlegroups.com <irod...@googlegroups.com> on behalf of kxk...@gmail.com <kxk...@gmail.com>
Sent: Thursday, May 27, 2021 11:35 AM
To: iRODS-Chat <irod...@googlegroups.com>
Subject: [iROD-Chat:19797] Storage Tiering Rule Engine Plugin question
 
--
--
The Integrated Rule-Oriented Data System (iRODS) - https://irods.org
 
iROD-Chat: http://groups.google.com/group/iROD-Chat
---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/irod-chat/19642a8e-271f-4535-8be2-c62ed8f96972n%40googlegroups.com.

kxk...@gmail.com

unread,
May 27, 2021, 2:53:11 PM5/27/21
to iRODS-Chat
Thanks for the prompt response Jason.

I ran 'irule -F example_unified_tiering_invocation.r' and its working now!

Contents of example_unified_tiering_invocation.r is the following: 

{    "rule-engine-instance-name": "irods_rule_engine_plugin-unified_storage_tiering-instance",    "rule-engine-operation": "irods_policy_schedule_storage_tiering",    "delay-parameters": "<INST_NAME>irods_rule_engine_plugin-unified_storage_tiering-instance</INST_NAME><PLUSET>1s</PLUSET><EF>1h DOUBLE UNTIL SUCCESS OR 6 TIMES</EF>",    "storage-tier-groups": [        "example_group_g2",        "example_group"    ] } INPUT null OUTPUT ruleExecOut
 
Two questions:
1) I have created a tiering group called 'example_group'. Is the 'example_group_g2' in example_unified_tiering_invocation.r above necessary? Or can it be deleted?
2) I'm new to rules. I suppose I need to run the irule command only once, and afterwards the rule is 'deployed' (will still fire even if we re-start the server). Is this correct?

Thanks you.

Coposky, Jason Matthew

unread,
May 27, 2021, 3:03:13 PM5/27/21
to irod...@googlegroups.com
  1.  Yes, that is for example and testing purposes
  2. That is correct as the Execution Frequency is set to run forever

------
Jason Coposky
Executive Director, iRODS Consortium
RENCI at the University of North Carolina at Chapel Hill
w: (919)445-9675
m: (919)522-0517
jas...@renci.org



Sent: Thursday, May 27, 2021 2:53 PM
To: iRODS-Chat <irod...@googlegroups.com>
Subject: Re: [iROD-Chat:19799] Storage Tiering Rule Engine Plugin question
 

kxk...@gmail.com

unread,
May 27, 2021, 3:56:47 PM5/27/21
to iRODS-Chat

Thank you Json,
This pluggin is exactly what I needed. Thanks for implementing it! 

Sandi Cimerman

unread,
Apr 12, 2022, 7:00:21 AM4/12/22
to iRODS-Chat
Hi everyone,
sorry for reopening the topic. But it seems that I have the exact same issue. I have implemented the tiering plugin and executed the rule. The rule that I am using, is:
___________________________________________
{
 "rule-engine-instance-name": "irods_rule_engine_plugin-unified_storage_tiering-instance",
 "rule-engine-operation": "irods_policy_schedule_storage_tiering",
 "delay-parameters": "<INST_NAME>irods_rule_engine_plugin-unified_storage_tiering-instance</INST_NAME><PLUSET>1s</PLUSET><EF>1h
DOUBLE UNTIL SUCCESS OR 6 TIMES</EF>",
 "storage-tier-groups": [
    "example_group_g2",
    "example_group"
 ]
}
INPUT null
OUTPUT ruleExecOut

___________________________________________
which is exactly the same as the one from original poster - a copy from plugin git page [1]. When I run the rule with 'irule -F example_unified_tiering_invocation.r' the files get "bumped" up to another tier, but after that, that is it. No more rule execution after that.

I would expect that rule would remain active, since one of the original questions was
    ... I suppose I need to run the irule command only once, and afterwards the rule is 'deployed' (will still fire even if we re-start the server). Is this correct?
and Jason replied
    That is correct as the Execution Frequency is set to run forever

So what do I need to do, to make it work? Do I need to write a cronjob for to execute the rule every 5 min? What I want in the end, is the rule to remain active indefinitely.
Can you point me to the right direction?

Thanks.
Sandi

John Constable

unread,
Apr 12, 2022, 7:31:23 AM4/12/22
to irod...@googlegroups.com

We have a slightly different one;

 

{

   "rule-engine-instance-name": "irods_rule_engine_plugin-storage_tiering-instance",

   "rule-engine-operation": "irods_policy_schedule_storage_tiering",

   "delay-parameters": "<INST_NAME>irods_rule_engine_plugin-storage_tiering-instance</INST_NAME><PLUSET>1s</PLUSET><EF>30m REPEAT FOR EVER</EF>",

   "storage-tier-groups": [

       "ega_transfer_group"

   ]

}

INPUT null

OUTPUT ruleExecOut

 

So I think you will need to modify yours to;

 

{

 "rule-engine-instance-name": "irods_rule_engine_plugin-unified_storage_tiering-instance",

 "rule-engine-operation": "irods_policy_schedule_storage_tiering",

 "delay-parameters": "<INST_NAME>irods_rule_engine_plugin-unified_storage_tiering-instance</INST_NAME><PLUSET>1s</PLUSET><EF>1h

REPEAT FOR EVER </EF>",

 "storage-tier-groups": [

    "example_group_g2",

    "example_group"

 ]

}

INPUT null

OUTPUT ruleExecOut

 

Might be worth some testing around the Execution Frequency (EF), depending on your requirements Sandi?

 

Hope that helps,

 

John

iRODS User Group Meeting 2019 - Administration Training Module

 

Thanks,

 

------

Jason Coposky
Executive Director, iRODS Consortium
RENCI at the University of North Carolina at Chapel Hill
w: (919)445-9675
m: (919)522-0517
jas...@renci.org

 


From: irod...@googlegroups.com <irod...@googlegroups.com> on behalf of kxk...@gmail.com <kxk...@gmail.com>
Sent: Thursday, May 27, 2021 11:35 AM
To: iRODS-Chat <irod...@googlegroups.com>
Subject: [iROD-Chat:19797] Storage Tiering Rule Engine Plugin question

 

Hi,

I am trying to setup Storage Tiering Rule Engine Plugin on y local instance of irods server  (version 4.2.8) and it does not seem to work. Any help is appreciated. 

Here is a list of what I did.

 

1) Added the following to the 'rule_engines'  section of /etc/irods/server_config.json and restarted irods server via irodsctl restart 

            {   

                "instance_name": "irods_rule_engine_plugin-unified_storage_tiering-instance",

                "plugin_name": "irods_rule_engine_plugin-unified_storage_tiering",

                "plugin_specific_configuration": {

                }

            }

2) Created 2 storage resources and added them as children to a coordinating resource. This would be the fast tier.

 

iadmin mkresc storageResc1 unixfilesystem 7b7f768cbf5c:/var/lib/irods/storageVault1

iadmin mkresc storageResc2 unixfilesystem 7b7f768cbf5c:/var/lib/irods/storageVault2

iadmin mkresc replResc replication

iadmin addchildtoresc replResc storageResc1

iadmin addchildtoresc replResc storageResc2

3) Created a storage resource. This would be slow tier.

iadmin mkresc tapeResc unixfilesystem 7b7f768cbf5c:/var/lib/irods/storageVaultTape

4) Created a tier group

imeta add -R replResc irods::storage_tiering::group example_group 0

imeta add -R tapeResc irods::storage_tiering::group example_group 1

5) Set tiering policy so files are copied to slow tier after 5 seconds

imeta add -R replResc irods::storage_tiering::time 5

6) Added a file to fast tier

iput -R replResc foo.txt

The problem is file is never copied to the slow tier (tapeResc) -- It should after 5 seconds passing. but it remains on fast tier (replResc)

Thanks for your help.

--
--
The Integrated Rule-Oriented Data System (iRODS) - https://irods.org [irods.org]
 
iROD-Chat: http://groups.google.com/group/iROD-Chat [groups.google.com]


---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.


---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.


---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.

-- The Wellcome Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

Terrell Russell

unread,
Apr 12, 2022, 7:53:35 AM4/12/22
to irod...@googlegroups.com
Jason's original answer was incorrect as the example shared was '1h DOUBLE UNTIL SUCCESS OR 6 TIMES' - this will not remain in the queue after it succeeds.

John's correct - you need to change the <EF> to have 'REPEAT FOR EVER', as he shared in his full example.  This will replace the need for running irule repeatedly via crontab.

Terrell





---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.

Tony Edgin

unread,
Apr 12, 2022, 11:38:47 AM4/12/22
to irod...@googlegroups.com
Hi Sandi.

Briefly, you want to change your "delay-parameters" field value to "<INST_NAME>irods_rule_engine_plugin-unified_storage_tiering-instance</INST_NAME><PLUSET>1s</PLUSET><EF>1h</EF>" to make the rule executions to never stop repeating.

In more detail, the delay rule as you have written it will quit after it succeeds or after it has repeated six times.  That's what the directive DOUBLE UNTIL SUCCESS OR 6 TIMES means for execution frequency.  As you know, the <EF>nu [d]</EF> section defines execution frequency.  Here, nu is the how often to execute the rule where n is a positive integer and u is a time unit such as s for seconds, m for minutes, etc., and [d] is an optional directive indicating when to stop. For example, your execution frequency 1h DOUBLE UNTIL SUCCESS OR 6 TIMES says that if rule execution fails repeat again in one hour. If it fails again, retry again in two hours and keep retrying doubling the wait time each retry. If after six retries, the rule still fails, give up. There are several forms of directives. The one you want is  REPEAT FOR EVER, which is the default if a directive isn't provided.  So for a rule to execute every hour regardless of success, the execution frequency should be <EF>1h</EF>. Please see https://docs.irods.org/4.2.11/plugins/pluggable_rule_engine/#delay-execution for more information on delayed and periodic rule execution.

I hope this helps.

Cheers,
Tony

Sandi Cimerman

unread,
Apr 14, 2022, 11:20:42 AM4/14/22
to iRODS-Chat
Dear John, Terrell and Tony,

indeed the execution frequency was set to the wrong value. I was reading about the execution frequency, but missed how to implement it into a rule. I have fixed it and now it is working great.

I would recomend that a tiering github example would contain both options. The existing one (for testing) and additionally an example on how created a rule for the infinite loop.

@Tony, thank you for the extensive explanation. It helped me (and potential new users) a lot.

Regards,
Sandi

Terrell Russell

unread,
Jul 24, 2022, 10:50:17 PM7/24/22
to irod...@googlegroups.com

Sandi Cimerman

unread,
Jul 25, 2022, 4:33:05 AM7/25/22
to iRODS-Chat
Hi Terrel,
yes, I think now it is clear for everyone on how to implement it.
Thank you.

- Sandi
Reply all
Reply to author
Forward
0 new messages