Which means metadata was asked for, but it's not in the instance from the database so it blows up. Which means that whatever in the nova-api was calling refresh_instance_security_rules wasn't originally asking for 'metadata' so it's not in the db instance passed to refresh_instance_security_rules which goes into the object_compat decorator and we fail.
The code obviously looks wrong, if you look at the call chain, we're in:
https:/ /github. com/openstack/ nova/blob/ stable/ kilo/nova/ compute/ manager. py#L6798
Which is calling the method in the compute manager which has the object_compat decorator:
https:/ /github. com/openstack/ nova/blob/ stable/ kilo/nova/ compute/ manager. py#L1345
Then we get here:
https:/ /github. com/openstack/ nova/blob/ stable/ kilo/nova/ compute/ manager. py#L421
And metas is:
metas = ['metadata', 'system_metadata'] and used above:
expected_ attrs=metas
But metas wouldn't be set there?
So we get the KeyError and then try this:
args = (_load_ instance( args[0] ),) + args[1:]
but again metas isn't set, right?
I guess it must be in scope though otherwise there would be a different error.
Plus we get here:
https:/ /github. com/openstack/ nova/blob/ stable/ kilo/nova/ objects/ instance. py#L506
Which means metadata was asked for, but it's not in the instance from the database so it blows up. Which means that whatever in the nova-api was calling refresh_ instance_ security_ rules wasn't originally asking for 'metadata' so it's not in the db instance passed to refresh_ instance_ security_ rules which goes into the object_compat decorator and we fail.