templates: Set vSphere hostname from guestinfo before NM starts#2282
templates: Set vSphere hostname from guestinfo before NM starts#2282openshift-merge-robot merged 1 commit intoopenshift:masterfrom
Conversation
|
I wonder if we still need this given this was fixed for the reporter with a newer version of NM: okd-project/okd#394 -- but on second thought, as this seems like a fallback solution anyway and in order to make it work we actually do need it. I'll add the os-release check here :) |
|
vsphere team should sign off on this: /assign @jcpowermac @patrickdillon |
darkmuggle
left a comment
There was a problem hiding this comment.
/hold
"I wonder if we still need this given this was fixed for the reporter with a newer version of NM"
If the report says it was fixed in a newer version of NM, then I think we should not ship this.
The same objection over magic strings apply -- this may seem "safe" but I would much rather universally set the transient name from the meta-data and then use NM over any magic string checking.
The NM fix does not fix the issue I am seeing... That fix is for DHCP resolved hostnames. This is for vSphere resolved hostnames and fails when 'fedora' is the hostname. Checking for |
The better way is to:
Fedora or localhost are both magic strings, and the fine Systemd folks have informed us that we need to stop checking magic strings. I've ranted on this in other bugs, but the problem is that we keep working around distro bugs, instead of fixing it in a better place. Fedora/OKD is supposed to be the test bed for RHCOS/OCP, so lets do it in a better place. See #2217 |
|
so rather than have the test have only or maybe without which always forces it to the vm_name |
|
I noticed the guestinfo.hostname attribute is created by the openshift installer when it creates the vm ( or by the openshift api when it creates worker nodes) so there is a good chance that non IPI hosts will not have this entry... |
UPI installs are expected to have hostname pre-set via kernel args / NM config / DHCP / PTR records / guestinfo.hostname. IPI is relying on guestinfo, so it should be sufficient. |
|
I would use If you use Also [1] will need to be updated so that the unit starts before [1] https://github.com/openshift/machine-config-operator/blob/f949f7efb3b550b5762b513bf5e77bcbff1bc8d6/templates/common/vsphere/units/vsphere-hostname.service.yaml#L7 |
So really we could/should do something like: just in case guestinfo.hostname doesn't exist |
|
@darkmuggle please take another look |
|
/test e2e-vsphere |
This change makes it so the hostname is set to vSphere's guestinfo.hostname if that's defined, before NetworkManager is started.
|
/test e2e-vsphere |
|
@LorbusChris et al, as a reminder the MCO doesn't own this template, so you will need to make sure a vsphere team member takes a look and LGTMs this. I've pinged in their slack channel but might require further followup.. |
|
LGTM, will let @patrickdillon review as well. /test e2e-vsphere-upi Can/should this be change to use afterburn instead? This was a last minute addition to get vSphere IPI working. I think the original intention was to eventually move to afterburn if it would work for this purpose. |
I think we can experiment with afterburn in okd-machine-os repo (and later propagate that to MCO) |
|
I ran/tested the script on my hostname broken cluster and it works fine. Cluster generated with proper hostnames after reboot. hostnamectl shows the following: No static hostname is defined which is expected (I think) |
|
UPI installed correctly. Docker rate limiting caused the test failures. |
LGTM as well |
|
/unhold The clean-up looks good from the RHCOS perspective. |
|
/test e2e-aws-workers-rhel7 |
|
Ok given the consensus here I'll just do the final lgtm so this will make it in /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, kikisdeliveryservice, LorbusChris The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/cherrypick release-4.6 |
|
@vrutkovs: new pull request created: #2289 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
In Fedora 33, a change was introduced to set the hostname to "fedora" as a fallback instead of the default "localhost", so the current script does not work in OKD as NM will assign the fallback hostname.
This change makes it so the hostname is set to vSphere's
guestinfo.hostname if that's defined, before NetworkManager is started.