[Openstack-operators] [nova] [neutron] Hooks for instance actions like creation, deletion
Jay Pipes
jaypipes at gmail.com
Fri Mar 17 13:50:02 UTC 2017
On 03/16/2017 10:48 PM, Masha Atakova wrote:
> Hi everyone,
>
> Is there any up-to-date functionality in nova / neutron which allows to
> run some additional code triggered by changes in instance like creating
> or deleting an instance?
>
> I see that nova hooks are deprecated as of Nova 13:
>
> https://github.com/openstack/nova/blob/master/nova/hooks.py#L19
>
> While it's hard to find the reason for this deprecation, I also struggle
> to find if there's any up-to-date alternative to those hooks.
The hooks were for internal (to Nova) code triggers and made the
behaviour of Nova potentially inconsistent between deployments, which
limited interoperability.
The way to trigger additional code running on changes to instance state
is to listen on the outbound Nova notifications message queue topic.
Listen to the notifications queue topic for instance.create[.start|end]
and instance.delete events. You can read more about the notifications
queue and how to set up a subscriber here:
http://alesnosek.com/blog/2015/05/25/openstack-nova-notifications-subscriber/
Best,
-jay
More information about the OpenStack-operators
mailing list