You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "MartinEmrich (via GitHub)" <gi...@apache.org> on 2023/10/23 09:33:48 UTC

[I] cloud-init not running after boot [cloudstack]

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: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2157472426

   Updated doc pr: https://github.com/apache/cloudstack-documentation/pull/383
   cc @DaanHoogland 


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2146981884

   @weizhouapache , is this an ACS issue?


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-1946363149

   I've added a note to the document
   https://cloudstack-documentation--383.org.readthedocs.build/en/383/adminguide/templates/_cloud_init.html#linux-with-cloud-init
   
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "MartinEmrich (via GitHub)" <gi...@apache.org>.
MartinEmrich commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-1774987982

   Out of curiosity: I looked at how Ubuntu (LTS 22.04 Server) handles cloud-init: After installing a fresh VM from the official CD-ROM:
   
   - cloud-init comes pre-installed (on Debian, it has to be installed manually)
   - it has all possible datasources enabled, including CloudStack
   - it forces cloud-init to always run by setting the (again unofficial) `policy: enabled` in _/etc/cloud/ds-identify.cfg_
   
   Thus Ubuntu will skip any autodetection and try the extensive list of Providers, including `CloudStack`.
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2161047327

   > ok, the doc change looks good to me. Any other work, or can we merge the doc and close this, @weizhouapache ?
   
   from I have investigated, it is impossible to change the manufactor and product name for vms on vmware and xenserver/xcpng
   
   I suggest we close this issue.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "MartinEmrich (via GitHub)" <gi...@apache.org>.
MartinEmrich commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-1775114686

   @weizhouapache thanks, I indeed noticed the revert issue during my research. 
   
   Debian 12 comes with an older cloud-init 22.4, so I have the original version of _ds-identify_ in either case.
   
   For the documentation, I guess mentioning Debian alongside CentOS (and fixing the small typo in the path) at the _ds-identify.cfg_ section is all that can be done now.
   
   And unless there's another way for a VM to tell a XenServer/XCP-ng host managed by CloudStack apart from a standalone one, it would be hard to add a fire&forget logic to cloud-init/ds-identify either.
   
   For now I get along well with that workaround with the configuration file.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-1775073805

   @MartinEmrich 
   I have created a PR to fix it in cloud-init  https://github.com/canonical/cloud-init/pull/4281
   
   it has been merged into cloud-init 23.3.1. but unfortunately it caused some regression on other providers, it has been reverted in PR https://github.com/canonical/cloud-init/issues/4501
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2159902233

   ok, the doc change looks good to me. Any other work, or can we merge the doc and close this, @weizhouapache ?


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2147085995

   > @weizhouapache , is this an ACS issue?
   
   The root cause is, the product name in dmidecode output inside the vms does not contain "cloudstack". 
   It is not a problem for kvm. I have no idea if it is possible for vms on vmware or xen/xcp-ng.
   @DaanHoogland 
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland closed issue #8129: cloud-init not running after boot
URL: https://github.com/apache/cloudstack/issues/8129


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2162179075

   @MartinEmrich , please see @weizhouapache 's comment above. I am closing the issue, but you are of course free to re-open or start a new one. In case implementation is uncertain, maybe a [discussion](https://github.com/apache/cloudstack/discussions/new/choose) is a better idea.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] cloud-init not running after boot [cloudstack]

Posted by "MartinEmrich (via GitHub)" <gi...@apache.org>.
MartinEmrich commented on issue #8129:
URL: https://github.com/apache/cloudstack/issues/8129#issuecomment-2162263937

   Ok. IDK if the documented change would work, too, bud the `ds-identify.cfg` file works fine for me.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org