sandialabs / sceptre-phenix

phenix is an orchestration tool and GUI for Sandia's minimega platform
https://sandialabs.github.io/sceptre-docs/
GNU General Public License v3.0
17 stars 23 forks source link

feat: streaming netflow support for experiments #147

Closed activeshadow closed 7 months ago

activeshadow commented 1 year ago

Needs Review and Testing

TODO

Current State

Netflow is captured using the netflow capabilities within Open vSwitch. Since OVS only allows netflow to be configured and captured bridge-wide, the netflow feature in phēnix will fail if the default bridge for an experiment is set to the default of phenix, to avoid data leakage across experiments. Additionally, the creation or updating of an experiment will fail if a default bridge is used that another experiment is already configured with.

A new defaultBridge setting has been added to the experiment schema, and when set to something other than phenix it will allow experiment-wide netflow capture and will also automatically use GRE tunneling between the OVS bridges on multiple mesh nodes.

A new --default-bridge flag has been added to the phenix experiment create subcommand that will set the default bridge name when creating the experiment.

The experiment creation modal in the UI has a new option input for setting the default bridge name when creating experiments via the UI.

Bridge names must be 15 characters or less, as dictated by OVS (and Linux interface names).

When netflow is activated for an experiment, external applications can connect a websocket to /api/v1/experiments/{name}/netflow/ws in order to get streaming netflow data for the experiment.

activeshadow commented 8 months ago

@glattercj any thoughts on my 2nd bullet in the main description above regarding whether or not enabling netflow for an experiment should always stream it to the UI by default? Right now, that's how it works.

Also, right now, if a separate process (via the API) enables netflow for an experiment, it can still be disabled via the UI (there's no ownership lock).

activeshadow commented 8 months ago

Per a new "rule" I'm trying to enact (thanks @glattercj for the suggestion!), I'm going to leave this marked as draft until I have a corresponding PR in the phēnix docs repository.