Neutron/Spec-NVPPlugin-MacLearning

= Mac Learning Extension support for NVP Plugin =

Scope
The aim of this blueprint is to implement support for the mac learning API extension in the NVP Plugin.

Use Cases
The use case for this blueprint is to allow the ability to enable/disable mac learning functionality on a logical port. The NVP model of "learning MAC addresses" is based on OVS vSwitch sending MAC's to the controller, based on integration with hypervisor platform. With this functionality MAC addresses can be learned at the edge, thus allowing VM's to use any MAC address. Learning of other MAC addresses via a logical port is required to define multiple MAC addresses behind the interface connected to that logical port. This would allow a nested Hypervisor, for example, to properly function in an environment where the network is virtualized via NVP, this is specially important in Dev/Test environments.

Implementation Overview
The implementation will be performed in the same way port security support has been implemented. Basically, the plugin will provide the data model classes for dealing with bindings between logical ports and the mac learning status; The plugin will also process authorization for the operation; finally the plugin will extend responses including the mac learning attribute where appropriate.

Data Model Changes
Proposed data model changes are inline with the way this extension has been implemented by other plugins:

|| MacLearningState || || port_id || String || ForeignKey('ports.id', ondelete="CASCADE" || primary_key=True ||   || mac_learning_enabled || Boolean || nullable=False ||

Configuration variables
None

API
This blueprint will not change the API, however with this extension port creation requests can specify a mac_learning_enabled attribute to set the mac learning status on the specified port.

Test Cases
NVP specific unit tests for validating code in the plugin will be added to the test_maclearning module.

Client changes
The python-quantumclient is pretty smart at handling extension attributes. To leverage this extension it is enough to specify a --mac_learning_enabled [ True | False ] option on the CLI. So the following commands are possible:


 * quantum port-create $network_label --mac-learning-enabled
 * quantum port-update $port_label --mac-learning-enabled False

When you show the port attributes, the mac learning status will appear only if set to True.