Open
Description
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
root@redis:~# cat /var/log/cloud-init-output.log
Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'init-local' at Fri, 10 Jan 2025 19:54:07 +0000. Up 9.56 seconds.
2025-01-10 19:54:07,926 - url_helper.py[WARNING]: Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f68fdbf70>: Failed to establish a new connection: [Errno 101] Network is unreachable'))")] during request to http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
2025-01-10 19:54:07,927 - url_helper.py[ERROR]: Timed out, no response from urls: ['http://169.254.169.254/hetzner/v1/metadata/instance-id']
Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'init' at Fri, 10 Jan 2025 19:56:09 +0000. Up 131.52 seconds.
2025-01-10 19:58:09,953 - ubuntu.py[ERROR]: Failed to wait for network: Unexpected error while running command.
Command: ['systemctl', 'start', 'systemd-networkd-wait-online.service']
Exit code: 1
Reason: -
Stdout:
Stderr: Job for systemd-networkd-wait-online.service failed because the control process exited with error code.
See "systemctl status systemd-networkd-wait-online.service" and "journalctl -xeu systemd-networkd-wait-online.service" for details.
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
resource "hcloud_server" "redis" {
name = "redis"
server_type = var.server_type
image = var.image
location = var.location
ssh_keys = [var.ssh_key_id]
network {
network_id = var.network_id
ip = var.redis_ip
alias_ips = []
}
public_net {
ipv4_enabled = false
ipv6_enabled = false
}
}