XCP-ng

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. gobest20
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 1
    • Controversial 0
    • Groups 0

    gobest20

    @gobest20

    2
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    gobest20 Unfollow Follow

    Best posts made by gobest20

    • RE: centos 8 cloud image + not changing cloud config hostname

      Maybe a bit late, but I have the same Problem in centos8!

      I suppose the reason is a bug in the cloud-init version in Centos8 because of this message:

      Traceback (most recent call last):
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/__init__.py", line 733, in find_source
          if s.update_metadata([EventType.BOOT_NEW_INSTANCE]):
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/__init__.py", line 622, in update_metadata
          result = self.get_data()
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/__init__.py", line 256, in get_data
          return_value = self._get_data()
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 126, in _get_data
          mydata = _merge_new_seed(mydata, seeded)
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 353, in _merge_new_seed
          util.load_yaml(seeded.get('network-config')))
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 324, in _maybe_remove_top_network
          network_val = cfg.get('network', nullval)
      AttributeError: 'NoneType' object has no attribute 'get'
      

      So the trick is, you have to add some content into the network-config
      (It doesn't matter if you disable the network config in your cloud.cfg):

      #network:
      version: 1
      

      And then you can set the hostname in the user-data with

      #cloud-config
      fqdn: {name}.localdomain.local
      

      Cheers!

      posted in Xen Orchestra
      G
      gobest20

    Latest posts made by gobest20

    • RE: centos 8 cloud image + not changing cloud config hostname

      Maybe a bit late, but I have the same Problem in centos8!

      I suppose the reason is a bug in the cloud-init version in Centos8 because of this message:

      Traceback (most recent call last):
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/__init__.py", line 733, in find_source
          if s.update_metadata([EventType.BOOT_NEW_INSTANCE]):
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/__init__.py", line 622, in update_metadata
          result = self.get_data()
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/__init__.py", line 256, in get_data
          return_value = self._get_data()
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 126, in _get_data
          mydata = _merge_new_seed(mydata, seeded)
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 353, in _merge_new_seed
          util.load_yaml(seeded.get('network-config')))
        File "/usr/lib/python3.6/site-packages/cloudinit/sources/DataSourceNoCloud.py", line 324, in _maybe_remove_top_network
          network_val = cfg.get('network', nullval)
      AttributeError: 'NoneType' object has no attribute 'get'
      

      So the trick is, you have to add some content into the network-config
      (It doesn't matter if you disable the network config in your cloud.cfg):

      #network:
      version: 1
      

      And then you can set the hostname in the user-data with

      #cloud-config
      fqdn: {name}.localdomain.local
      

      Cheers!

      posted in Xen Orchestra
      G
      gobest20