had same problem / small discussion with tech support that it cannot be that the initramfs fails only in Hetzner cloud instances like this.
But Hetzner Support repeately states only that their DHCP server are compliant to RFC3442 which announces the default host route to the internal cloud GW. So this must be a problem of the initramfs dhcp client and they couldn't (wouldn't ?) try setup a perhaps possible BootP response e.g. with the right IP=... parameter.
I suggested to update their documentation for this but it seems the "feel free to use our wiki for documentation" ...
The (marketing ;) ... ) answer here is then not right:
Hetzner_OL 6 months ago [-]
Thanks for the suggestion about Docker/dbaas. I have passed it on to
our development team. We don't usually publish what new products and
features we are developing until they are ready, but we will continue
to post information about upgrades as they develop.
Regarding the DSGVO: Do you support encryption of the filesystem? ->
Hetzner Cloud servers are fully virtualized. So the customer can even
fully encrypt the whole server. --Katie, Marketing, Hetzner Online
I tried finding questions/solutions for this problem but the only match I found today is your question ;)
Your referenced answer for setup the interface is partly correct. But from question it wasn't clear that he also needs a static host route to the gateway so it's missing in the answer.
My quick solution of the problem is to patch manually the needed function like this "dynamically" - you can check all your variables in /run/net-ens3.conf
:
root@image-debian-jessie-94 ~ # diff -p /usr/share/initramfs-tools/scripts/functions{.orig,}
*** /usr/share/initramfs-tools/scripts/functions.orig 2018-07-31 12:46:40.911167456 +0200
--- /usr/share/initramfs-tools/scripts/functions 2018-07-31 12:50:30.736742035 +0200
*************** configure_networking()
*** 274,279 ****
--- 274,284 ----
# ipconfig should have quit after first response
. /run/net-*.conf
fi
+
+ # Hack for Hetzner vServer static route enhanced like shown partly in this answer:
+ # https://serverfault.com/questions/909040/static-route-in-initramfs
+ ip route add ${IPV4GATEWAY}/${IPV4NETMASK} dev ${DEVICE}
+ ip route add default via ${IPV4GATEWAY} dev ${DEVICE}
}
# Wait for queued kernel/udev events
Tested and worked fine for me. I could setup / snapshot the smallest image.
The encrypted snapshot is ~18 GB compared to 0,5 GB unencrypted but snapshot price is still fine compared to improved security (normally Openstack based systems could/should have a key manager service which can this transparently. ;)