Because the DHCP agent does not know the IAID (identity association
identifier) of assigned IPv6 addresses it's not possible to generate the
lease file including IPv6 leases. Because of this IPv6 addresses are
excluded when generating the lease file in case of DHCP agent restarts.
This causes DHCPv6 clients to fail to RENEW their lease and to go
through a full address discovery cycle with possible short connectivity
disruption.
This commit copies the existing IPv6 leaes from an already existing
lease file if present. While this does not allow for DHCP agent
failover, this is still better than just skipping the IPv6 addresses.
A lease file without the IPv6 addresses is still generated if an agent
is migrated to a different host.
This commit complements the fix implemented in
Ib1b2f284ab81f1c4af7b08b5257b45a3f6e79c3e which just skips the IPv6
leases as otherwise the lease file would be invalid and all leases would
be lost. It does not change the behavior for still valid IPv4 leases.
With this issue fixed an additional fix is required to not loose DHCPv6
leases when the agent restarts dnsmasq. Currently the DHCP agent
regenerates all configuration files on restart. This means that DHCPv6
leases are lost as they can't be regenerated. This changes the agent to
only delete the config files if the agent's ports are also removed.
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/799071 /opendev. org/openstack/ neutron/ commit/ 7f63139424adcbb c18cdbf1b0fa3ef a3b0fd3f45
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/stein
commit 7f63139424adcbb c18cdbf1b0fa3ef a3b0fd3f45
Author: Gaudenz Steinlin <email address hidden>
Date: Mon Nov 16 17:41:18 2020 +0100
Copy existing IPv6 leases to generated lease file
Because the DHCP agent does not know the IAID (identity association
identifier) of assigned IPv6 addresses it's not possible to generate the
lease file including IPv6 leases. Because of this IPv6 addresses are
excluded when generating the lease file in case of DHCP agent restarts.
This causes DHCPv6 clients to fail to RENEW their lease and to go
through a full address discovery cycle with possible short connectivity
disruption.
This commit copies the existing IPv6 leaes from an already existing
lease file if present. While this does not allow for DHCP agent
failover, this is still better than just skipping the IPv6 addresses.
A lease file without the IPv6 addresses is still generated if an agent
is migrated to a different host.
This commit complements the fix implemented in 81f1c4af7b08b52 57b45a3f6e79c3e which just skips the IPv6
Ib1b2f284ab
leases as otherwise the lease file would be invalid and all leases would
be lost. It does not change the behavior for still valid IPv4 leases.
With this issue fixed an additional fix is required to not loose DHCPv6
leases when the agent restarts dnsmasq. Currently the DHCP agent
regenerates all configuration files on restart. This means that DHCPv6
leases are lost as they can't be regenerated. This changes the agent to
only delete the config files if the agent's ports are also removed.
Closes-Bug: #1722126 c4af7b08b5257b4 5a3f6e79c3e
Related-Change: Ib1b2f284ab81f1
This backport contains some test fixes to make the tests work with
Python 2.7 and the PEP8 N322 check.
Changed file:
neutron/ tests/unit/ agent/linux/ test_dhcp. py
Conflicts:
neutron/ agent/linux/ dhcp.py
Change-Id: I40761b30563749 251b9d74731bbe7 a80a124da89 dd142739790222e 8408684696)
(cherry picked from commit 6bc1c00d66ced82