You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After flatcar-reset and a reboot on a Hetzner VPS, /etc/hostname does not exist and the machine's hostname will default to localhost.
Impact
You must manually ssh in to set the hostname, or remember to add -K /etc/hostname to flatcar-reset.
Environment and steps to reproduce
Build and upload a snapshot of Flatcar for Hetzner following these steps and hcloud-upload-image. In this case it is Flatcar Container Linux by Kinvolk stable 4081.2.1 for Hetzner
Transpile a minimal ignition config, for this example:
variant: flatcarversion: 1.0.0storage:
files:
- path: /foo/barmode: 420contents:
inline: Hi
Create a Hetzner cloud VPS, choose the uploaded snapshot, select your pre-existing SSH key, add the transpiled ignition under "Cloud config", choose a hostname, create the server.
Once created and booted, ssh in. Note /etc/hostname exists and has the name of the VPS. Note that /foo/bar exists and has the contents "Hi".
Run sudo flatcar-reset -K '/etc/ssh/ssh_host_.*' '/var/log' && sudo reboot
After rebooted, ssh in. Note that the shell prompt says core@localhost and that /etc/hostname does not exist. Note that running hostname returns localhost. Note that /etc/hostname does not exist. Note that /foo/bar exists and has the contents "Hi".
Expected behavior
After flatcar-reset, the server should boot with the existing hostname configured.
Additional information
Looking through the logs during the reboot after flatcar-reset, it looks like Ignition is running successfully, and that /sysroot/etc/hostname is being written.
Dec 30 04:19:13 localhost systemd[1]: Starting initrd-setup-root.service - Root filesystem setup...
Dec 30 04:19:13 localhost coreos-metadata[800]: Dec 30 04:19:13.521 INFO Fetching http://169.254.169.254/hetzner/v1/metadata/hostname: Attempt #1
Dec 30 04:19:13 localhost coreos-metadata[800]: Dec 30 04:19:13.523 INFO Fetch successful
Dec 30 04:19:13 localhost coreos-metadata[800]: Dec 30 04:19:13.524 INFO wrote hostname my-new-server to /sysroot/etc/hostname
Dec 30 04:19:13 localhost systemd[1]: Finished flatcar-metadata-hostname.service - Flatcar Metadata Hostname Agent.
If I search through the logs I see Ignition running successfully 7 times after the flatcar-reset and reboot. Additionally, /run/metadata/flatcar has the correct COREOS_HETZNER_HOSTNAME var.
I have the full set of logs available if needed. From a quick (uneducated) glance I wasn't able to see a definitive difference between the initial boot and the reboot after flatcar-reset that would explain this.
Thanks!
The text was updated successfully, but these errors were encountered:
Description
After
flatcar-reset
and a reboot on a Hetzner VPS,/etc/hostname
does not exist and the machine's hostname will default tolocalhost
.Impact
You must manually ssh in to set the hostname, or remember to add
-K /etc/hostname
toflatcar-reset
.Environment and steps to reproduce
hcloud-upload-image
. In this case it isFlatcar Container Linux by Kinvolk stable 4081.2.1 for Hetzner
/etc/hostname
exists and has the name of the VPS. Note that/foo/bar
exists and has the contents "Hi".sudo flatcar-reset -K '/etc/ssh/ssh_host_.*' '/var/log' && sudo reboot
core@localhost
and that/etc/hostname
does not exist. Note that runninghostname
returnslocalhost
. Note that/etc/hostname
does not exist. Note that/foo/bar
exists and has the contents "Hi".Expected behavior
After
flatcar-reset
, the server should boot with the existing hostname configured.Additional information
Looking through the logs during the reboot after
flatcar-reset
, it looks like Ignition is running successfully, and that/sysroot/etc/hostname
is being written.If I search through the logs I see Ignition running successfully 7 times after the
flatcar-reset
andreboot
. Additionally,/run/metadata/flatcar
has the correctCOREOS_HETZNER_HOSTNAME
var.I have the full set of logs available if needed. From a quick (uneducated) glance I wasn't able to see a definitive difference between the initial boot and the reboot after
flatcar-reset
that would explain this.Thanks!
The text was updated successfully, but these errors were encountered: