# Periodic actions with relative time in template

**URL:** <https://forum.opennebula.io/t/periodic-actions-with-relative-time-in-template/11596>\
**Category:** Product Support\
**Created:** [October 18, 2023, 10:14am UTC](https://forum.opennebula.io/t/periodic-actions-with-relative-time-in-template/11596 "2023-10-18T10:14:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Ruiz\_Molina](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@Daniel\_Ruiz\_Molina](https://forum.opennebula.io/u/Daniel_Ruiz_Molina)\
**Post date:** [October 18, 2023, 10:14am UTC](https://forum.opennebula.io/t/periodic-actions-with-relative-time-in-template/11596/1 "2023-10-18T10:14:20Z")

</div>

Hello,

I would like to apply a “action” to a template. What I need is an action that runs a “undeploy-hard” after 15 minutes after starting a VM but I need that each time the VM is started, action runs after 15 minutes, so I need a “periodic action with relative time”.

Configuring a “relative time” action is easy:

 ![Screenshot 2023-10-18 at 11-55-47 OpenNebula Sunstone Cloud Operations Center](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/9/91a39929fc5db197de257b3a1e3c04c5443377be.png)

However, if I want that this action could be rerun after 15 minutes each time VM is started, OpenNebula (6.4.0) doesn’t allow it. Or action is “Relative Time”:

 ![Screenshot 2023-10-18 at 12-11-40 OpenNebula Sunstone Cloud Operations Center](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/f/f79d0fc28dee1590752e24c4816c59f87eeb883e.png)

or action is “periodic”, but with this option, I can’t select after how many “relative” minutes I want to rerun the action:

 ![Screenshot 2023-10-18 at 12-13-04 OpenNebula Sunstone Cloud Operations Center](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/8/824680905e56d59bd39c3b0f9beb9424f47814e1.png)

Is there any way to configure what I need?

Thanks.

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [October 18, 2023, 4:34pm UTC](https://forum.opennebula.io/t/periodic-actions-with-relative-time-in-template/11596/2 "2023-10-18T16:34:34Z")

</div>

If you need to trigger an operation for every VM after every time the VM gets to running you are probably better off with VM state hooks and implement the 15 min delayed execution there.

For a more native approach please open a [feature request](https://github.com/OpenNebula/one/issues/new?assignees=&labels=Type%3A+Feature&projects=&template=enhancement-request.md). It could be either or both a delayed hook execution and a “periodic action with relative time”.
