Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure: doesn't set hostname #197

Closed
serbrech opened this issue Apr 4, 2019 · 4 comments · Fixed by #199
Closed

Azure: doesn't set hostname #197

serbrech opened this issue Apr 4, 2019 · 4 comments · Fixed by #199

Comments

@serbrech
Copy link

serbrech commented Apr 4, 2019

Bug

Afterburn does not set the hostname on Azure.

Operating System Version

RHCOS

Afterburn Version

master

Environment

Azure

Expected Behavior

/etc/hostname contains the machine name defined on Azure

Actual Behavior

no file

Other Information

curl http://169.254.169.254/metadata/instance/compute/name?api-version=2017-08-01&format=text gives you the hostname

file location should be /etc/hostname

Currently Azure provider returns None:

fn hostname(&self) -> Result<Option<String>> {
Ok(None)
}

@serbrech
Copy link
Author

serbrech commented Apr 4, 2019

@jpang @imcleod @awesomenix

@lucab
Copy link
Contributor

lucab commented Apr 4, 2019

I seem to remember the Azure DHCP is able to hand out the hostname to a node via DHCP (Option-12, possibly), which would be the reason why Afterburn doesn't have to take care of that.

Is either the DCHP client not asking/handling that option, or the server not providing it?

@bgilbert
Copy link
Contributor

bgilbert commented Apr 4, 2019

I tried it, and Azure DHCP apparently is not sending the hostname when requested to. On Container Linux I think WALinuxAgent is setting the hostname. So implementing in Afterburn and running that in the initramfs seems like the right approach.

@bgilbert bgilbert added this to Proposed in Fedora CoreOS papercuts via automation Apr 4, 2019
@lucab
Copy link
Contributor

lucab commented Apr 5, 2019

Then I was mixing up with some other cloud provider, and we have indeed to add such logic to Afterburn.

While I didn't see a JSON schema for the metadata response, there are comprehensive examples and docs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service#getting-more-information-about-the-vm-during-support-case. As we don't care about other properties in there for the moment, the individual textual-format field is probably a better target to consume.

For completeness, this seems to cover host name only (not node FQDN).

serbrech added a commit to serbrech/installer that referenced this issue Apr 9, 2019
Afterburn does not set the azure hostname which is needed
for kubernetes to register the hosts with their actual names
and not localhost.localdomain

related: coreos/afterburn#197

see coreos/afterburn#197
serbrech added a commit to serbrech/installer that referenced this issue Apr 9, 2019
Afterburn does not set the azure hostname which is needed
for kubernetes to register the hosts with their actual names
and not localhost.localdomain

related: coreos/afterburn#197
Fedora CoreOS papercuts automation moved this from Proposed to Done Apr 12, 2019
@bgilbert bgilbert moved this from Done to Selected in Fedora CoreOS papercuts Apr 23, 2019
@lucab lucab moved this from Selected to Done in Fedora CoreOS papercuts Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants