ipv6 options are being checked for ipv4 subnet

Bug #1625209 reported by Aleksey Kasatkin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-calico
In Progress
Undecided
Andriy Popovych
neutron
Invalid
Undecided
Unassigned

Bug Description

When DHCP agent tries to set fixed_ips parameter for DHCP port (see https://bugs.launchpad.net/networking-calico/+bug/1541490) Neutron checks ipv6_address_mode and ipv6_ra_mode options of subnet that corresponds to the given fixed IP even for IPv4 subnet. And this fails as IPv4 subnet does not have such options (see traceback http://paste.openstack.org/show/580996/). And, of course, you cannot set such flags for IPv4 subnet.
I'd expect that such check is performed for IPv6 subnets only.

Probably, this situation is possible not only while using non-native DHCP agent.

Neutron version: Newton (7f6b5b5d8953159740f74b0a4a5280527f6baa69).
Environment: Calico (https://github.com/openstack/networking-calico) over Neutron.
Point of failure: https://github.com/openstack/neutron/blob/7f6b5b5d8953159740f74b0a4a5280527f6baa69/neutron/agent/linux/dhcp.py#L1342
Traceback: http://paste.openstack.org/show/580996/
Failure rate: always.

Changed in neutron:
assignee: nobody → Oleg Bondarev (obondarev)
status: New → Confirmed
tags: added: newton-rc-potential
Changed in neutron:
milestone: none → ocata-1
Revision history for this message
Brian Haley (brian-haley) wrote :

I'm confused, these IPv6 types are in the subnet model, so IPv4 subnets have them. So I'll just wait for someone to hit me with the clue-bat.

$ neutron subnet-show private-subnet
+-------------------+--------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr | 10.0.0.0/24 |
| created_at | 2016-09-14T16:36:48 |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.0.0.1 |
| host_routes | |
| id | c53c6988-dbb9-4e9e-b354-4a5c9fa267a0 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | private-subnet |
| network_id | 907eb5fc-23b0-4092-b5ea-6d4b40d0e963 |
| project_id | bed9af6ece5f44b5bd695a1dfa5bb959 |
| revision_number | 2 |
| service_types | |
| subnetpool_id | |
| tenant_id | bed9af6ece5f44b5bd695a1dfa5bb959 |
| updated_at | 2016-09-14T16:36:48 |
+-------------------+--------------------------------------------+

Revision history for this message
Oleg Bondarev (obondarev) wrote :

Right, neutron DB layer has these fields set for both IPv4 and IPv6 layers, it also adds them when making subnet dict. So other places in code expect these fields and the reported case might not be single one. I'd suggest fix this on Calico plugin side.

Changed in neutron:
status: Confirmed → Invalid
assignee: Oleg Bondarev (obondarev) → nobody
Changed in neutron:
milestone: ocata-1 → none
Revision history for this message
Nell Jerram (neil-jerram) wrote :

Aleksey, please could you clarify: is this problem observed with the current networking-calico master? Or is it only with your modifications to address 1541490?

Also, my understanding of the problem is that:

- Neutron agent code (which Calico uses) expects that a subnet model will have an ipv6_address_mode attribute

- but the Calico-specific agent does not provide that attribute on every subnet that it passes to the relevant Neutron code.

Is that a correct description of the problem?

Changed in networking-calico:
assignee: nobody → Alexander Saprykin (cutwater)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-calico (master)

Fix proposed to branch: master
Review: https://review.openstack.org/391239

Changed in networking-calico:
status: New → In Progress
Revision history for this message
Alexander Saprykin (cutwater) wrote :

Neil, this problem is related to changes that address 1541490. There are several places [1][2] where networking-calico passes information in a format incompatible to neutron's data model. It this particular case it happens when "fixed_ips" field is set for port.

I pushed hotfix for the problem above, but in my opinion it doesn't fix the problem entirely and it would be nice to have a discussion regarding data model that neutron passes to DHCP agent via etcd.

[1] https://github.com/openstack/networking-calico/blob/master/networking_calico/plugins/ml2/drivers/calico/t_etcd.py#L1041
[2] https://github.com/openstack/networking-calico/blob/master/networking_calico/agent/dhcp_agent.py#L433

Revision history for this message
Nell Jerram (neil-jerram) wrote :

If I understand correctly, this is not an independent bug. Rather, it only arises when changes are made in networking-calico to address another bug (1541490). And the only proposed change for _this_ bug is now also in networking-calico.

Therefore it doesn't make sense for this bug to have an independent existence from 1541490, or for any changes for this bug to be separated from proposed changes from 1541490. I will close this bug for networking-calico, and ask that you simply combine all of the networking-calico changes that you think are needed for 1541490.

Changed in networking-calico:
status: In Progress → Invalid
Changed in networking-calico:
status: Invalid → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on networking-calico (master)

Change abandoned by Alexander Saprykin (<email address hidden>) on branch: master
Review: https://review.openstack.org/391239
Reason: Squashed with https://review.openstack.org/#/c/392645/

Changed in networking-calico:
assignee: Alexander Saprykin (cutwater) → Andriy Popovych (popovych-andrey)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Neil Jerram (<email address hidden>) on branch: master
Review: https://review.opendev.org/392645
Reason: Looks like this has been abandoned by the author. Please re-open in case that's wrong.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.