Comment 9 for bug 1806770

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

Reviewed: https://review.openstack.org/623066
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f2111e035424bf714099966ad724e9a4bd604c18
Submitter: Zuul
Branch: master

commit f2111e035424bf714099966ad724e9a4bd604c18
Author: Arjun Baindur <email address hidden>
Date: Wed Dec 5 12:43:05 2018 -0800

    Do not release DHCP lease when no client ID is set on port

    The DHCP agent has a really strict enforcement of client ID, which
    is part of the DHCP extra options. If a VM advertises a client ID,
    DHCP agent will automatically release it's lease whenever *any* other
    port is updated/deleted, even if no client ID is set on the port,
    because it thinks the client ID has changed.

    When reload_allocations() is called, the DHCP agent parses the leases
    and hosts files, and gets the list of all the ports in the network from the
    DB, computing 3 different sets. The set from the leases file (v4_leases)
    could have a client ID, but the set from the port DB and hosts file will
    have None.

    As a result, the set subtraction does not filter out the entry,
    and all ports that have an active lease with a client ID are released.

    The Client ID should only be enforced and leases released
    if it's actually set in the port DB's DHCP extra Opts.
    In that case it means someone knows what they are doing,
    and we want to check for a mismatch. If the client ID on a port is
    empty, it should not be treated like an unused lease.

    We can't expect end users that just create VMs with auto created ports
    to know/care about DHCP client IDs, then manually update ports or
    change app templates.

    In some cases, like Windows VMs, the client ID is advertised as the MAC by default.
    In fact, there is a Windows bug which prevents you from even turning this off:
    https://support.microsoft.com/en-us/help/3004537/dhcp-client-always-includes-option-61-in-the-dhcp-request-in-windows-8

    Linux VMs don't have this on by default, but it may be enabled
    in some templates unknown to users.

    Change-Id: I8021f740bd78e654915337bd3287b45b2c422e95
    Closes-Bug: #1806770