Comment 1 for bug 1632658

Revision history for this message
Poonam Ghosh (poonam-ghosh) wrote :

Hi Na Zhu,

As per the detail analysis from the mentioned Blueprint as well as neutron-specs there are no specific handling wherein registered mechanism drivers will be notified to validate the original(i.e. updated attribute) binding:profile attribute to see if there is any requirement for re-binding to take place with the respective ML2 Plugin to validate with the reference Current PortContext binding:profile attributes.

So in short there is no handling in code where unnecessary rebinding can be taken care with prior validation or notification from the respective Mechanism drivers. Correct my understanding on the same.

To understand every aspect of the port update, i have tested every possible use case combination with the binding:profile - same, different and Invalid values.
And as part of the code analysis, it is pretty clear that rebinding with the new binding:profile attribute will be happening (except for the Invalid message string) every time irrespective of DuplicateEntries in DB.
So as per our understanding following methods will ideally take care of the attributes for every update happening w.r.t the dictionary:

1. update_port
2. process_update_port
3. update_port_precommit
4. update_port_postcommit
5. commit_port_binding

As part of the above methods in place which are currently taking care of port update we have the possibility to see if there is some new Proposed changes which will send Notification during the DB transactions commit process to the respective Mechanism drivers to validate the need for re-binding for the required ML2 plugins. If so then your requirement can be fulfilled.

We have already sent a mail across to Robert Kukura to understand on his future proposals(if any).
if there are any further discussions happening will keep things posted.

Let us know if we can move this Bug to Wishlist for Future reference instead of affected Bugs.

******** Tests which was triaged to check the behavior of the code**************
$ neutron net-create test
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2017-02-15T09:12:13 |
| description | |
| id | dec7e34d-dc64-495c-8da1-2a49a29a4e05 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1450 |
| name | test |
| port_security_enabled | True |
| provider:network_type | vxlan |
| provider:physical_network | |
| provider:segmentation_id | 1022 |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 91476e91e8c7446bb1ef4c58daf9a538 |
| updated_at | 2017-02-15T09:12:13 |
+---------------------------+--------------------------------------+
$ neutron port-create --name test dec7e34d-dc64-495c-8da1-2a49a29a4e05 --binding:profile type=dict a=2
Created a new port:
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | |
| binding:profile | {"a": "2"} |
| binding:vif_details | {} |
| binding:vif_type | unbound |
| binding:vnic_type | normal |
| created_at | 2017-02-15T09:16:04 |
| description | |
| device_id | |
| device_owner | |
| extra_dhcp_opts | |
| fixed_ips | |
| id | 74794b64-c3df-4c51-83cf-381e56a5c5c3 |
| mac_address | fa:16:3e:e4:df:58 |
| name | test |
| network_id | dec7e34d-dc64-495c-8da1-2a49a29a4e05 |
| port_security_enabled | True |
| security_groups | a27eb1d6-d2b6-4779-9dda-baa9538e71f4 |
| status | DOWN |
| tenant_id | 91476e91e8c7446bb1ef4c58daf9a538 |
| updated_at | 2017-02-15T09:16:04 |
+-----------------------+--------------------------------------+
$ neutron port-show 74794b64-c3df-4c51-83cf-381e56a5c5c3
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | |
| binding:profile | {"a": "2"} |
| binding:vif_details | {} |
| binding:vif_type | unbound |
| binding:vnic_type | normal |
| created_at | 2017-02-15T09:16:04 |
| description | |
| device_id | |
| device_owner | |
| extra_dhcp_opts | |
| fixed_ips | |
| id | 74794b64-c3df-4c51-83cf-381e56a5c5c3 |
| mac_address | fa:16:3e:e4:df:58 |
| name | test |
| network_id | dec7e34d-dc64-495c-8da1-2a49a29a4e05 |
| port_security_enabled | True |
| security_groups | a27eb1d6-d2b6-4779-9dda-baa9538e71f4 |
| status | DOWN |
| tenant_id | 91476e91e8c7446bb1ef4c58daf9a538 |
| updated_at | 2017-02-15T09:16:04 |
+-----------------------+--------------------------------------+
$ neutron port-update 74794b64-c3df-4c51-83cf-381e56a5c5c3 --binding:profile type=dict b=3
Updated port: 74794b64-c3df-4c51-83cf-381e56a5c5c3
$ neutron port-show 74794b64-c3df-4c51-83cf-381e56a5c5c3
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | |
| binding:profile | {"b": "3"} |
| binding:vif_details | {} |
| binding:vif_type | unbound |
| binding:vnic_type | normal |
| created_at | 2017-02-15T09:16:04 |
| description | |
| device_id | |
| device_owner | |
| extra_dhcp_opts | |
| fixed_ips | |
| id | 74794b64-c3df-4c51-83cf-381e56a5c5c3 |
| mac_address | fa:16:3e:e4:df:58 |
| name | test |
| network_id | dec7e34d-dc64-495c-8da1-2a49a29a4e05 |
| port_security_enabled | True |
| security_groups | a27eb1d6-d2b6-4779-9dda-baa9538e71f4 |
| status | DOWN |
| tenant_id | 91476e91e8c7446bb1ef4c58daf9a538 |
| updated_at | 2017-02-15T09:43:01 |
+-----------------------+--------------------------------------+

Thanks & Regards
Poonam Ghosh