MartinEmrich opened a new issue, #8129:
URL: https://github.com/apache/cloudstack/issues/8129

   ##### 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)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to