Bug 5740 - DCHPD server requires option "host-name"
: DCHPD server requires option "host-name"
Status: RESOLVED FIXED
: Nimbus
Workspace service
: TP1.3.0
: PC Linux
: P3 enhancement
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-12-19 18:38 by
Modified: 2008-02-13 12:03 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-12-19 18:38:00
xen hypervisor/DHCPD server is Ubuntu feisty fawn 7.04 

Probably specific to Ubuntu because Tim hasn't run into this before.

The "host-name" option to the dhcpd.conf file is required, but not present in
the static entries being made, in order to set the client hostname.  Thus when
you create a VM through the workspace service, and you specify hostnames for
association entries on the WS layer 

    eg. /usr/local/globus/etc/workspace_service/associations/sicily

The hostname is not set on the VM when it boots.

root@greece:~# uname -a
Linux greece 2.6.19-4-server #2 SMP Thu Apr 5 06:07:34 UTC 2007 i686 GNU/Linux



% man dhcpd-options

       option host-name string;

          This option specifies the name of the client.  The name may or may
not be qualified with the local domain name (it is preferable to use the
domain-name option to specify the domain name).   See
          RFC 1035 for character set restrictions.  This option is only honored
by dhclient-script(8) if the hostname for the client machine is not set.


First test, after I've created the VM, I grab the console to show that hostname
is none.  Then I add "host-name" to the "dhcpd.conf" file entry, and rerun
dhclient and presto I have "mtetna" as my hostname.

root@:~# hostname

root@:~# dhclient       
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/aa:01:29:3d:e8:ff
Sending on   LPF/eth0/aa:01:29:3d:e8:ff
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 192.168.15.20
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.15.20
bound to 192.168.15.173 -- renewal in 55 seconds.
root@:~# hostname
mtetna
root@:~# 


Second I add the patch below, and presto the VM has the correct hostname.

root@greece:/opt/workspace-TP1.3.0/bin# !diff
diff dhcp-conf-alter.py /tmp/dhcp-conf-alter.py 
340,341d339
<         entrystr += '  option host-name "%s";\n' % entry.hostname
< 



Here is what the output looks like on the hypervisor:

root@greece:~# tail /etc/dhcpd.conf
host mtetna {
  # Added by dhcp-conf-alter @ Wed Dec 19 16:27:18 2007
  hardware ethernet AA:01:72:D8:D2:39;
  fixed-address 192.168.15.173;
  option subnet-mask 255.255.255.0;
  option routers 192.168.15.1;
  option broadcast-address 192.168.15.255;
  option host-name "mtetna";
}

NOTE: If hostname is already set, it WILL NOT be reset using dhclient during
boot.
------- Comment #1 From 2007-12-19 19:38:15 -------
Thanks, will add that patch after some testing.  It's either your server or
client that is not responding to only the "host XYZ" construct in the
dhcpd.conf file.

The man pages I'm looking at only talk of overriding "host XYZ" with "host-name
XYZ" which implies it's not necessary.  But it also implies it won't hurt if
this is necessary for some server or client versions.

I see from your report the client in the VM is ISC v3.0.4 -- what is the server
package (is it ISC?) and version?
------- Comment #2 From 2007-12-20 12:11:59 -------
root@greece:/opt/p5/images# dhcpd --help
Internet Software Consortium DHCP Server
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

Usage: dhcpd [-p <UDP port #>] [-d] [-f] [-cf config-file]
            [-lf lease-file] [-pf pidfile] [if0 [...ifN]]
exiting.


AUTHOR
       dhcpd(8)  was  written by Ted Lemon <mellon@vix.com> under a contract
with Vixie Labs.   Funding for this project was provided by the Internet
Software Corporation.  Information about the Internet
       Software Consortium can be found at http://www.isc.org/isc.



root@greece:/opt/p5/images# apt-cache show dhcp
Package: dhcp
Priority: optional
Section: universe/net
Installed-Size: 308
Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
Original-Maintainer: Eloy A. Paris <peloy@debian.org>
Architecture: i386
Version: 2.0pl5-19.5ubuntu2
Replaces: dhcpd, dhcp-beta
Provides: dhcpd, dhcp
Depends: libc6 (>= 2.5-0ubuntu1), update-inetd
Conflicts: dhcpd, dhcp-beta, dhcp-relay, dhcp-relay-beta
Filename: pool/universe/d/dhcp/dhcp_2.0pl5-19.5ubuntu2_i386.deb
Size: 111658
MD5sum: 9f4c8e8d56a7d2eb9db4f5614b6da205
SHA1: a18a8660b94d243c4066bd85e3b581e973871d16
SHA256: a629d511d0c2775ad9f490e3f2f88af5f4c1d0dc842ba6d35253654a4abc135a
Description: DHCP server for automatic IP address assignment
 DHCP is a protocol like BOOTP (actually dhcpd includes much of
 the functionality of BOOTPD!). It assigns IP addresses to clients
 based on lease times. DHCP is used extensively by Microsoft and more
 recently also by Apple. It is probably essential in any multi-platform
 environment.
 .
 Multiple Ethernet Interfaces are supported by this DHCP package.
 .
 Note: This package _requires_ a 2.2.x or later Linux kernel. 2.0.x
 kernels are _not_ supported.
 .
 This is the DHCP server from version 2 of the Internet Software
 Consortium DHCP package. For more information visit the ISC web site
 at http://www.isc.org.
Bugs: mailto:ubuntu-users@lists.ubuntu.com
Origin: Ubuntu
------- Comment #3 From 2007-12-20 12:20:01 -------
Thanks, good to know this older v2 works otherwise.
------- Comment #4 From 2008-02-13 11:59:07 -------
enhancement (to support older DHCP servers) committed to cvs for TP1.3.1
release
------- Comment #5 From 2008-02-13 12:03:14 -------
Also, in TP1.3.1, the service will not allow association entries without
hostnames