[nova][vitrage] Nova extended server attributes

Matt Riedemann mriedemos at gmail.com
Wed Dec 19 17:46:36 UTC 2018


On 12/19/2018 11:29 AM, Ifat Afek wrote:
> Is there a way to get Nova extended server attributes (and 
> specifically, OS-EXT-SRV-ATTR:instance_name) as part of the notification 
> that is sent upon instance creation?
> 
> In Vitrage we are using the immediate notifications from Nova, but this 
> specific information is missing.

We could add it into the versioned notification payload if that works 
for you (I heard vitrage was moving to using versioned notifications).

If you only need it on create, it could go here:

https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/notifications/objects/instance.py#L213

or more generically here:

https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/notifications/objects/instance.py#L25

The tricky thing about that value is it gets generated from config:

https://github.com/openstack/nova/blob/86a23f417a3e569afd74b513dc977780b40ead35/nova/objects/instance.py#L285

So depending on what "instance_name_template" is configured to be on 
each service that sends the notification, the value could be different, 
which could break unsuspecting consumers.

It looks like the instance.create.* versioned notifications all get sent 
from the nova-compute service though which aligns with how 
"instance_name_template" is used to generate the guest name in the 
hypervisor. If you only need that value for instance.create 
notifications, maybe we should just restrict it to that rather than 
*all* InstancePayload-generated versioned notifications since the value 
isn't stored in the database.

-- 

Thanks,

Matt



More information about the openstack-discuss mailing list