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

Add bond model #783

Closed
wants to merge 5 commits into from
Closed

Conversation

cfconrad
Copy link
Contributor

Problem

  • Bond wasn't implemented yet

Solution

  • Add bond Model in network::model
  • Impl Bond interface and Parent device to NetworkManager DBus

Testing

cargo run --bin agama wicked migrate agama-migrate-wicked/tests/bond/

Adding the optional field hwaddr of type MacAddr to BondConfig.
It is used to define a specific hwaddr for a bonding device.
It is possible to set a specific hwaddr for a bonding device.
We sync BondConfig.hwaddr with 802-3-ethernet.assigned-mac-address.
@cfconrad
Copy link
Contributor Author

cfconrad commented Dec 6, 2023

close in favor of #885

@cfconrad cfconrad closed this Dec 6, 2023
teclator added a commit that referenced this pull request Dec 15, 2023
This PR adds support for configuring a Bond connection using Agama
auto-installation.

## The model

Initially, we thought each connection struct would take ownership of its
ports (basically, other connections). However, after some discussion
with the networking team, we agreed to keep a "reference" in the
opposite direction (from the port to the controller). At this point,
each connection that belongs to a bond keeps its parent UUID.

## Configuring a port

When using the auto-installation you can define the port with something
like this:

```rust
      {
        id: 'bond0',
        bond: {
            ports: ['eth0', 'eth1'],
            mode: 'active-backup',
            options: "primary=eth1"

        }
      },
      {
        id: 'Wired Adapter 1',
        interface: 'eth1'
      }
```

In NetworkManager, it is mandatory to specify an interface name.
However, Agama will use the `id` if you do not define the `interface`.
About the ports, it is not required to define them (in the example
above, `eth0` is missing). Agama will create a connection automatically.
And, again, you can use the `id` or the `interface` to link both
connections.

## Improving the D-Bus interface

As the list of ports is not part of the `BondConnection` struct, it is
not straightforward to expose that information in the D-Bus interface.
After all, the code that exposes each connection over D-Bus only had
access to the information of its specific connection (actually, it owns
a clone of the connection).

For that reason, starting with the
[Bond](https://github.com/openSUSE/agama/blob/add_bonding_support/rust/agama-dbus-server/src/network/dbus/interfaces.rs#L312)
interface, we implemented a better mechanism (based on message passing)
to interact with the data model. We will open a separate PR to adapt the
rest of interfaces (with more information about the problems it solves).

## What's next?

* #918
* #924 
* Fix a ton of issues detected by Clippy.

## References

* @cfconrad started to work on bonding support on #783.

## Testing

* Tested manually (see teclator#1).
* Added some unit and integration tests.
@cfconrad cfconrad deleted the pr-add-bond-model branch January 16, 2024 15:54
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.

2 participants