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!