diff --git a/releasenotes/notes/fix-ipv6-route-exists-b5f07569270b6066.yaml b/releasenotes/notes/fix-ipv6-route-exists-b5f07569270b6066.yaml new file mode 100644 index 0000000000..858dd799eb --- /dev/null +++ b/releasenotes/notes/fix-ipv6-route-exists-b5f07569270b6066.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix a bug where docker daemon occasionally returns error: + `failed to set IPv6 gateway while updating gateway: file exists: unknown` + when network_isolation is enabled. \ No newline at end of file diff --git a/trove/taskmanager/models.py b/trove/taskmanager/models.py index c76166a793..c0f437646a 100755 --- a/trove/taskmanager/models.py +++ b/trove/taskmanager/models.py @@ -583,11 +583,16 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin): nic_info["ipv4_cidr"] = subnet.get("cidr") nic_info["ipv4_gateway"] = subnet.get("gateway_ip") nic_info["ipv4_host_routes"] = subnet.get("host_routes") + # NOTE: only if the ipv6_ra_mode is dhcpv6-stateful, + # we need to configure the ip route for container. for slaac + # and dhcpv6-stateless mode, the route will be configured + # by the nic itself via the RA protocol. elif subnet.get("ip_version") == 6: nic_info["ipv6_address"] = fixed_ip.get("ip_address") nic_info["ipv6_cidr"] = subnet.get("cidr") - nic_info["ipv6_gateway"] = subnet.get("gateway_ip") nic_info["ipv6_host_routes"] = subnet.get("host_routes") + if subnet.get("ipv6_ra_mode") == "dhcpv6-stateful": + nic_info["ipv6_gateway"] = subnet.get("gateway_ip") return nic_info def create_instance(self, flavor, image_id, databases, users,