/srv/irclogs.ubuntu.com/2023/07/13/#cloud-init.txt

=== esv_ is now known as esv
carbonatoranybody using cloud-init with Hetzner? I'm stuck at how to chpasswd the root-pwd, and how to make the VM aware of the private network so I can install packages11:40
meenacarbonator: if cloud-init isn't configuring the private network, what does the network config look like?11:52
carbonatormeena: currently, the relevant parts are https://pastebin.com/5V9MgUqD11:54
meenano, that's your config11:54
meenai mean, what does Hetzner send as network config?11:55
carbonatorit sends 10.0.0.1 as their gateway, the 10.0.0.10 for the VM, and the 10.0.0.2 is the firewall11:56
carbonatorit's working fine after cloud-init is done, just not during the deployment12:00
meenacarbonator: https://pastebin.com/5V9MgUqD isn't your full config, or? what is actually failing?12:04
carbonatormeena: it's just the part about network. I ry to install packages in runcmd too, but that fails because there is no network available.12:08
meenahttps://github.com/canonical/cloud-init/blob/main/config/cloud.cfg.tmpl12:14
meenahttps://github.com/canonical/cloud-init/blob/main/config/cloud.cfg.tmpl#L8012:14
meenathis is the set of modules that runs before we have network12:15
carbonatormeena: that's my config (with some info as ****) https://pastebin.com/J6Xnfv2312:21
carbonatorinstall/update in lines 52/53 fails (sorry for the delay, but work keeps me busy)12:22
meenacan you show us the log files? I don't understand why the network is not setup properly, that you think you need to set it up yourself12:31
carbonatormeena: okay to pm?12:46
meenacarbonator: sure 12:50
minimalcarbonator: Hetzner should be providing the network config to cloud-init13:50
carbonatorminimal: it does, and network is available when the VM creation is done, but network is unavailable during while the creation is running (for the records, there is no public IP on the VM, just a private IP)13:53
minimalcarbonator: what do you mean by "during while the creation is running"? during the creation of what?13:53
carbonatorminimal: I start the creation of the VM via terraform, and that pushes a yaml with the config. after a few minutes, the VM has been created and is then idling13:55
minimalok, and so what is the problem?13:56
carbonatorin the runcmd block, I try to eg update the install, which fails (package_update: true did too)13:57
minimalthe cloud-init Hetzner DataSource should configure the network, so why are you configuring it in user-data?13:58
carbonatorI was told by them that with a private network, I need to remove hc-utils and create an ifcfg (as in https://docs.hetzner.com/cloud/networks/server-configuration/)14:00
minimalcloud-init does not use hc-utils AFAIK14:01
minimalhave you looked at /var/log/cloud-init.log to see what is happening? If debug is enabled then it should show cloud-init talking to the Hetzner metadata server, getting network info from it and configuring the networking14:02
carbonatorminimal: went through it with meena14:03
minimaland? what did the logs show?14:03
minimalok, it seems to me that the problem is that the Hetzner DataSource in cloud-init does use the "network-config" provided by Hetzner's metadata server but it does *not* use the "private-networks" section provided by Hetzner's metadata server14:06
minimalHetzner wrote the Hetzner DataSource in cloud-init, looks like they have not (yet) updated it to add this functionality14:07
carbonatorand there is no workaround until they do I guess?14:08
minimalwell what you added in user-data to configure the private stuff should be a valid workaround14:09
minimalso it is failing at the "dnf -y update"?14:13
minimalhave you tried does a "curl http://169.254.169.254/hetzner/v1/metadata/private-networks" to see what that returns?14:14
meenafrom the logs carbonator showed me, it looks like the network is setup correctly 14:15
carbonatorit returns the correct network info14:16
minimalcarbonator: what error is "dnf -y update" failing with? if it is network issue?14:16
minimals/if /is /14:17
carbonatorone sec, pulling the other log14:17
carbonatorhttps://pastebin.com/srma1xCU14:18
minimalthat doesn't show any public IP addresses configured - so how will it get to mirrors.rocklinux.org without a public IP address?14:20
carbonatorall the traffic goes through the firewall. like I said, that works fine once the VM provision is done14:21
minimalonce the VM provision is done or once the firewall provision is done?14:22
carbonatorVM. firewall is up and running a week now14:22
minimalthat doesn't make sense14:23
minimaltry adding a single "ping" call to the runcmd before running "dnf" to see if it can ping the firewall?14:23
carbonatorI'll config a bit more, like dumping network config etc during creation and see what I get14:24
minimalanother idea - perhaps "systemctl restart NetworkManager" hasn't finished bringing up the interface before you run "dnf"? try adding a "sleep" to delay "dnf" execution?14:25
carbonatoroh, good idea, will do :)14:25
minimalwell dumping network config would show if its up or not after restart14:26
carbonatormeh, work would be more fun if it wasn't for customers. will have to delay debugging to tomorrow14:49
minimalI suspect you'll find it is a race condition14:52
minimalcarbonator: Hetzner private network interfaces apparently have a MTU of 1450, so you'll need to set this14:59
meenathis tox call makes me really jealous https://github.com/canonical/cloud-init/issues/424818:00
-ubottu:#cloud-init- Issue 4248 in canonical/cloud-init "tests: ansible galaxy unable to install collections with Traceback" [Open]18:00
meenatime to sit down and write a FreeBSD kernel module18:01
=== dbungert1 is now known as dbungert
=== Cadey is now known as Xe
blackboxswmeena we'll get there :) freebsd kernel module for lxd integration ?22:34
meenablackboxsw: We need a virtio vsock module 22:35
meenaI should probably look at the HyperV vsock module as a starting point22:35

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