XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Cloud init FAIL: no local data found from DataSourceNoCloud

    Scheduled Pinned Locked Moved Management
    2 Posts 1 Posters 267 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mang0MusztardaM Offline
      Mang0Musztarda
      last edited by

      Hi,
      I’m looking for help with cloud-init NoCloud on XCP-ng / Xen Orchestra using a custom Oracle Linux 9.6 template.

      I installed Oracle Linux 9.6 as a VM, then prepared it for cloud-init and converted it into a template.
      Installed packages:

      dnf install -y cloud-init cloud-utils-growpart
      

      Enabled services:

      systemctl enable cloud-init
      systemctl enable cloud-init-local
      systemctl enable cloud-config
      systemctl enable cloud-final
      

      Cleanup before templating:

      rm -f /etc/NetworkManager/system-connections/*
      rm -f /etc/systemd/network/*.link
      cloud-init clean --logs --machine-id --seed
      rm -rf /var/lib/cloud/*
      truncate -s 0 /etc/machine-id
      rm -f /var/lib/dbus/machine-id
      

      my /etc/cloud/cloud.cfg

      # Cloud-init main configuration
      
      users: []
      
      disable_root: false
      preserve_hostname: false
      
      datasource_list: [ NoCloud ]
      datasource:
        NoCloud:
          seedfrom: /dev/xvdb
      
      cloud_init_modules:
        - migrator
        - seed_random
        - bootcmd
        - write-files
        - growpart
        - resizefs
        - set_hostname
        - update_hostname
        - update_etc_hosts
        - rsyslog
        - users-groups
        - ssh
      
      cloud_config_modules:
        - mounts
        - locale
        - set-passwords
        - timezone
        - ntp
        - disable_ec2_metadata
      
      cloud_final_modules:
        - scripts-per-once
        - scripts-per-boot
        - scripts-per-instance
        - scripts-user
        - final-message
      
      system_info:
        distro: rhel
        default_user:
          name: root
        ssh_svcname: sshd
      
      network:
        config: disabled
      

      After creating a VM from this template and enabling Cloud Config Drive in Xen Orchestra, cloud-init does not detect NoCloud data.
      From /var/log/cloud-init.log:

      2025-12-31 14:59:08,377 - handlers.py[DEBUG]: finish: init-local/search-NoCloud: FAIL: no local data found from DataSourceNoCloud
      2025-12-31 14:59:08,377 - log_util.py[WARNING]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloud'> failed
      2025-12-31 14:59:08,377 - log_util.py[DEBUG]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloud'> failed
      Traceback (most recent call last):
        File "/usr/lib/python3.9/site-packages/cloudinit/sources/__init__.py", line 1061, in find_source
          if s.update_metadata_if_supported(
        File "/usr/lib/python3.9/site-packages/cloudinit/sources/__init__.py", line 937, in update_metadata_if_supported
          result = self.get_data()
        File "/usr/lib/python3.9/site-packages/cloudinit/performance.py", line 103, in decorator
          return func(*args, **kwargs)
        File "/usr/lib/python3.9/site-packages/cloudinit/sources/__init__.py", line 493, in get_data
          return_value = self._check_and_get_data()
        File "/usr/lib/python3.9/site-packages/cloudinit/sources/__init__.py", line 424, in _check_and_get_data
          return self._get_data()
        File "/usr/lib/python3.9/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 181, in _get_data
          if seedfrom.startswith(proto):
      AttributeError: 'list' object has no attribute 'startswith'
      

      XO creates XO CloudConfigDrive as /dev/xvdb, but cloud init can't read from it or can't event detect it

      Mang0MusztardaM 1 Reply Last reply Reply Quote 0
      • Mang0MusztardaM Offline
        Mang0Musztarda @Mang0Musztarda
        last edited by

        And my cloud config:

        #cloud-config
        hostname: {name}%
        

        Network config:

        network:
          version: 1
          config:
            - type: physical
              name: enX0
              subnets:
                - type: static
                  address: 172.1.1.2
                  netmask: 255.255.255.0
                  gateway: 172.1.1.1
        
        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post