Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network: Begin transition to libovsdb #14841

Draft
wants to merge 54 commits into
base: main
Choose a base branch
from

Conversation

markylaing
Copy link
Contributor

This begins a series of cherry-picks and amendments to transition LXD to use libovsdb, rather than OVN CLI tooling.

@markylaing markylaing self-assigned this Jan 22, 2025

tlsConfig := &tls.Config{
Certificates: []tls.Certificate{clientCert},
InsecureSkipVerify: true,

Check failure

Code scanning / CodeQL

Disabled TLS certificate check High

InsecureSkipVerify should not be used in production code.

tlsConfig := &tls.Config{
Certificates: []tls.Certificate{clientCert},
InsecureSkipVerify: true,

Check failure

Code scanning / CodeQL

Disabled TLS certificate check High

InsecureSkipVerify should not be used in production code.
@markylaing markylaing marked this pull request as draft January 23, 2025 07:20
@tomponline
Copy link
Member

@markylaing im going to wait until after LXD 6.3 to merge this btw.

@markylaing
Copy link
Contributor Author

@markylaing im going to wait until after LXD 6.3 to merge this btw.

Yep no problem. There are some issues with it in any case.

@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Jan 23, 2025
stgraber and others added 21 commits January 24, 2025 08:05
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
(cherry picked from commit d87d46523c7453932578b1cab42c874f724c34c0)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
(cherry picked from commit 757148099e1cf904bb96b1748184cd55e4092d1b)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
(cherry picked from commit e67cddf68fc9b3ee6bb574ae126a5ae0abc69ca8)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
(cherry picked from commit 0b9a4cda51353f64ef5628f3cc63462fa47098f4)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
stgraber and others added 26 commits January 24, 2025 08:06
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
This commit adds logic to the client to listen for update events on the
`NB_Global` table. This is used to receive notifications when the value of
`sb_cfg` or `hv_cfg` is changed, so that we can wait for configuration to
propagate without polling.

The `(NB).transaction` method gets the existing NB_Global from the cache
and increments the `nb_cfg` value. It then waits for `sb_cfg` or `hv_cfg`
be updated to a number greater than or equal to the incremented `nb_cfg`.
This logic is the same as in ovn-nbctl (I've linked to the source in a
comment).

A new type `nbWaitMode` is added to control the wait behaviour.

Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
License: Apache-2.0
…ent.

It's not just the `network_ovn` suite that uses Open vSwitch. It is used
in many places e.g. checking a OVS bridge exists for reporting the kind
of an unmanaged network.

Signed-off-by: Mark Laing <[email protected]>
@markylaing
Copy link
Contributor Author

Tests passing now (both in the main test suite and the network-ovn LXD CI tests).

A few things for discussion:

  • The code scanning errors above. I'm not sure if they're a false positive since the OVN CA certificate it used it present.
  • When adding the network.ovs.connection config key, the "scope" of the key in the Incus commit was set to "global", but it was added to the local config for the node. I changed the scope to "local" with the thinking that OVS is a per-cluster member config. We could change it to "global" and move to lxd/cluster/config instead, and require that the path be the same on all members.
  • Also when adding the network.ovs.connection I cherry-picked this commit (see here) to update the call sites. However, I'm not sure I should have because VSwitch is not yet defined on our state (it's not long-lived yet) so I had to edit all the calls to pass in the connection string instead. I'm thinking to remove this cherry-pick and implement myself, then cherry-pick the commit when we actually move to long-lived connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants