Comment 0 for bug 1570731

Revision history for this message
Marc Koderer (m-koderer) wrote :

Problem:
---
If device_owner is not known to the cisco mech driver it stops the binding process (see def _is_supported_deviceowner(self, port):)
In case of vnic_type == baremetal this behaviour leads to an inconsistency.
If the device_owner is not known it still fulfils the binding when a baremetal port_create request comes in.

This lead to the following situation:
- The baremetal port will be set to active (https://github.com/openstack/networking-cisco/blob/master/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py#L592)
- But the switch isn't reconfigured at all (and no db entry will be written) due to the if-condition in:
https://github.com/openstack/networking-cisco/blob/master/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py#L1647

Setup:
----
 1x Compute node
 1x Cisco Nexus switch
 1x Netapp storage filer

Devstack:
enable_plugin networking-cisco
Using OpenStack Manila with port binding feature see [1, 2]

1.) Manila sends a port create with the following content:
 binding:host_id: netapp_lab42
 binding:vnic_type: baremetal
 device_owner: manila:share
 "local_link_information": [{"switch_info": "{\"switch_ip\": \"10.20.90.250\"}", "port_id": "1/15", "switch_id": "10.20.90.250"}]}

2.) Cisco mech driver accepts the binding request and fulfils the binding:

neutron port-show 06141d0e-d6ff-4f8b-97da-7eb4322dbb51 |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | netapp_lab42 |
| binding:profile | {"local_link_information": [{"switch_info": "{\"switch_ip\": \"10.20.90.250\"}", "port_id": "1/15", "switch_id": "10.20.90.250"}]} |
| binding:vif_details | {} |
| binding:vif_type | other |
| binding:vnic_type | baremetal |
| created_at | 2016-04-14T13:07:27 |
| description | |
| device_id | fe285ae8-b46d-4b5c-91ae-9e471f984c3a |
| device_owner | manila:share |
| dns_name | |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "eb947a20-c541-47d2-af16-ea13f48f08ef", "ip_address": "10.10.30.20"} |
| id | 06141d0e-d6ff-4f8b-97da-7eb4322dbb51 |
| mac_address | fa:16:3e:a3:c1:d4 |
| name | |
| network_id | 699a679b-bf3d-4426-912a-39818811a139 |
| port_security_enabled | True |
| security_groups | a0104b4f-1255-40bd-84ae-c5ad59c2f5b8 |
| status | ACTIVE |
| tenant_id | 23d0afaca4b441ad934b9e3944afe4a8 |
| updated_at | 2016-04-14T13:07:27 |
+-----------------------+——————————————————————————————————————————————————————————————————+

Logs:
2016-04-14 15:26:19.798 DEBUG neutron.plugins.ml2.managers [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] Attempting to bind port 65023464-510f-4a43-b936-8749c409f3b6 on host netapp_lab42 at level 0 using segments [{'segmentation_id': 961, 'physical_network': u'mynetwork', 'id': u'03daa432-70e1-415c-a80a-5e5905529af4', 'network_type': u'vlan'}] from (pid=10023) _bind_port_level /opt/stack/neutron/neutron/plugins/ml2/managers.py:710
2016-04-14 15:26:19.798 DEBUG neutron.plugins.ml2.drivers.mech_agent [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] Attempting to bind port 65023464-510f-4a43-b936-8749c409f3b6 on network 699a679b-bf3d-4426-912a-39818811a139 from (pid=10023) bind_port /opt/stack/neutron/neutron/plugins/ml2/drivers/mech_agent.py:60
2016-04-14 15:26:19.799 DEBUG neutron.plugins.ml2.drivers.mech_agent [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] Refusing to bind due to unsupported vnic_type: baremetal from (pid=10023) bind_port /opt/stack/neutron/neutron/plugins/ml2/drivers/mech_agent.py:65
2016-04-14 15:26:19.799 DEBUG networking_cisco.plugins.ml2.drivers.cisco.nexus.mech_cisco_nexus [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] Attempting to bind port 65023464-510f-4a43-b936-8749c409f3b6 on network 699a679b-bf3d-4426-912a-39818811a139 from (pid=10023) bind_port /opt/stack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py:1774
2016-04-14 15:26:19.800 DEBUG networking_cisco.plugins.ml2.drivers.cisco.nexus.mech_cisco_nexus [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] Baremetal binding selected: segment ID 03daa432-70e1-415c-a80a-5e5905529af4, segment 961, phys net mynetwork, and network type vlan with 1 link_info from (pid=10023) _supported_baremetal_transaction /opt/stack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py:608
2016-04-14 15:26:19.806 DEBUG neutron.plugins.ml2.managers [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] Bound port: 65023464-510f-4a43-b936-8749c409f3b6, host: netapp_lab42, vif_type: other, vif_details: {}, binding_levels: [{'bound_driver': 'cisco_nexus', 'bound_segment': {'segmentation_id': 961, 'physical_network': u'mynetwork', 'id': u'03daa432-70e1-415c-a80a-5e5905529af4', 'network_type': u'vlan'}}] from (pid=10023) _bind_port_level /opt/stack/neutron/neutron/plugins/ml2/managers.py:758
2016-04-14 15:26:19.830 DEBUG neutron.plugins.ml2.db [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] For port 65023464-510f-4a43-b936-8749c409f3b6, host netapp_lab42, cleared binding levels from (pid=10023) clear_binding_levels /opt/stack/neutron/neutron/plugins/ml2/db.py:118
2016-04-14 15:26:19.830 DEBUG neutron.plugins.ml2.db [req-1361d34a-17b7-4f92-a5b2-e0ed1db64f71 neutron dbd665e4da03490cb98edc5a775af4db] For port 65023464-510f-4a43-b936-8749c409f3b6, host netapp_lab42, set binding levels [<neutron.plugins.ml2.models.PortBindingLevel[object at 7f31d0052390] {port_id='65023464-510f-4a43-b936-8749c409f3b6', host=u'netapp_lab42', level=0, driver='cisco_nexus', segment_id=u'03daa432-70e1-415c-a80a-5e5905529af4'}>] from (pid=10023) set_binding_levels /opt/stack/neutron/neutron/plugins/ml2/db.py:91