Skip to main content

HPE OneView Mechanism Driver for Neutron ML2 plugin

Project description

[![PyPI version](](
[![Build Status](](
[![Coverage Status](](

HPE OneView Mechanism Driver


The Mechanism Driver dynamically reflects some networking operations
made by [OpenStack Neutron]( to
These operations allows the OneView administrator to know what is
happening in the OpenStack System, and automatizes some operations.

The following diagram describes an overview of how Neutron and OneView
will interact using the Mechanism Driver. This driver uses
python-hpOneView to provide communication between Neutron and OneView

| |
| Neutron Server |
| (with ML2 plugin) |
| |
| +---------------------+
| | OneView | Ironic API +----------------+
| | Mechanism +--------------+ Ironic |
| | Driver | +----------------+
| OneView |

The OneView Mechanism Driver aims at having the Ironic-Neutron
integration for multi-tenancy working with nodes driven by the OneView
drivers for Ironic.

How the driver works

The OneView Mechanism Driver does not reflect all networking operations
in Neutron to OneView. To identify if a certain Neutron request should
be fulfilled, the Mechanism Driver checks if the networks and ports are
related with networks/connections created on OneView.

There are two cases regarding the usage of networks (both properties are
in the configuration file detailed in the following):

​1. When the user wants to map a Neutron provider network to the
OneViewUplinkSet, so that every network/port operation on this provider
network will be reflected (created) on OneView. This mapping is made
using the uplinkset\_mappings property. In this situation the
administrator defines comma-separated triples of:


These can be related to two types of Uplink Sets:

- Ethernet Uplink Sets - to support VLAN networks.
- Untagged Uplink Sets - to support flat network.

​2. When the user wants Neutron to be aware of a previously created
network on OneView, so that this network will be mapped onto a provider
network, and every port/connection operation using that provider network
will use the mapped network to attach to the connection on OneView. In
this situation the administrator defines comma-separated pairs of:


In the case of port operations, only Neutron ports related to managed
networks with the *local\_link\_information* field populated are
considered. The mechanism driver also uses the information from the MAC
address of the requested port, to identify the specific NIC of the
Server Profile where the operation should be executed. This information
can be directly configured in the Neutron port or passed by the Ironic
port field *local\_link\_connection*.

The driver also implements a fault tolerance process to guarantee that
all networks and ports that are present in Neutron are correctly
reflected in OneView. To ensure that, the verification is executed in
the startup of the mechanism driver and periodically after the
initialization. This synchronization process considers the information
from the configuration file, and the information stored in the OneView
Mechanism Driver tables present in the Neutron Database.

Considering these assumptions, OneView Mechanism Driver is capable of
the following:

- **Create a network** in OneView for each network creation request in
Neutron to the physical provider-networks configured in the driver
config file.
- **Add networks to Uplink Sets** in OneView for the mapped Uplink Set
to the physical provider-network in the driver config file.

> - Ethernet Uplink Sets are used with vlan typed provider
> networks
> - Untagged Uplink Sets are used with flat typed provider
> networks

- **Manual mapping** of Neutron flat networks onto specified
pre-existing networks of OneView.
- **Create, remove, and update connections** in Server Profiles,
implementing Neutron port binding.

> - Works only when Neutron port with binding\_vnic\_type =
> baremetal
> - Expects Server Hardware ID and boot priority in the
> local\_link\_information of the Ironic port

- **Synchronization** of all networks and ports/connections, to
provide fault tolerance.

Ironic Configuration

By default, Ironic is configured to use flat networks during the
deployment process. In order to use Ironic-Neutron integration to
provide networks isolation during deployment, some configuration is
necessary. In the ironic.conf file the following configuration should be

enabled_network_interfaces = flat,noop,neutron
default_network_interface = neutron

cleaning_network = <neutron_cleaning_network>
provisioning_network = <neutron_provisioning_network>

As mentioned in the previous section, the OneView Mechanism Driver needs
to receive the `local_link_connection` from Ironic ports to perform
networking ports operations. Once Ironic ports do not have any
information stored by default, it is necessary to update ports with the

openstack baremetal port set <port_uuid> --node <node> --local-link-connection switch_id=<switch_id> --local-link-connection switch_info='"{\"server_hardware_id\": \"<sh_id>\", \"bootable\": \"True\"}"' --local-link-connection port_id='' --pxe-enabled true

> **note**
> The Ironic OneView CLI creates Ironic ports and set
> “local\_link\_connection”.

**local\_link\_connection attributes**

- switch\_id: required, but the OneView Mechanism Driver does not deal
directly with switches. switch\_id receives any value in MAC format.
Example: 01:23:45:67:89:ab
- port\_id : required, but the OneView Mechanism Driver does not deal
directly. port\_id receives any value.
- switch\_info: will be configured with information demanded by
OneView Mechanism Driver.

> - server\_hardware\_id: identifies in which Server Hardware the
> connection to represent the new port will be created
> - bootable: indicates if this connection will be bootable or
> not. It is required for performance deploy.

To identify the port where the connection needs to be created, the MAC
address already configured in the Ironic port will be used.

Install using OpenStack

To install the OneView Mechanism Driver, access the virtual environment
on Neutron Server Container:

$ source /openstack/venvs/<neutron_venv>/bin/activate

To install the OneView Mechanism Driver, run:

$ pip install networking-oneview


1. To configure Neutron ML2 plugin, access the file:


- Add the OneView driver:

mechanism_drivers = <other_drivers>,oneview

1.1 On both containers (Neutron Server and Neutron Agent):

- Insert the networks flat,vlan:

tenant_network_types = vxlan,flat,vlan

- Insert the flat physical networks:


flat_networks = public,<flat-physical-network1>,<flat-physical-network2>

- Insert the vlan physical networks:


network_vlan_ranges = public,<vlan-physical-network1>,<vlan-physical-network2>

2. To configure the OneView configuration, access the file:


> **note**
> If you are using TLS options for communication with OneView; it is
> necessary to download the credentials ( from OneView

tls_cacert_file = <cacert_file_path>

3. In Neutron Agent, edit:


Map neutron ports used by the container as follow:

physical_interface_mappings = <flat-physical-network1-name:network-interface>,<vlan-physical-network1-name:network-interface>

4. Upgrading Neutron Database:

- Upgrade database:

$ neutron-db-manage upgrade heads

- Edit the /etc/systemd/system/\<neutron\_directory\>.service file.
: - In the property ExecStart add:


- Restart the neutron service:

$ systemctl daemon-reload && service neutron-server restart

- Restart the neutron-agent container:

$ service neutron-linuxbridge-agent restart

5. Configuring haproxy timeout in the outside container (host):

- To set the time on haproxy, edit both files:


- In the defaults section of the files, change the following lines to:

timeout client 300s
timeout connect 10s
timeout server 300s

- Restart the haproxy service:

$ service haproxy restart


OneView ML2 Mechanism Driver is distributed under the terms of the
Apache License, Version 2.0. The full terms and conditions of this
license are detailed in the LICENSE file.


Fork it, branch it, change it, commit it, and pull-request it. We are
passionate about improving this project, and are glad to accept help to
make it better. However, keep the following in mind: We reserve the
right to reject changes that we feel do not fit the scope of this
project. For feature additions, please open an issue to discuss your
ideas before doing the work.

Feature Requests

If you have a need not being met by the current implementation, please
let us know (via a new issue). This feedback is crucial for us to
deliver a useful product. Do not assume that we have already thought of
everything, because we assure you that is not the case.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

networking-oneview-1.1.0.tar.gz (42.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page