Skip to content

run-container: add support for LXD VMs (SC-981)#1428

Merged
TheRealFalcon merged 1 commit into
canonical:mainfrom
paride:run-container-vm-support
May 4, 2022
Merged

run-container: add support for LXD VMs (SC-981)#1428
TheRealFalcon merged 1 commit into
canonical:mainfrom
paride:run-container-vm-support

Conversation

@paride
Copy link
Copy Markdown
Contributor

@paride paride commented May 4, 2022

Proposed Commit Message

run-container: add support for LXD VMs

Images of older releases (e.g. CentOS 7) can't run as containers on
newer Ubuntu releases because they need a CGroupV1 host system. They
can however run as VMs.

Additional Context

This change will be backported to the stable-19.4 branch, which
is used in Jenkins to test builds of 19.4 on CentOS 7.

Test Steps

This will fail to launch the container:

./tools/run-container centos/7 --source-package --artifacts=.

This will not fail to launch the container

./tools/run-container centos/7 --source-package --artifacts=. --vm

It will however fail for other unrelated reasons.

Full test in VM mode:

./tools/run-container centos/8-Stream --source-package --artifacts=. --vm

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

Images of older releases (e.g. CentOS 7) can't run as containers on
newer Ubuntu releases because they need a CGroupV1 host system. They
can however run as VMs.
Comment thread tools/run-container
local src="$1" name="$2" use_vm="$3"
debug 1 "starting container $name from '$src'"
lxc launch "$src" "$name" || {
launch_flags=()
Copy link
Copy Markdown
Contributor Author

@paride paride May 4, 2022

Choose a reason for hiding this comment

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

This lays foundation for another change I have in mind: use ephemeral containers: when handling multiple parameters arrays as much more convenient.

@paride paride changed the title run-container: add support for LXD VMs run-container: add support for LXD VMs (SC-981) May 4, 2022
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@TheRealFalcon TheRealFalcon merged commit d114998 into canonical:main May 4, 2022
aciba90 pushed a commit to aciba90/cloud-init that referenced this pull request May 10, 2022
Images of older releases (e.g. CentOS 7) can't run as containers on
newer Ubuntu releases because they need a CGroupV1 host system. They
can however run as VMs.
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.

2 participants