Skip to content

fix: attach BGP peer to external network - #1446

Open
raineszm wants to merge 1 commit into
openstack-charmers:masterfrom
raineszm:fix/dragent-peer-ext-net
Open

raineszm wants to merge 1 commit into
openstack-charmers:masterfrom
raineszm:fix/dragent-peer-ext-net

Conversation

@raineszm

Copy link
Copy Markdown

Neutron Dynamic Routing advertises tenant prefixes with a next hop on
the external network. By default the BGP peer unit only has the port
created by juju when deploying the model. If this is on a different L2
segment, it can make the advertised routes unreachable from the peer
unit and cause dragent tests to fail.

Give the BGP peer an address from the undercloud subnet that bridges to
the external network. The next hop is then on-link, so floating IP
traffic works.

@nicolasbock-canonical nicolasbock-canonical left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread zaza/openstack/configure/bgp_speaker.py Outdated
[instance_id], port_name_suffix=PEER_PORT_NAME_SUFFIX)
port = neutron_client.list_ports(
device_id=instance_id,
network_id=undercloud_subnet["network_id"])["ports"][0]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really critical problem but do we have option that searching by name like selecting the exact one?
ports[0] seems not rigid

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree that if we have more filters, like the name, we should use them.

@brianphaley brianphaley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think since there are two similar comments we should look into trying to improve the code if possible.

Comment thread zaza/openstack/configure/bgp_speaker.py Outdated
external_cidr = ipaddress.ip_network(network_config["external_net_cidr"])
undercloud_subnet = next(
(subnet
for subnet in neutron_client.list_subnets(ip_version=4)["subnets"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think list_subnets() can take the subnet cidr as an argument, at least the neutron API doc says it can. So not sure if you should add 'cidr=str(external_cidr)' here. The result should be the same, just will be filtered in neutron code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So are we punting this to a follow-on change?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch I updated. Just making sure the functests all still run fine.

Comment thread zaza/openstack/configure/bgp_speaker.py Outdated
[instance_id], port_name_suffix=PEER_PORT_NAME_SUFFIX)
port = neutron_client.list_ports(
device_id=instance_id,
network_id=undercloud_subnet["network_id"])["ports"][0]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree that if we have more filters, like the name, we should use them.

openstackadmin pushed a commit to openstack/charm-neutron-dynamic-routing that referenced this pull request Nov 4, 2026
* update:
  - charmcraft.yaml for v3
  - tox.ini to use py3.12 by default
  - test-requirements.in to use zaza for juju3
  - update test bundles to work with charmcraft v3
  - pin dnspython<2.9 to avoid pulling in rustup
  - functional tests to noble-caracal and noble-caracal-ovn
* generate:
  - merged-requirements-py312.txt
  - test-requirements-py312.txt
* add:
   - update-requirements env to tox.ini and src/tox.ini
   - add noble-caracal-ovn.yaml test bundle
     - disable distributed fip on neutron ovn plugin (network toplogy in
       the functests can lead to failures otherwise)

Change-Id: I3a22932ae2285b1012639701b49c18f25b147c51
Func-Test-PR: openstack-charmers/zaza-openstack-tests#1446
Assisted-By: opencode (deepseek/deepseek-v4.1-flash; openrouter)
Signed-off-by: Zachary Raines <zachary.raines@canonical.com>
openstackadmin pushed a commit to openstack/openstack that referenced this pull request Nov 4, 2026
* Update charm-neutron-dynamic-routing from branch 'master'
  to 2473af6aa834ce4fab300f778545f24c2f48fcd6
  - Cleanup Master CI
    
    * update:
      - charmcraft.yaml for v3
      - tox.ini to use py3.12 by default
      - test-requirements.in to use zaza for juju3
      - update test bundles to work with charmcraft v3
      - pin dnspython<2.9 to avoid pulling in rustup
      - functional tests to noble-caracal and noble-caracal-ovn
    * generate:
      - merged-requirements-py312.txt
      - test-requirements-py312.txt
    * add:
       - update-requirements env to tox.ini and src/tox.ini
       - add noble-caracal-ovn.yaml test bundle
         - disable distributed fip on neutron ovn plugin (network toplogy in
           the functests can lead to failures otherwise)
    
    Change-Id: I3a22932ae2285b1012639701b49c18f25b147c51
    Func-Test-PR: openstack-charmers/zaza-openstack-tests#1446
    Assisted-By: opencode (deepseek/deepseek-v4.1-flash; openrouter)
    Signed-off-by: Zachary Raines <zachary.raines@canonical.com>
@raineszm
raineszm force-pushed the fix/dragent-peer-ext-net branch from 36325b2 to d90c8be Compare November 5, 2026 20:44
Neutron Dynamic Routing advertises tenant prefixes with a next hop on
the external network. By default the BGP peer unit only has the port
created by juju when deploying the model. If this is on a different L2
segment, it can make the advertised routes unreachable from the peer
unit and cause dragent tests to fail.

Give the BGP peer an address from the undercloud subnet that bridges to
the external network. The next hop is then on-link, so floating IP
traffic works.

Assisted-By: opencode (deepseek/deepseek-v4.1-flash-1017; openrouter)
Signed-off-by: Zachary Raines <zachary.raines@canonical.com>
@raineszm
raineszm force-pushed the fix/dragent-peer-ext-net branch from d90c8be to 40a511c Compare November 6, 2026 16:56

@nicolasbock-canonical nicolasbock-canonical left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xtrusia xtrusia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants