cloud-init
cloud-init copied to clipboard
feat(lxd): add s390x virtio-ports detection for LXD
- [x] I have signed the CLA: https://ubuntu.com/legal/contributors
- [x] I have included a comprehensive commit message using the guide below
- [x] I have added unit tests to cover the new behavior under
tests/unittests/- Test files should map to source files i.e. a source file
cloudinit/example.pyshould be tested bytests/unittests/test_example.py - Run unit tests with
tox -e py3
- Test files should map to source files i.e. a source file
- [x] I have kept the change small, avoiding unnecessary whitespace or non-functional changes.
- [x] I have added a reference to issues that this PR relates to in the PR message (Refs GH-1234, Fixes GH-1234)
- [x] I have updated the documentation with the changed behavior.
- If the change doesn't change the user interface and is trivial, this step may be skipped.
- Cloud-config documentation is generated from the jsonschema.
- Generate docs with
tox -e doc.
Proposed Commit Message
feat(lxd): add s390x virtio-ports detection for LXD
Support LXD detection on IBM's s390x architecture using virtio-ports
serial device detection. Add a new detection method which checks
LXD serial devices in /sys/class/virtio-ports/ for both current
(com.canonical.lxd) and legacy (org.linuxcontainers.lxd) names.
Update public LXD datasource documentation for this detection method.
Drop the now unnecessary DMI board name check from ds-identify and
DataSourceLXD because virtio-ports is sufficient for both KVM/QEMU
and s390x.
The following mechinisms for LXD detection are retained:
1. /dev/lxd/sock socket file (primary method)
2. virtio-ports serial device presence if socket is not yet active
Implements: PL073
Additional Context
Test Steps
git checkout upstream/ubuntu/questing -B ubuntu/questing
new_upstream_snapshot -c 5ff9034ffdac4a59a871384c1bd082c2589a1c4e
build-package
sbuild ....
CLOUD_INIT_OS_IMAGE=questing CLOUD_INIT_CLOUD_INIT_SOURCE=cloud-init_25.4~2gdef5afa3-0ubuntu1_all.deb CLOUD_INIT_PLATFORM=lxd_vm .tox/integration-tests/bin/pytest tests/integration_tests/datasources/test_lxd_discovery.py::test_lxd_kvm_datasource_discovery_without_lxd_socket
Merge type
- [x] Squash merge using "Proposed Commit Message"
- [ ] Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)
Additionally, we should add resolute support to pycloudlib per https://github.com/canonical/pycloudlib/pull/494