<div dir="ltr"><div>Hi,</div><div><br></div><div>Indeed, Vitrage now uses the Nova versioned notifications (we pushed that code a few days ago).</div><div>I'm only interested at the instance.create.* notifications, so I'll try to add the OS-EXT-SRV-ATTR:instance_name where you suggested. </div><div><br></div>Thanks!<div>Ifat<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 19, 2018 at 7:52 PM Matt Riedemann <<a href="mailto:mriedemos@gmail.com">mriedemos@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12/19/2018 11:29 AM, Ifat Afek wrote:<br>
> Is there a way to get Nova extended server attributes (and <br>
> specifically, OS-EXT-SRV-ATTR:instance_name) as part of the notification <br>
> that is sent upon instance creation?<br>
> <br>
> In Vitrage we are using the immediate notifications from Nova, but this <br>
> specific information is missing.<br>
<br>
We could add it into the versioned notification payload if that works <br>
for you (I heard vitrage was moving to using versioned notifications).<br>
<br>
If you only need it on create, it could go here:<br>
<br>
<a href="https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/notifications/objects/instance.py#L213" rel="noreferrer" target="_blank">https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/notifications/objects/instance.py#L213</a><br>
<br>
or more generically here:<br>
<br>
<a href="https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/notifications/objects/instance.py#L25" rel="noreferrer" target="_blank">https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/notifications/objects/instance.py#L25</a><br>
<br>
The tricky thing about that value is it gets generated from config:<br>
<br>
<a href="https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/objects/instance.py#L285" rel="noreferrer" target="_blank">https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/objects/instance.py#L285</a><br>
<br>
So depending on what "instance_name_template" is configured to be on <br>
each service that sends the notification, the value could be different, <br>
which could break unsuspecting consumers.<br>
<br>
It looks like the instance.create.* versioned notifications all get sent <br>
from the nova-compute service though which aligns with how <br>
"instance_name_template" is used to generate the guest name in the <br>
hypervisor. If you only need that value for instance.create <br>
notifications, maybe we should just restrict it to that rather than <br>
*all* InstancePayload-generated versioned notifications since the value <br>
isn't stored in the database.<br>
<br>
-- <br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
</blockquote></div></div></div>