** Description changed: [ Impact ] - * virt-install's `--cloud-init user-data=...` option is silently ignored - when invoked without an accompanying `meta-data=...` argument. This is a - regression introduced upstream in virt-manager 5.1.0 by the cloud-init - config-file refactor (commit 5b2d0997a1d2d213b17c227169da64e2fa7d09a6). + * virt-install's `--cloud-init user-data=...` option is silently ignored + when invoked without an accompanying `meta-data=...` argument. This is a + regression introduced upstream in virt-manager 5.1.0 by the cloud-init + config-file refactor (commit 5b2d0997a1d2d213b17c227169da64e2fa7d09a6). - * This affects any user relying on the common, documented invocation - `virt-install --cloud-init user-data=<file>` without also specifying - `meta-data=`, and results in newly provisioned guests silently not - receiving the cloud-init configuration. + * This affects any user relying on the common, documented invocation + `virt-install --cloud-init user-data=<file>` without also specifying + `meta-data=`, and results in newly provisioned guests silently not + receiving the cloud-init configuration. - * Fixed upstream in commit ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23. + * Fixed upstream in commit ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23. [ Test Plan ] - * On the affected release, install/upgrade to the virt-manager package - containing the fix. + * On the affected release, install/upgrade to the virt-manager package + containing the fix. - * Prepare a non-empty `user-data` file, e.g.: - #cloud-config - write_files: - - path: /tmp/sru-test - content: hello + * Prepare a non-empty `user-data` file, e.g.: + #cloud-config + write_files: + - path: /tmp/sru-test + content: hello - * Run virt-install without a meta-data argument, e.g.: - virt-install --connect qemu:///system --name sru-test \ - --memory 1024 --disk size=5 --import \ - --os-variant <variant> \ - --cloud-init user-data=/path/to/user-data \ - --noautoconsole + * Run virt-install without a meta-data argument, e.g.: + virt-install --connect qemu:///system --name sru-test --memory 1024 --disk size=5 --import --os-variant <variant> --cloud-init user-data=/path/to/user-data --noautoconsole - * Inspect the generated cloud-init config ISO (path logged by virt-install, - or find it under the libvirt image pool) and confirm it now contains - BOTH a `user-data` and a `meta-data` file: - isoinfo -i <cloudinit>.iso -l + * Inspect the generated cloud-init config ISO (path logged by virt-install, + or find it under the libvirt image pool) and confirm it now contains + BOTH a `user-data` and a `meta-data` file: + isoinfo -i <cloudinit>.iso -l - * Boot the guest and confirm cloud-init applied the user-data, e.g. check - for /tmp/sru-test inside the guest, or `cloud-init status --long` shows - no "NoCloud" datasource detection failure. + * Boot the guest and confirm cloud-init applied the user-data, e.g. check + for /tmp/sru-test inside the guest, or `cloud-init status --long` shows + no "NoCloud" datasource detection failure. - * Before the fix: the meta-data file is absent from the ISO and the - user-data is never applied to the guest. After the fix: both files are - present and the user-data is applied as expected. + * Before the fix: the meta-data file is absent from the ISO and the + user-data is never applied to the guest. After the fix: both files are + present and the user-data is applied as expected. [ Where problems could occur ] - * The fix changes a single predicate in `_CloudInitConfig._create_file()` - from `if not content:` to `if content is None:`. This only changes - behaviour for the previously-mishandled case where the generated content - is an empty string (empty meta-data) — that case now correctly produces - a (empty) file instead of being skipped. All other cases (user-data, - vendor-data, network-config, or meta-data with actual content) continue - to return non-empty strings and are unaffected by this change. + * The fix changes a single predicate in `_CloudInitConfig._create_file()` + from `if not content:` to `if content is None:`. This only changes + behaviour for the previously-mishandled case where the generated content + is an empty string (empty meta-data) — that case now correctly produces + a (empty) file instead of being skipped. All other cases (user-data, + vendor-data, network-config, or meta-data with actual content) continue + to return non-empty strings and are unaffected by this change. - * Low regression risk: the change cannot affect guests that were already - working (non-empty content paths are untouched) + * Low regression risk: the change cannot affect guests that were already + working (non-empty content paths are untouched) [ Other Info ] - * Upstream fix: https://github.com/virt-manager/virt-manager/commit/ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23 - * Upstream issue: https://github.com/virt-manager/virt-manager/issues/975 - * Regression introduced by: https://github.com/virt-manager/virt-manager/commit/5b2d0997a1d2d213b17c227169da64e2fa7d09a6 (virt-manager 5.1.0) + * Upstream fix: https://github.com/virt-manager/virt-manager/commit/ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23 + * Upstream issue: https://github.com/virt-manager/virt-manager/issues/975 + * Regression introduced by: https://github.com/virt-manager/virt-manager/commit/5b2d0997a1d2d213b17c227169da64e2fa7d09a6 (virt-manager 5.1.0) ---- Since virt-manager 5.1.0, cloud-init's user-data gets ignored when passing the following option: --cloud-init user-data=xxx without specifying a meta-data=xxx argument. There is an upstream bug report: https://github.com/virt-manager/virt- manager/issues/975 with a fix that we can backport.
** Description changed: [ Impact ] * virt-install's `--cloud-init user-data=...` option is silently ignored when invoked without an accompanying `meta-data=...` argument. This is a regression introduced upstream in virt-manager 5.1.0 by the cloud-init config-file refactor (commit 5b2d0997a1d2d213b17c227169da64e2fa7d09a6). * This affects any user relying on the common, documented invocation `virt-install --cloud-init user-data=<file>` without also specifying `meta-data=`, and results in newly provisioned guests silently not receiving the cloud-init configuration. * Fixed upstream in commit ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23. [ Test Plan ] * On the affected release, install/upgrade to the virt-manager package containing the fix. - * Prepare a non-empty `user-data` file, e.g.: + * Prepare a non-empty `user-data` file: /tmp/user-data.yaml #cloud-config write_files: - path: /tmp/sru-test content: hello * Run virt-install without a meta-data argument, e.g.: - virt-install --connect qemu:///system --name sru-test --memory 1024 --disk size=5 --import --os-variant <variant> --cloud-init user-data=/path/to/user-data --noautoconsole + virt-install --connect qemu:///system --name sru-test --memory 1024 --disk size=5 --import --os-variant ubuntu24.04 --cloud-init user-data=/tmp/user-data.yaml --noautoconsole * Inspect the generated cloud-init config ISO (path logged by virt-install, or find it under the libvirt image pool) and confirm it now contains BOTH a `user-data` and a `meta-data` file: isoinfo -i <cloudinit>.iso -l * Boot the guest and confirm cloud-init applied the user-data, e.g. check for /tmp/sru-test inside the guest, or `cloud-init status --long` shows no "NoCloud" datasource detection failure. * Before the fix: the meta-data file is absent from the ISO and the user-data is never applied to the guest. After the fix: both files are present and the user-data is applied as expected. [ Where problems could occur ] * The fix changes a single predicate in `_CloudInitConfig._create_file()` from `if not content:` to `if content is None:`. This only changes behaviour for the previously-mishandled case where the generated content is an empty string (empty meta-data) — that case now correctly produces a (empty) file instead of being skipped. All other cases (user-data, vendor-data, network-config, or meta-data with actual content) continue to return non-empty strings and are unaffected by this change. * Low regression risk: the change cannot affect guests that were already working (non-empty content paths are untouched) [ Other Info ] * Upstream fix: https://github.com/virt-manager/virt-manager/commit/ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23 * Upstream issue: https://github.com/virt-manager/virt-manager/issues/975 * Regression introduced by: https://github.com/virt-manager/virt-manager/commit/5b2d0997a1d2d213b17c227169da64e2fa7d09a6 (virt-manager 5.1.0) ---- Since virt-manager 5.1.0, cloud-init's user-data gets ignored when passing the following option: --cloud-init user-data=xxx without specifying a meta-data=xxx argument. There is an upstream bug report: https://github.com/virt-manager/virt- manager/issues/975 with a fix that we can backport. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2171406 Title: virt-install --cloud-init user-data=... ignored when no meta-data is specified To manage notifications about this bug go to: https://bugs.launchpad.net/virt-manager/+bug/2171406/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
