Comment 6 for bug 1409157

Revision history for this message
Hari Prasad Killi (haripk) wrote :

Hey Hari,

I think we are Ok with the workaround for now. Thank you very much for your assistances!

-Alfred

From: Hari Prasad Killi <email address hidden>
Date: Wednesday, January 28, 2015 11:00 AM
To: Alfred Shen <email address hidden>, Aniket Daptari <email address hidden>
Cc: Ashish Ranjan <email address hidden>
Subject: Re: Assign correct domain name to VMs

Hi Alfred,
This is the summary of today's investigation.

Name resolution from the VM was working with IPAM being associated with the DNS server. Association with default-network-ipam wasn't required.

'hostname' on the VM wasn't showing the hostname sent via DHCP. However, /etc/resolv.conf had proper domain name and DNS server address.

When we reset hostname to 'localhost.localdomain' and ran dhclient again, hostname was set to the name sent via DHCP. /sbin/dhclient-script is run when dhclient finishes and it updates resolv.conf, hostname etc. with the values received from DHCP

I experimented further with this script, attached are two snapshots from the execution log of this script, when hostname is updated and not updated. We see that only if the current hostname value is '(none)' or localhost or localhost.localdomain, the hostname is being updated. When the value is anything else, hostname is not updated. So, if the VM has default values to hostname, the script updates the hostname. We can either control the behavior updating the script (in function dhconfig, before make_resolv_conf is invoked, it runs hostname and that is getting translated to the actions seen in the attached screenshots) or see to it that the default values are set in the VM prior to DHCP.

Please let me know if any further investigation is required.

Regards,
Hari