/srv/irclogs.ubuntu.com/2022/07/04/#ubuntu-server.txt

p3limhi, trying to set up a common autoinstall cloud-init user-data for all machines, which means we want to set the hostname for each machine somewhere else; meta-data is ignored, `ds=nocloud-net;h=` is ignored, the hostname we send from our DHCP server is ignored, how can I set the hostname of a machine _without_ doing it in user-data?11:43
rbasakp3lim: I think normally it's done from meta-data. Maybe figure out why it's being ignored for you?11:46
rbasakTake for example any regular official Ubuntu image. The hostname does get set, even when userdata only contains an ssh key.11:47
p3lim `ds=nocloud-net;h=` is the equivalent to setting hostname in meta-data, right?11:48
p3limI have tried both and both are getting ignored, with the 22.04 live-server ISO11:48
p3limfull kernel line:   /casper/vmlinuz autoinstall ds=nocloud-net\;s=http://.../ubuntu/\;h=ubuntu-test-vm ---11:50
rbasakI've never used that mechanism, sorry.11:50
rbasakI suspect that's the bit you need to focus on though.11:51
rbasakMaybe that setting isn't getting through to cloud-init for whatever reason.11:51
utkarsh2102rbasak: hey, are you working today?11:52
rbasakYes11:56
rbasakp3lim: wait. Why are the semicolons backslash-escaped?11:56
rbasakp3lim: and if you're setting s=, why do you need h=?11:57
p3limsemicolons because I set this in the ISO's grub menu, I need to escape the backslashes there11:58
p3limand I'm setting h= because meta-data is not being used, trying everything now to set the hostname outside of user-data11:58
rbasakThe code is here: https://github.com/canonical/cloud-init/blob/5bdc217b431b9cb5eedf9fd7372be733ba36ec25/cloudinit/sources/DataSourceNoCloud.py#L29412:06
p3limI'm not questioning the cloud-init code, I'm sure it works fine12:08
p3limbut I am questioning how subiquity is using it, because no matter what I do it's not getting used12:09
rbasakAh you didn't mention subiquity.12:11
rbasakI'm not sure how it interacts with what you're trying to do.12:12
p3limwell I'm using the 22.04 ISO with autoinstall, so subiquity is implied, there's no way around subiquity right?12:12
p3limtrying to set the hostname using `early-commands: ['hostname test']`, but this also doesn't do anything, the machine still ends up with localhost as its hostname13:19
=== oerheks1 is now known as oerheks

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!