[OVN] Support native DHCP service for subnet without gateway IP

Bug #1670666 reported by Dong Jun
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
neutron
New
Undecided
Unassigned

Bug Description

Currently, subnet without gateway ip disabled can not offer a DHCP service, one of the reason is OVN's restriction.
We submitted a patch to move option 3 from mandatory to optional. We can obtain a DHCP IP by creating a port and set it as server IP.

Dong Jun (dongj)
description: updated
summary: - Support native DHCP servie for subnet without router IP present
+ Support native DHCP servie for subnet without gateway IP
Revision history for this message
Numan Siddique (numansiddique) wrote : Re: Support native DHCP servie for subnet without gateway IP

When gateway ip is not set, what should be the value of DHCP option - "server_id" ?

Revision history for this message
Dong Jun (dongj) wrote :

A DHCP port will be created to obtain the server IP without the gateway IP, maybe we can think of a better idea.

            # Create DHCP port
            port_dict = {
                'name': '',
                'admin_state_up': True,
                'device_id': 'dhcp-' + subnet['id'],
                'device_owner': const.DEVICE_OWNER_DHCP,
                'network_id': subnet['network_id'],
                'tenant_id': '',
                'mac_address': const.ATTR_NOT_SPECIFIED,
                'fixed_ips': [{'subnet_id': subnet['id']}]}
            try:
                dhcp_port = self._plugin.create_port(ctx, {'port': port_dict})

Revision history for this message
Russell Bryant (russellb) wrote : Re: Support native DHCP service for subnet without gateway IP

I think creating a port to reserve the IP is fine. We'll need to create a port for the metadata API proxy as well. I think we can just use the same port for both purposes. I'll be posting a proposed metadata API design doc shortly.

summary: - Support native DHCP servie for subnet without gateway IP
+ Support native DHCP service for subnet without gateway IP
Revision history for this message
Dong Jun (dongj) wrote :

This feature is nearly completed, but there is an issue need to be resolved.
"Modify the DHCPv4 router option to optional"[1] was merged only to master, Networking-ovn should support both master and release, I haven't found the approach to verify the precise version of OVN DB. A single manner in networking-ovn will cause many logs using OVS/OVN 2.7 as backend.
Later other features will meet the same issue, e.g. supporting gratuitous ARP.

Will there be a discussion in OVN about verifying the precise versions or features of OVN.

[1] https://github.com/openvswitch/ovs/commit/b89d25e5694bc9bb0a1fbb2a025d18a2a231c633

Revision history for this message
Numan Siddique (numansiddique) wrote :

One approach I could think of is networking-ovn can get the version of ovsdb-server (hosting NB DB) by using it's control socket and handle the code accordingly.

Eg . ovs-appctl -t /usr/local/var/run/openvswitch/ovnnb_db.ctl version

It's tricky and may not be the best approach though.

Changed in networking-ovn:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Russell Bryant (russellb) wrote :

The ovs-appctl approach may not work as neutron-server will not always be running on the same server as the OVN databases.

I suggest that we bump the minor version number of the OVN_Northbound schema so that we can detect this behavior change from the schema version. I'll follow up on the OVS dev list about this.

Revision history for this message
Russell Bryant (russellb) wrote :
Revision history for this message
Russell Bryant (russellb) wrote :

I applied that patch to master, so we can now make networking-ovn look for an OVN northbound schema version >= 5.5.1 to check for this.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (master)

Reviewed: https://review.openstack.org/534741
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=48c3fbb8b830b4fb33fa63b1e7628c8d364509c2
Submitter: Zuul
Branch: master

