Set hostname for EC2 and OpenStack from metadata#21
Merged
pothos merged 1 commit intoflatcar-masterfrom Feb 18, 2021
Merged
Conversation
pothos
added a commit
to flatcar-archive/coreos-overlay
that referenced
this pull request
Feb 17, 2021
47c5400 to
f015048
Compare
Similar to what is done for DigitalOcean and Packet, we can set the hostname for EC2 and OpenStack through afterburn. For OpenStack the name in afterburn does not match the oem_id set on the kernel commandline from GRUB, and a special service is added which sets the provider directly.
f015048 to
3320e70
Compare
krnowak
approved these changes
Feb 18, 2021
margamanterola
approved these changes
Feb 18, 2021
Contributor
margamanterola
left a comment
There was a problem hiding this comment.
LGTM, thanks. This should also fix the hostnames of AWS ARM instances which are currently not getting set, due to the polkit issue.
pothos
added a commit
to flatcar-archive/coreos-overlay
that referenced
this pull request
Feb 18, 2021
margamanterola
pushed a commit
to kinvolk/lokomotive
that referenced
this pull request
Feb 25, 2021
This change adds systemd units that set the hostname from the metadata service to both the controllers and the workers in AWS. These units won't be needed after the next Flatcar release, which will include flatcar/bootengine#21, which does a similar thing. This change can be reverted after that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similar to what is done for DigitalOcean and Packet, we can set the
hostname for EC2 and OpenStack through afterburn.
For OpenStack the name in afterburn does not match the oem_id set on
the kernel commandline from GRUB, and a special service is added
which sets the provider directly.
How to use
Run kola tests and grep for
hostnamein the console/journal output.AWS:
Compared to the current state the end result is the same because
systemd-hostnamedsets the final hostname.However, before that happens the hostname is currently not set while with the change here the hostname is already set as soon as the system starts.
OpenStack:
not tested
Testing done
AWS here