[stable-only][OVN] Set VETH interface MAC address before up

Set the VETH interface MAC address of the metadata namespace before
setting this interface as up.

This change was introduced in [1] and should be backported to stable
versions.

[1]https://review.opendev.org/c/openstack/neutron/+/894026/12/neutron/agent/ovn/metadata/agent.py#710

Closes-Bug: #2055561
Change-Id: Ied8f7a5b6c0e9c295e8e040546c53bd98206ef12
(cherry picked from commit ac63999b66)
This commit is contained in:
Rodolfo Alonso Hernandez 2024-02-25 09:47:59 +00:00
parent c162ea2b26
commit 0673a9bb23
1 changed files with 3 additions and 3 deletions

View File

@ -649,13 +649,13 @@ class MetadataAgent(object):
ip1, ip2 = ip_lib.IPWrapper().add_veth(
veth_name[0], veth_name[1], namespace)
# Configure the MAC address.
ip2.link.set_address(metadata_port_info.mac)
# Make sure both ends of the VETH are up
ip1.link.set_up()
ip2.link.set_up()
# Configure the MAC address.
ip2.link.set_address(metadata_port_info.mac)
cidrs_to_add, cidrs_to_delete = self._process_cidrs(
{dev['cidr'] for dev in ip2.addr.list()},
datapath_ports_ips,