I've managed to have my cloudinit config inject successfully once a while ago and I believe I am following the same process although it's not a difficult process to screw up anyway.
Now however, it seems the guest VM is not injecting the config. Not even the user I created in the installation is removed, so then I am still able to login.
Upon checking the cloud.cfg file - it appears as though it is unchanged and default, not even a hostname change or user configuration.
The process I'm using is as follows:
- Create VM with official Ubuntu 18.04.4 Live ISO (on self-compiled latest of XO)
- Disk partitioning - I just use the entire disk
- The default cloud.cfg that Ubuntu ships with is fine - no modification required.
- Chose Openstack Config drive as the one and only source (do we need to tell it to use the Openstack metadata config too? Although I tried this didn't seem to yield any results anyway.)
- Finish up, remove traces of my user, halt the machine, convert to template.
Using
#cloud-config
hostname: test
No results however, I can see that the Config drive is indeed mounted in the system after boot.
Log shows that it does in fact attempt to set hostname
2020-08-21 07:50:33,280 - stages.py[DEBUG]: Running module set_hostname (<module 'cloudinit.config.cc_set_hostname' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_set_hostname.py'>) with frequency once-per-instance
Any clues? Thanks!