-
Notifications
You must be signed in to change notification settings - Fork 930
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
gabrielmougard
wants to merge
15
commits into
canonical:main
Choose a base branch
from
gabrielmougard:experimental/lxd-import-export
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Experimental: LXD Import / Export #14160
gabrielmougard
wants to merge
15
commits into
canonical:main
from
gabrielmougard:experimental/lxd-import-export
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabrielmougard
force-pushed
the
experimental/lxd-import-export
branch
2 times, most recently
from
October 1, 2024 21:36
2451e3a
to
163f9ef
Compare
Signed-off-by: Gabriel Mougard <[email protected]>
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]>
gabrielmougard
force-pushed
the
experimental/lxd-import-export
branch
from
October 1, 2024 21:46
163f9ef
to
02fe758
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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