In some cases (I don't know exactly how) it may happend that
when new subnet, e.g. IPv6 is added to the network, subnets
can change their order based on uuid.
As before this patch we were using in dnsmasq options tags like
"tagN" for subnets (where N was just number based on position of
the subnet in the sorted list) it could happend sometimes that
dnsmasq ended up with mismatch of tags configured in "dhcp-range"
cmd option and set in "opts" file. That caused problem with serving
proper DHCP options to the vms.
This patch fixes this issue by using tags with format:
"subnet-<uuid>" where uuid is id of the subnet. That was it's not
based on order of subnets in the list and will always match with tag
configured in opts file for specific subnet.
As we was currently using port id as tag for "per port" DHCP options,
this patch changes that to use tags like "port-<uuid>" to make it
consistent with options configured "per subnet" and to make it easier
to debug from where each option comes.
Reviewed: https:/ /review. opendev. org/690729 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=ba12b9e3691 6de4f4635de530d efcbffc6dc1a53
Committed: https:/
Submitter: Zuul
Branch: stable/rocky
commit ba12b9e36916de4 f4635de530defcb ffc6dc1a53
Author: Slawek Kaplonski <email address hidden>
Date: Fri Oct 18 07:04:43 2019 +0200
Fix mismatch of tags in dnsmasq options
In some cases (I don't know exactly how) it may happend that
when new subnet, e.g. IPv6 is added to the network, subnets
can change their order based on uuid.
As before this patch we were using in dnsmasq options tags like
"tagN" for subnets (where N was just number based on position of
the subnet in the sorted list) it could happend sometimes that
dnsmasq ended up with mismatch of tags configured in "dhcp-range"
cmd option and set in "opts" file. That caused problem with serving
proper DHCP options to the vms.
This patch fixes this issue by using tags with format:
"subnet-<uuid>" where uuid is id of the subnet. That was it's not
based on order of subnets in the list and will always match with tag
configured in opts file for specific subnet.
As we was currently using port id as tag for "per port" DHCP options,
this patch changes that to use tags like "port-<uuid>" to make it
consistent with options configured "per subnet" and to make it easier
to debug from where each option comes.
Conflicts:
neutron/ agent/linux/ dhcp.py
neutron/ tests/unit/ agent/linux/ test_dhcp. py
Change-Id: Idaea33d62fa31e dd7149ec916ec31 4438375724a 7e8aa07656caec4 c35c8b8459) fce0574bb314b67 9bcdd58c76)
Partial-Bug: #1848738
(cherry picked from commit 88f2073526c2add
(cherry picked from commit a0730e684d54796