-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
ISSUE TYPE
- Documentation Report
COMPONENT NAME
Documentation, cloud-init
CLOUDSTACK VERSION
4.18.1.0
CONFIGURATION
Hypervisor: XCP-ng 7.5
OS / ENVIRONMENT
VMs: Debian 12
SUMMARY
Cloud-init not starting, as datasource CloudStack is not detected.
STEPS TO REPRODUCE
- Create VM from Debian 12.2 netinst ISO
- install cloud-init
- configure cloud-init just as for Ubuntu (http://docs.cloudstack.apache.org/en/4.18.1.0/adminguide/templates/_cloud_init.html)
- prepare cloud-init (`cloud-init clean -l --seed --reboot)
EXPECTED RESULTS
(Assumption: Ubuntu configuration should closely-enough match Debian)
cloud-init should run and configure the OS.
ACTUAL RESULTS
cloud-init does not run at all.
Additional info:
After some research: (at least on Debian) cloud-init includes a "systemd generator" using ds-identify. That script tries to detect the correct datasource, but fails. If it does not detect any datasource, it will disable cloud-init completely, resulting in no cloud-init logs whatsoever.
Looking at the source code, it tries to determine whether it runs on CloudStack by using the DMI product_name field: https://github.com/canonical/cloud-init/blob/22.4.x/tools/ds-identify#L739-L743
But on XenServer (I bet on VMWare, Hyper-V, etc, too), this just returns a generic HVM domU. (I suspect the documentation was written only with KVM in mind, and the Cloudstack Agent for KVM somehow configures KVM to producte that DMI product_name)
While the latest version (http://docs.cloudstack.apache.org/en/latest/adminguide/templates/_cloud_init.html) does not, the 4.18.1.0 version of the documentation gives a hint for CentOS (although with a typo): http://docs.cloudstack.apache.org/en/4.18.1.0/adminguide/templates/_cloud_init.html
Editing the /etc/cloud/ds-identify.cfg file to override the datasource works on Debian 12, too. After adding that file with
datasource: CloudStack
cloud-init runs as expected.
Additional note: In https://bugs.launchpad.net/cloud-init/+bug/1892171/comments/4 , at least one cloud-init developer/contributor marks ds-identify.cfg as undocumented, meaning not a public stable interface.
It looks like the kernel command line is the official way to override the cloud-init datasource. (Idk though whether this comes from Cloudstack, especially in the HVM case, or if it has to be configured in the VM bootloader by the image author)