-
Notifications
You must be signed in to change notification settings - Fork 56
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
Report hostname using dhcp provider hostname for a domain #125
Conversation
In case of libvirt dom.GetHostname(0) will not provide the hostname info since it need qemu-guest-agent installed on the VM to fetch this info https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname Since for libvirt case we are providing the hostname using libvirt provided dhcp and assign same to domain name We can reuse it here also instead adding another package to RHCOS image.
Hi @praveenkumar. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -465,7 +465,11 @@ func NodeAddresses(dom *libvirt.Domain) ([]corev1.NodeAddress, error) { | |||
} | |||
} | |||
|
|||
hostname, err := dom.GetHostname(0) | |||
// In case of libvirt dom.GetHostname(0) will not provide the hostname info since it need qemu-guest-agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: libvirt
mention is redundant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based on the context, i mean.
I tested this via the image you provided ( |
IMHO the right solution is to use information from DHCP leases that libvirt provides via |
I agree. Does #128 alone solve the immediate problem? If so, I'd vote for that. |
@bison @cynepco3hahue So I don't understand why we need to get the hostname from the dhcp lease since we know them already before creating those VM on libvirt? Do you folks thinks that there might be a situation where name which provided by the dhcp and part of the domain can be differ from what we get from the dhcp lease? |
Because it's more future-proof as we don't assume a direct relationship between hostname and name of the VM. |
closing this in favour of #128 |
In case of libvirt dom.GetHostname(0) will not provide the hostname info since it need qemu-guest-agent installed on the VM to fetch this info https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname Since for libvirt case we are providing the hostname using libvirt provided dhcp and assign same to domain name. We can reuse it here also instead adding another package to RHCOS image.
cc @abhinavdahiya @zeenix