]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Notify nova when ports are ready
authorAaron Rosen <aaronorosen@gmail.com>
Fri, 21 Feb 2014 00:18:11 +0000 (16:18 -0800)
committerAaron Rosen <aaronorosen@gmail.com>
Fri, 14 Mar 2014 00:19:21 +0000 (17:19 -0700)
commit827cc5170546e88e5c4ab721f69b8501371e3948
treea5b92454b0d10161d5b0b15272522343695f6eef
parent3f0af0e4dcf55cfa6ba23a27507b6b27f899e139
Notify nova when ports are ready

The following patch adds a callback from neutron to nova that notifies nova
when a port for an instance is *ready to be used*. After nova receives this
event it will then start the instance in a hope that when it comes up
its networking should be in working order.

NOTE: *ready to be used* currently means that a plugin changes the status
in the db associated with a port from:
NO_VALUE/PORT_STATUS_DOWN/PORT_STATUS_ACTIVE to ACTIVE/ERROR.

Neutron will then signal nova: network_vif_plugged:<status> where status
will either be 'completed' or 'failed' given the neutron port status.

Neutron also notifies nova when a port goes from status:
PORT_STATUS_ACTIVE to PORT_STATUS_DOWN and sends nova a network_vif_unplugged
event.

Currently this patch breaks multiregion support (i.e previously you could
back multiple nova regions by one neutron server) though now since neutron
needs to notify nova we'll need to add a way to determine which region a
given port is in.

For now the work around for this would be to set: notify_nova_port_active=False
in neutron to prevent neutron from sending the notification and setting:
vif_plugging_is_fatal=False in nova.conf. Doing this will keep the current
interaction where an instance will be booted without waiting for the network
to be ready.

DocImpact

implements blueprint: nova-event-callback

Change-Id: I4177124485b986706fcf8e73b928024b5d82b822
etc/neutron.conf
neutron/common/config.py
neutron/db/db_base_plugin_v2.py
neutron/db/models_v2.py
neutron/notifiers/__init__.py [new file with mode: 0644]
neutron/notifiers/nova.py [new file with mode: 0644]
neutron/tests/unit/notifiers/__init__.py [new file with mode: 0644]
neutron/tests/unit/notifiers/test_notifiers_nova.py [new file with mode: 0644]
neutron/tests/unit/test_db_plugin.py