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

lxd/network/acl: return ACL logs from syslogs when the OVN controller is deployed in MicroOVN #14327

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Oct 25, 2024

  1. lxd/network/acl: Read OVN logs from systemd journal

    In the case of an OVN controller being deployed as part of a MicroOVN deployment,
    the OVN controller logs are stored in MicroOVN's snap syslog. The LXD snap should have root access,
    which means that it should be authorized (this is being tested) to read the OVN controller logs.
    
    Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
    gabrielmougard committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    a0496c1 View commit details
    Browse the repository at this point in the history
  2. lxd/network/acl: If the OVN chassis is in MicroOVN, read the ACL logs…

    … from syslogs
    
    If the OVN controller is deployed as part of MicroOVN, it means that the `ovn-chassis` snap connection hook
    between LXD and MicroOVN has been fired and that a symlink like:
    
    `/run/openvswitch -> /var/snap/lxd/<ID>/microovn/...`
    
    exists. Otherwise, there might still be a symlink but not with that target prefix. That's how we detect the ovn chassis
    connection without introducing a new plug / slot between LXD and MicroOVN.
    
    Then, if this case is detected, we check the status of the systemd unit 'snap.microovn.chassis.service' (the one containing the OVN controller in its sd journal)
    If it is loaded and active, we read the last 5000 ACL log entries (we can discuss on this limit) in the journal and return them.
    
    Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
    gabrielmougard committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    316aeed View commit details
    Browse the repository at this point in the history