Score:0

Cloud-init Empty User-data

us flag

Problem

I have been trying (and failing) to get Ubuntu 20.04 to autoinstall. It keeps going through most of the process, but when I try to access the SeedFile s=http://myip:port/file it will successfully access the file (according to my webserver logs /var/log/httpd/access_log, but then when I try and view the user-data file in my installer shell its blank.

When I check my cloud-init logs /var/log/cloud-init.log it shows a few peculiar errors. But I can't figure out how to resolve them.

util.py[DEBUG]: Read 0 bytes from /var/lib/cloud/seed/nocloud/user-data
...
util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types
...
util.py[WARNING]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloudNet'> failed

Note: not necessarily in order of appearance.

Making my ask

Can anyone explain why the cloud-init process isn't successfully loading/writing my user-data file?

Score:0
us flag

Answer

So I'm not entirely sure why the user-data file is empty as seen from the installer. My guess is that the cloud-init program is cutting content from it rather then copying it out. But I can't say for sure. NOW the solution to the problem that lead me to ask this, was READ THE !@#$!@ CLOUD-INIT FAQs!!!

Basically all I had to do to stop my cloud-init from failing back to the default install DataSource, was to properly configure my user-data file by making sure the first line of the file contained ONLY #cloud-config

I know this doesn't actually answer the question "why is my user-data empty" but it solved my problem so I consider it the answer. :)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.