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

Experimental: LXD Import / Export #14160

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

Conversation

gabrielmougard
Copy link
Contributor

This is a PoC PR for being able to cleanly export the state of a source LXD cluster, distribute the output state JSON file, to import it (e.g, on a disaster recovery site) so that it can reconcile the state of this target site to reproduce the source cluster state.

(This work is very experimental and is really there as a research draft to look for solutions)

specification: https://docs.google.com/document/d/1PE4ZPpXy_vRmxxxD3YZH8OGGOqPef5bw1Et_jlARZwc/edit

@github-actions github-actions bot added the API Changes to the REST API label Sep 27, 2024
@gabrielmougard gabrielmougard force-pushed the experimental/lxd-import-export branch 2 times, most recently from 2451e3a to 163f9ef Compare October 1, 2024 21:36
Signed-off-by: Gabriel Mougard <[email protected]>
We need a thread-safe logger to inspect the export and import processes.

Signed-off-by: Gabriel Mougard <[email protected]>
This 'Node' represents the representation of a LXD entity with a directed acyclic graph (DAG)

Signed-off-by: Gabriel Mougard <[email protected]>
Each LXD entity needs to implement our Node interface.
This is the logic that construct the DAG
We need to be able to serialize/deserialize a DAG in a 'stable' way
(i.e, for the same DAG, we need to always have the same JSON output)

Signed-off-by: Gabriel Mougard <[email protected]>
- `example_exported_cluster.json` is an example of a serialized source cluster definition
- `example_dag.dot` is an example of a visual representation of LXD entities within a cluster.

Signed-off-by: Gabriel Mougard <[email protected]>
diagnostics are a list of warnings (or critical status) generated with a 'Plan'
(a 'plan' is a list of steps to reconcile a target cluster with a source cluster)

A diagnostic, if any, is usually shown before the 'plan' steps (so that the user knows what to manually
do before launching the import)

Signed-off-by: Gabriel Mougard <[email protected]>
We'll use common operations on our DAGs like:
- query a pair of node (srcNode and targetNode) with the same 'hid'

Signed-off-by: Gabriel Mougard <[email protected]>
When diffing two nodes, we need to analyze the 'diff path' to be able to
extract information.

Signed-off-by: Gabriel Mougard <[email protected]>
The 'planner' embeds all the smart logic and the edge cases to create a 'plan'.

Signed-off-by: Gabriel Mougard <[email protected]>
Diffable data structure need to be annotated with 'diff' flags
This is the main API for launching an import.

Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant