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

LXC: Implement profile expansion on lxc copy #13118

Conversation

hamistao
Copy link
Contributor

Fixes #13063

@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Mar 12, 2024
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from ba691f9 to 6dfabee Compare March 12, 2024 20:22
@github-actions github-actions bot removed Documentation Documentation needs updating API Changes to the REST API labels Mar 12, 2024
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from 6dfabee to b708308 Compare March 12, 2024 20:31
@hamistao
Copy link
Contributor Author

hamistao commented Mar 12, 2024

@masnax @tomponline While working on this PR I was discussing with Max the usage of the --device flag on copy, should it indicate device creation as well?
For example, this operation below doesn't work, but maybe it should:

lxc profile device remove myremote:p1 root
lxc copy t1 myremote:t1 -d root,type=disk,pool=default,path=/
Error: Failed instance creation: Can't find a storage pool for the instance to use.

If you think this makes sense we can discuss and if we agree this is worth implementing I can create an issue on the subject and start thinking about how to implement it.

@tomponline
Copy link
Member

@masnax @tomponline While working on this PR I was discussing with Max the usage of the --device flag on copy, should it indicate device creation as well? For example, this operation below doesn't work, but maybe it should: lxc profile device remove myremote:p1 root lxc copy t1 myremote:t1 -d root,type=disk,pool=default,path=/ Error: Failed instance creation: Can't find a storage pool for the instance to use. If you think whis makes sense we can discuss and if we agree this makes sense I can create an issue on the subject and start thinking about how to implement it.

Suggest for now we keep the functionality aligned with lxc init and lxc import and do not support adding new devices this way.

@hamistao hamistao changed the title LXC: Implement profile extension on lxc copy LXC: Implement profile expansion on lxc copy Mar 13, 2024
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from b708308 to fb59e36 Compare March 13, 2024 14:21
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you add some tests to check for regressions. Thanks

@hamistao
Copy link
Contributor Author

Please can you add some tests to check for regressions. Thanks

sorry, I am not sure I understand what you mean by regressions

@tomponline
Copy link
Member

sorry, I am not sure I understand what you mean by regressions

By adding tests for the functionality you're adding you will ensure any future regressions are caught early.

@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from 8ba4bf2 to 835073e Compare March 14, 2024 19:58
lxc/copy.go Outdated Show resolved Hide resolved
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch 12 times, most recently from 7f58952 to 704dafc Compare March 18, 2024 19:48
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch 5 times, most recently from 4a67641 to 50b2d5c Compare March 19, 2024 09:22
lxc/copy.go Outdated Show resolved Hide resolved
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from 50b2d5c to 99a0447 Compare March 22, 2024 14:58
@hamistao hamistao marked this pull request as draft March 22, 2024 15:00
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from 99a0447 to e249594 Compare March 22, 2024 16:50
shared/util.go Show resolved Hide resolved
shared/util.go Outdated Show resolved Hide resolved
shared/util.go Outdated Show resolved Hide resolved
lxc/utils.go Outdated Show resolved Hide resolved
lxd/api_internal.go Show resolved Hide resolved
lxc/copy.go Outdated Show resolved Hide resolved
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from f19c3f0 to 8193c82 Compare March 22, 2024 21:30
@hamistao hamistao marked this pull request as ready for review March 25, 2024 14:26
Copy link
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just a few nits.

lxc/utils.go Show resolved Hide resolved
lxc/init.go Show resolved Hide resolved
lxc/copy.go Show resolved Hide resolved
lxc/copy.go Outdated Show resolved Hide resolved
@roosterfish
Copy link
Contributor

And please make sure to remove the .go suffixes from the commit messages. See my comment from before #13118 (comment).

Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
@hamistao hamistao force-pushed the issue13063/debug_copying_container_with_device branch from 8193c82 to 28163ad Compare March 25, 2024 18:20
Copy link
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tomponline tomponline merged commit c83a912 into canonical:main Mar 27, 2024
28 checks passed
@hamistao hamistao deleted the issue13063/debug_copying_container_with_device branch June 6, 2024 16:16
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.

lxc copy --device doesn't expand profile devices when overriding config
3 participants