** Description changed: [ Impact ] - * if meta-data is not specified, virt-install generates the cloudinit ISO - without the meta-data configuration file. Since this file is mandatory - , the cloud-init ISO is ignored. + * if meta-data is not specified, virt-install generates the cloudinit ISO + without the meta-data configuration file. Since this file is mandatory + , the cloud-init ISO is ignored. * 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 ] - * Prepare a non-empty `user-data` file: /tmp/user-data.yaml + * Prepare a non-empty `user-data` file: /tmp/user-data #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=2 --import --os-variant ubuntu24.04 --cloud-init user- data="/tmp/user-data" --noautoconsole --dry-run --debug 2>&1 | grep Injecting WITHOUT THE FIX: ... Injecting src=/var/lib/libvirt/boot/virtinst-fdioq2hu-user-data dst=user-data into media=/var/lib/libvirt/boot/virtinst-74dp2v2w-cloudinit.iso WITH THE FIX: ... Injecting src=/var/lib/libvirt/boot/virtinst-z8wgbnoc-meta-data dst=meta-data into media=/var/lib/libvirt/boot/virtinst-j_387822-cloudinit.iso ... Injecting src=/var/lib/libvirt/boot/virtinst-rgt4t_mj-user-data dst=user-data into media=/var/lib/libvirt/boot/virtinst-j_387822-cloudinit.iso We can see that without the fix, only user-data file is created in the cloud-init ISO. [ 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
