-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Servers created with public_net disabled are delayed by 4 minutes on ubuntu 24.04 #1074
Comments
This comment has been minimized.
This comment has been minimized.
I'm experiencing the same thing. Is possible to disable metadata datasource using cloud-init as a workaround? I've tried few things without success. |
same here with
not even dns is working |
I was able to reproduce this bug using ubuntu 24.04, but didn't had any problems with debian-12. terraform {
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = "1.49.1"
}
}
}
data "hcloud_ssh_keys" "all" {}
resource "hcloud_network" "main" {
name = "main"
ip_range = "10.0.0.0/16"
}
resource "hcloud_network_subnet" "main" {
network_id = hcloud_network.main.id
type = "cloud"
network_zone = "eu-central"
ip_range = "10.0.1.0/24"
}
resource "hcloud_server" "bastion" {
name = "bastion"
server_type = "cx22"
image = "debian-12"
ssh_keys = data.hcloud_ssh_keys.all.ssh_keys.*.name
network {
network_id = hcloud_network.main.id
ip = "10.0.1.1"
alias_ips = []
}
}
resource "hcloud_server" "host" {
depends_on = [hcloud_network.main, hcloud_network_subnet.main]
name = "host"
server_type = "cx22"
image = "debian-12"
ssh_keys = data.hcloud_ssh_keys.all.ssh_keys.*.name
public_net {
ipv4_enabled = false
ipv6_enabled = false
}
network {
network_id = hcloud_network.main.id
ip = "10.0.1.2"
alias_ips = []
}
} On the host, while debian logs:
Ubuntu logs:
We can see the 2 x 2 minutes timeouts. While the server are created as fast as expected, cloud init does wait 4 additional minutes. I'll report this to the relevant team, and report back here. |
We believe that the source of the problem is a race between hc-utils, and cloud-init. We have an idea how to implement a fix, but it is not an easy one and will take some time to be fixed. I will try to come up with a ready to use workaround. EDIT: There is not easy workaround (directly from the user data) as far as I am aware. One may create a snapshot of the server after changing the network configuration on the disk (e.g setting https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v2.html#optional-bool or maybe disabling the |
Actually I'm already buiding new Ubuntu 24.04 cax11 snapshot weekly with latest updates based on this Packer example: https://github.com/hetznercloud/packer-plugin-hcloud/tree/main/example/docker. I'm only using upgrade.sh and cleanup.sh scripts. I tried to add
|
@perttuk In that case you may wanna try the other trick, by setting the |
I'm not sure if I did what I was supposed to, but after modifying Packer file to upload network:
ethernets:
enp7s0:
optional: true I was managed to cut start time in half: Creation complete after 2m28s I forgot to add that this slow start also happens with public_net enabled when using snapshot. |
@perttuk Yes, you implemented what I had in mind. Does the system logs show anything relevant?
|
I already destroyed the last server and now when re-created it it took 4m28s. Here is some logs. Hope these helps. I executed Terraform at 16:59
First journalctl log appears 2,5 mins later
System is up after 10 seconds
Then it idles for a while before starting ssh
That's about it. |
What happened?
Servers created with public_net disabled are delayed by 4 minutes at startup because "Failed to wait for network: Unexpected error while running command."
Trying to create an instance in an air-gapped environment (no public ip) using the code below:
The startup time of this instance is 4 minutes longer than if i enable ipv4_enabled.
Here is the output of /var/log/cloud-init-output.log
What did you expect to happen?
I expect a flag or someway to prevent waiting for network if there's no ip address
Please provide a minimal working example
The text was updated successfully, but these errors were encountered: