# Custom VM hooks and LCM STATE

**URL:** <https://forum.opennebula.io/t/custom-vm-hooks-and-lcm-state/10248>\
**Category:** Installation & Configuration\
**Created:** [January 13, 2022, 9:06pm UTC](https://forum.opennebula.io/t/custom-vm-hooks-and-lcm-state/10248 "2022-01-13T21:06:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_JC](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sean_jc/32/7257_2.png) [@Sean\_JC](https://forum.opennebula.io/u/Sean_JC)\
**Post date:** [January 13, 2022, 9:06pm UTC](https://forum.opennebula.io/t/custom-vm-hooks-and-lcm-state/10248/1 "2022-01-13T21:06:38Z")

</div>

I am making hooks for all the VM states, however not all states have an LCM\_STATE described here:

> **[Virtual Machines States Reference — OpenNebula 6.0.4 documentation](https://docs.opennebula.io/6.0/integration_and_development/references/vm_states.html)**

So to make a hook for a state for something like state=STOPPED I am using ON = CUSTOM, STATE = STOPPED but I am not sure what to add as LCM\_STATE if I omit it or leave it blank I get an error and the hook is not created ([one.hook.allocate] Wrong LCM\_STATE:)

What should I write for LCM\_STATE ?

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [January 17, 2022, 9:12am UTC](https://forum.opennebula.io/t/custom-vm-hooks-and-lcm-state/10248/2 "2022-01-17T09:12:03Z")

</div>

Hello @Sean_JC,

If you check the note in the documentation:

```auto
LCM_INIT state is used as LCM_STATE when the VM is in a state different than ACTIVE

```

So, if you don’t see LCM\_STATE in the table row, you need to use `LCM_INIT`.

Best,  
Álex.