commit 48c3fbb8b830b4fb33fa63b1e7628c8d364509c2
Author: Dong Jun <email address hidden>
Date: Wed Jan 17 19:04:21 2018 +0800

    Use metadata IP as DHCP service IP for subnet without gateway IP

    Currently, OVN does not support DHCP for subnet without gateway IP.
    This is an important feature for VMs having multi ports on multi
    subnets, because two conflicting default routes should be avoided.
    In the patch[1] in OVN, router option was changed from mandatory to
    optional, then we can add DHCP without router option to OVN. But,
    without gateway IP, we still need an IP address as DHCP service IP,
    using the same IP with metadata is a choice.
    This patch does not solve all the problems, a TODO is added in the
    code and bug is still opening to track it.

    [1]https://github.com/openvswitch/ovs/commit/b89d25e5694bc9bb0a1fbb2a025d18a2a231c633

    Change-Id: Icd93101bf8834a56f80184f0584a73a36b16b483
    Partial-Bug: #1670666
    Signed-off-by: Dong Jun <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-ovn (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/539901

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/pike)

Reviewed: https://review.openstack.org/539901
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=e7fc4edc9412c1ef489f578feeb3dd39fedd4fd7
Submitter: Zuul
Branch: stable/pike

commit e7fc4edc9412c1ef489f578feeb3dd39fedd4fd7
Author: Dong Jun <email address hidden>
Date: Wed Jan 17 19:04:21 2018 +0800

    Use metadata IP as DHCP service IP for subnet without gateway IP

    Currently, OVN does not support DHCP for subnet without gateway IP.
    This is an important feature for VMs having multi ports on multi
    subnets, because two conflicting default routes should be avoided.
    In the patch[1] in OVN, router option was changed from mandatory to
    optional, then we can add DHCP without router option to OVN. But,
    without gateway IP, we still need an IP address as DHCP service IP,
    using the same IP with metadata is a choice.
    This patch does not solve all the problems, a TODO is added in the
    code and bug is still opening to track it.

    [1]https://github.com/openvswitch/ovs/commit/b89d25e5694bc9bb0a1fbb2a025d18a2a231c633

    Conflicts:
            networking_ovn/common/ovn_client.py

    Change-Id: Icd93101bf8834a56f80184f0584a73a36b16b483
    Partial-Bug: #1670666
    Signed-off-by: Dong Jun <email address hidden>
    (cherry picked from commit 48c3fbb8b830b4fb33fa63b1e7628c8d364509c2)

tags: added: in-stable-pike
tags: added: networking-ovn-proactive-backport-potential
zhangyuhe (ikukaku)
Changed in networking-ovn:
assignee: nobody → zhangyuhe (ikukaku)
Revision history for this message
zhangyuhe (ikukaku) wrote : Re: Support native DHCP service for subnet without gateway IP

i think When a subnet enable_dhcp is true and metadata-agent service is disabled, we should create a reserved dhcp port for DHCP service

Changed in networking-ovn:
status: Confirmed → In Progress
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

The OVN driver now lives in the neutron repository. Moving this bug to their tracker.

tags: added: ovn
no longer affects: networking-ovn
summary: - Support native DHCP service for subnet without gateway IP
+ [OVN] Support native DHCP service for subnet without gateway IP
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/708011

Changed in neutron:
assignee: nobody → zhangyuhe (ikukaku)
status: New → In Progress
Revision history for this message
Slawek Kaplonski (slaweq) wrote : auto-abandon-script

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

Changed in neutron:
assignee: zhangyuhe (ikukaku) → nobody
status: In Progress → New
tags: added: timeout-abandon
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Slawek Kaplonski (<email address hidden>) on branch: master
Review: https://review.opendev.org/708011
Reason: This review is > 4 weeks without comment, and failed Zuul jobs the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

Hello, is anything happening with this bug? I have the same problem - on networks without router - DHCP does not work.

Changed in neutron:
status: New → Confirmed
Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
Slawek Kaplonski (slaweq) wrote : auto-abandon-script

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

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

Change abandoned by "Slawek Kaplonski <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/708011
Reason: This review is > 4 weeks without comment, and failed Zuul jobs the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

I have also noticed that OVN in subnets that the gateway is external (router:external == External) is setting the DHCP server ip address to gateway_ip - which obviously won't end well for port type External.

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.