Migration from ml2/ovs fails because instances don't get ssh keys
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| networking-ovn |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
Description of problem:
On Port_Binding event ovn metadata agent fails, that leads to no haproxy processes spawned in the namespace and newly created instances won't get access to metadata API.
2019-04-16 09:10:48.961 182681 INFO networking_
2019-04-16 09:10:49.728 182681 ERROR networking_
2019-04-16 09:10:49.728 182681 ERROR networking_
2019-04-16 09:10:49.728 182681 ERROR networking_
2019-04-16 09:10:49.728 182681 ERROR networking_
2019-04-16 09:10:49.728 182681 ERROR networking_
2019-04-16 09:10:49.728 182681 ERROR networking_
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event [-] Unexpected exception in notify_loop: KeyError: u'br-migration'
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event Traceback (most recent call last):
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event match.run(event, row, updates)
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event return f(*args, **kwargs)
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event self.agent.
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event self.provision_
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event "the system.", self.ovn_bridge)
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event self.force_
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event six.reraise(
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event File "/usr/lib/
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event ovs_bridges.
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event KeyError: u'br-migration'
2019-04-16 09:10:49.729 182681 ERROR ovsdbapp.event
Version-Release number of selected component (if applicable):
python-
How reproducible:
Always
Steps to Reproduce:
1. Migrate to OVN
2. Spawn an instance with keypair
3.
Actual results:
Instance won't get SSH key injected because of failing metadata
Expected results:
Additional info:
The reason is that ovn-controller is spawned while br-migration bridge exists in the system. ovn-controller spawns ovn-metadata-agent that caches its bridge settings. Later, br-migration is removed and br-int is set in ovsdb, however agent doesn't reflect that because it uses cached value from the time process was started.

Reviewed: https:/ /review. opendev. org/655360 /git.openstack. org/cgit/ openstack/ networking- ovn/commit/ ?id=2037bfe5626 c8d451786feae87 9cfb7aa80c8123
Committed: https:/
Submitter: Zuul
Branch: master
commit 2037bfe5626c8d4 51786feae879cfb 7aa80c8123
Author: Jakub Libosvar <email address hidden>
Date: Tue Apr 23 14:32:28 2019 +0000
metadata: Resync agent when misconfiguration is detected
In case of migration, the metadata agent is kept running with old sisEvent in case
br-migration bridge cached in agent's attribute. Everything else is
configured correctly but agent still uses old value. This patch adds a
resync mechanism that's triggered by PortBindingChas
agent fails to use currently cached bridge and the bridge doesn't exist
on the system.
Closes-bug: #1824984 29136622b4356ce 59234ab023a
Change-Id: Ia17ad3476e61a7