Skip to content

Comments

Set hostname for EC2 and OpenStack from metadata#21

Merged
pothos merged 1 commit intoflatcar-masterfrom
kai/aws-hostname
Feb 18, 2021
Merged

Set hostname for EC2 and OpenStack from metadata#21
pothos merged 1 commit intoflatcar-masterfrom
kai/aws-hostname

Conversation

@pothos
Copy link
Member

@pothos pothos commented Feb 17, 2021

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 hostname in the console/journal output.

AWS:
Compared to the current state the end result is the same because systemd-hostnamed sets 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

pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Feb 17, 2021
@pothos pothos marked this pull request as ready for review February 18, 2021 09:00
@pothos pothos requested a review from a team February 18, 2021 09:00
@pothos pothos marked this pull request as draft February 18, 2021 09:03
@pothos pothos removed the request for review from a team February 18, 2021 09:03
@pothos pothos changed the title Set hostname for EC2 from metadata Set hostname for EC2 and OpenStack from metadata Feb 18, 2021
@pothos pothos requested a review from a team February 18, 2021 09:07
@pothos pothos marked this pull request as ready for review February 18, 2021 09:07
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.
Copy link
Contributor

@margamanterola margamanterola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. This should also fix the hostnames of AWS ARM instances which are currently not getting set, due to the polkit issue.

@pothos pothos merged commit 39ec708 into flatcar-master Feb 18, 2021
@pothos pothos deleted the kai/aws-hostname branch February 18, 2021 14:24
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants