[Openstack-operators] [nova] [neutron] Hooks for instance actions like creation, deletion
Matt Riedemann
mriedemos at gmail.com
Fri Mar 17 14:13:21 UTC 2017
On 3/17/2017 8:50 AM, Jay Pipes wrote:
> 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
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
There is also dynamic vendordata v2 which was added in Newton:
https://docs.openstack.org/developer/nova/vendordata.html
We got feedback during the Pike PTG from some people, using hooks during
instance create, that the dynamic vendordata serves their needs now.
If vendordata or notifications do not serve your use case, we suggest
you explain your use case in the open so the community can try to see if
it's something that has already been solved or is something worth
upstreaming because it's a common problem shared by multiple deployments.
--
Thanks,
Matt
More information about the OpenStack-operators
mailing list