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

Update instance name in backup file when importing new instance #12079

Merged
merged 4 commits into from
Jul 26, 2023

Conversation

MusicDin
Copy link
Member

When new instance is imported, instance and volume names are updated in backup.yaml file to match the new instance name.

Fixes #12065

@MusicDin
Copy link
Member Author

@tomponline

Test

Should I add a test for recovering imported instances (that will ensure the above issue does not happen again)? If so, should I put in test/suites/backup.sh?

Projects

While project in backup.yaml is not respected on import (only --project flag is), I think we should still update the project occurrences in backup file on import?


Another (unrelated) issue is when an instance is created in a project, but no instance name is provided.

$ lxc launch ubuntu:22.04
Creating the instance
Instance name is: lenient-llama
Starting lenient-llama

$ lxc launch ubuntu:22.04 --project test
Creating the instance
Instance name is: steady-seasnail?project=test
Starting steady-seasnail?project=test
Error: Instance not found

$ lxc launch ubuntu:22.04 c123 --project test
Creating c123
Starting c123

If this is not the expected behavior, I can fix it in another PR?

@tomponline
Copy link
Member

Should I add a test for recovering imported instances (that will ensure the above issue does not happen again)? If so, should I put in test/suites/backup.sh?

Yes please

@tomponline
Copy link
Member

$ lxc launch ubuntu:22.04 --project test

Good spot! Lets fix that :)

@tomponline
Copy link
Member

While project in backup.yaml is not respected on import (only --project flag is), I think we should still update the project occurrences in backup file on import?

Agreed, good idea. It should represent the project its imported into.

@MusicDin MusicDin force-pushed the fix/instance-import branch 2 times, most recently from 5c13f9b to 9b9c9cc Compare July 26, 2023 11:20
@MusicDin MusicDin force-pushed the fix/instance-import branch from 9b9c9cc to c6f15d0 Compare July 26, 2023 13:21
@tomponline tomponline merged commit 50a2c9f into canonical:main Jul 26, 2023
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.

Importing an instance with another name doesn't update the backup file
2 participants