Results 1 to 8 of 8

Thread: Cloud-init does not run

  1. #1

    Default Cloud-init does not run

    Hi

    I try to configure openSUSE 42.3 VMs using cloud-init with the nocloud datasource. I created an iso which works without any problems in Debian, RHEL/CentOS and Ubuntu. Only in opensuse, it does not work. By 'not work' I mean, that it does not get loaded or executed at any time in the boot process. I do not see anything in /var/log, (actually, /var/log/cloud-init.log does not exist after booting), nor in dmesg or journal. I enabled all the services (cloud-init.service, cloud-init-local.service, cloud-config.service and cloud-final.service) but still no result. I know the iso works, because after running
    Code:
    cloud-init init
    everything looks fine. Has anyone an idea where I might look for further hints?

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Cloud-init does not run

    For each of the services you created, check the status with the following command which should include a log snippet relevant to the service's successful startup or failure.
    Code:
    systemctl status service_name
    If you have problems interpreting the results, post them for all to see and comment.

    If the results say that they all started successfully and are running, then if you created Unit files, you should post those as well. Else, if you're deploying only the standard init files, that's probably of less interest.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3

    Default Re: Cloud-init does not run

    The service files are the ones shipped with the installation of cloud-init-17.1-34.2.x86_64 and cloud-init-config-suse-17.1-34.2.x86_64 from the openSuSE Update OSS repo. As they are oneshot-units, all their statuses look the same:

    Code:
    linux-7ymr:~ # systemctl status cloud-init.service
    cloud-init.service - Initial cloud-init job (metadata service crawler)
      Loaded: loaded (/usr/lib/systemd/system/cloud-init.servicel; enabledl; vendor preset: disabled)
      Active: inactive (dead)
    I have no logs or anything to work on, it "simply does not run":

    Code:
    linux-7ymr:~ # ls -l /var/log/cloud*
    ls: cannot access '/var/log/cloud*': No such file or directory
    linux-7ymr:~ # journalctl | grep cloud | wc -l
    0
    linux-7ymr:~ # dmesg | grep cloud | wc -l
    0

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Cloud-init does not run

    OK
    What is your result when you run the following?
    Code:
    systemctl start cloud-init.service
    You might also get results by searching your journal in the following ways...

    Return errors (all levels) in your current boot log
    Code:
    journalctl -p err -b
    All entries related to your cloud.init.service running within the last 24 hrs (You can also pass other time constraint filters like within the past hour, last week, specify minutes etc)
    Code:
    journalctl -u cloud-init.service --since today
    BTW - did you manually type in the "systemctl status" result in your earlier post?
    I see what might be typos... If you copy and pasted, then you might have an odd problem.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: Cloud-init does not run

    If I run
    Code:
    systemctl start cloud-init.service
    it runs just fine. Journalctl only reports an error in wickedd:

    Code:
    May 24 16:01:53 linux-7ymr audispd[836]: No plugins found, exiting
    May 24 16:01:56 linux-7ymr wickedd[988]: ni_process_reap: process 1434 has not exited yet; now doing a blocking waitpid()
    May 24 16:06:56 linux-7ymr wickedd[988]: ni_process_reap: process 5545 has not exited yet; now doing a blocking waitpid()
    May 24 16:16:56 linux-7ymr wickedd[988]: ni_process_reap: process 13409 has not exited yet; now doing a blocking waitpid()
    ... (it just goes on with wickedd errors every 10mins)
    And yes, I had to type it in manually. I work on the serial console of HyperV over RDP on a windows server. Don't ask - copy/paste is just not working

    Code:
    journalctl -u cloud-init.service
    only shows the entries generated by my manual run of
    Code:
    systemctl start cloud-init.service

  6. #6

    Default Re: Cloud-init does not run

    Ok, i found a solution that seems to work. If this is the way to go, SUSE broke the package. If not, I'm just too stupid to see the right way of doing it.

    First disable all four services:
    Code:
    systemctl disable cloud-init.service cloud-final.service cloud-init-local.service cloud-config.service
    Change one line in the following files:
    Code:
    /usr/lib/systemd/system/cloud-init.service
    /usr/lib/systemd/system/cloud-final.service
    /usr/lib/systemd/system/cloud-init-local.service
    /usr/lib/systemd/system/cloud-config.service
    And perform the following change:
    Code:
    < WantedBy=cloud-init.target
    ---
    > WantedBy=multi-user.target
    Then, enable the services again. You will see, that they get symlinked into /etc/systemd/system/multi-user.target.wants:
    Code:
    systemctl enable cloud-init.service cloud-final.service cloud-init-local.service cloud-config.service

  7. #7

    Default Re: Cloud-init does not run

    For thous who will search the answer.
    1. besides service and target files cloud init has its own generator that helps systemd to decide when to launch service.
    2. There are 2 documented cases when generator decided not to include cloud init in to boot goals even if service is enabled - https://cloudinit.readthedocs.io/en/...html#generator.
    But there is one more case - generator could not detect datasource. To change this behavior modify defaul cloud.cfg with your datasource or change generator config.
    https://github.com/canonical/cloud-i...ls/ds-identify
    Create file ds-identify.cfg with data:
    Code:
    policy: search,found=all,maybe=none,notfound=enabled

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,823

    Default Re: Cloud-init does not run

    Dear or4uk,

    This thread is more then three years old. The OP declared it as solved. Do you really think may people are still watching this?
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •