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.
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:
Problem: deviceowner( self, port):)
---
If device_owner is not known to the cisco mech driver it stops the binding process (see def _is_supported_
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: /github. com/openstack/ networking- cisco/blob/ master/ networking_ cisco/plugins/ ml2/drivers/ cisco/nexus/ mech_cisco_ nexus.py# L592) /github. com/openstack/ networking- cisco/blob/ master/ networking_ cisco/plugins/ ml2/drivers/ cisco/nexus/ mech_cisco_ nexus.py# L1647
- The baremetal port will be set to active (https:/
- But the switch isn't reconfigured at all (and no db entry will be written) due to the if-condition in:
https:/
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: link_informatio n": [{"switch_info": "{\"switch_ip\": \"10.20.90.250\"}", "port_id": "1/15", "switch_id": "10.20.90.250"}]}
binding:host_id: netapp_lab42
binding:vnic_type: baremetal
device_owner: manila:share
"local_
2.) Cisco mech driver accepts the binding request and fulfils the binding:
neutron port-show 06141d0e- d6ff-4f8b- 97da-7eb4322dbb 51 | ------- ------- ---+--- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---+ ------- ------- ---+--- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---+ address_ pairs | | link_informatio n": [{"switch_info": "{\"switch_ip\": \"10.20.90.250\"}", "port_id": "1/15", "switch_id": "10.20.90.250"}]} | b46d-4b5c- 91ae-9e471f984c 3a | c541-47d2- af16-ea13f48f08 ef", "ip_address": "10.10.30.20"} | d6ff-4f8b- 97da-7eb4322dbb 51 | bf3d-4426- 912a-39818811a1 39 | enabled | True | 1255-40bd- 84ae-c5ad59c2f5 b8 | d934b9e3944afe4 a8 | ------- ------- ---+——— ——————— ——————— ——————— ——————— ——————— ——————— ——————— ——————— ——————— +
+------
| Field | Value |
+------
| admin_state_up | True |
| allowed_
| binding:host_id | netapp_lab42 |
| binding:profile | {"local_
| binding:vif_details | {} |
| binding:vif_type | other |
| binding:vnic_type | baremetal |
| created_at | 2016-04-14T13:07:27 |
| description | |
| device_id | fe285ae8-
| device_owner | manila:share |
| dns_name | |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "eb947a20-
| id | 06141d0e-
| mac_address | fa:16:3e:a3:c1:d4 |
| name | |
| network_id | 699a679b-
| port_security_
| security_groups | a0104b4f-
| status | ACTIVE |
| tenant_id | 23d0afaca4b441a
| updated_at | 2016-04-14T13:07:27 |
+------
Logs: plugins. ml2.managers [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] Attempting to bind port 65023464- 510f-4a43- b936-8749c409f3 b6 on host netapp_lab42 at level 0 using segments [{'segmentation _id': 961, 'physical_network': u'mynetwork', 'id': u'03daa432- 70e1-415c- a80a-5e5905529a f4', 'network_type': u'vlan'}] from (pid=10023) _bind_port_level /opt/stack/ neutron/ neutron/ plugins/ ml2/managers. py:710 plugins. ml2.drivers. mech_agent [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] Attempting to bind port 65023464- 510f-4a43- b936-8749c409f3 b6 on network 699a679b- bf3d-4426- 912a-39818811a1 39 from (pid=10023) bind_port /opt/stack/ neutron/ neutron/ plugins/ ml2/drivers/ mech_agent. py:60 plugins. ml2.drivers. mech_agent [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] 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 cisco.plugins. ml2.drivers. cisco.nexus. mech_cisco_ nexus [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] Attempting to bind port 65023464- 510f-4a43- b936-8749c409f3 b6 on network 699a679b- bf3d-4426- 912a-39818811a1 39 from (pid=10023) bind_port /opt/stack/ networking- cisco/networkin g_cisco/ plugins/ ml2/drivers/ cisco/nexus/ mech_cisco_ nexus.py: 1774 cisco.plugins. ml2.drivers. cisco.nexus. mech_cisco_ nexus [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] Baremetal binding selected: segment ID 03daa432- 70e1-415c- a80a-5e5905529a f4, segment 961, phys net mynetwork, and network type vlan with 1 link_info from (pid=10023) _supported_ baremetal_ transaction /opt/stack/ networking- cisco/networkin g_cisco/ plugins/ ml2/drivers/ cisco/nexus/ mech_cisco_ nexus.py: 608 plugins. ml2.managers [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] Bound port: 65023464- 510f-4a43- b936-8749c409f3 b6, 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-5e5905529a f4', 'network_type': u'vlan'}}] from (pid=10023) _bind_port_level /opt/stack/ neutron/ neutron/ plugins/ ml2/managers. py:758 plugins. ml2.db [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] For port 65023464- 510f-4a43- b936-8749c409f3 b6, host netapp_lab42, cleared binding levels from (pid=10023) clear_binding_ levels /opt/stack/ neutron/ neutron/ plugins/ ml2/db. py:118 plugins. ml2.db [req-1361d34a- 17b7-4f92- a5b2-e0ed1db64f 71 neutron dbd665e4da03490 cb98edc5a775af4 db] For port 65023464- 510f-4a43- b936-8749c409f3 b6, host netapp_lab42, set binding levels [<neutron. plugins. ml2.models. PortBindingLeve l[object at 7f31d0052390] {port_id= '65023464- 510f-4a43- b936-8749c409f3 b6', host=u' netapp_ lab42', level=0, driver= 'cisco_ nexus', segment_ id=u'03daa432- 70e1-415c- a80a-5e5905529a f4'}>] from (pid=10023) set_binding_levels /opt/stack/ neutron/ neutron/ plugins/ ml2/db. py:91
2016-04-14 15:26:19.798 DEBUG neutron.
2016-04-14 15:26:19.798 DEBUG neutron.
2016-04-14 15:26:19.799 DEBUG neutron.
2016-04-14 15:26:19.799 DEBUG networking_
2016-04-14 15:26:19.800 DEBUG networking_
2016-04-14 15:26:19.806 DEBUG neutron.
2016-04-14 15:26:19.830 DEBUG neutron.
2016-04-14 15:26:19.830 DEBUG neutron.