Commit b6956f3d authored by Kirk Webb's avatar Kirk Webb

Make disabling of dhcp for external managment look like elab-in-elab case.

Leaving the node entries in the dhcpd.conf file, but setting them to
be ignored is better.  Cuts out "no free leases" log messages and is
less confusing for people looking through the config file.

Sprinkle a few comments around in dhcpd_makeconf
parent ca561d42
......@@ -281,6 +281,8 @@ while (<IF>) {
my $dns = "";
my $booting = "";
my $filename = "";
my $tag;
my $experiment;
if ($vnames && defined($row{"vname"})) {
$node_id = $row{"vname"};
......@@ -289,6 +291,12 @@ while (<IF>) {
$node_id = $row{"node_id"};
}
if (defined($row{"pid"})) {
$tag = $row{"pid"} . ":" . $row{"eid"};
$experiment = Experiment->Lookup($row{"pid"},
$row{"eid"});
}
# Management ports, nothing special to do.
if ($role eq TBDB_IFACEROLE_MANAGEMENT()) {
my $network = inet_ntoa(inet_aton($ip) &
......@@ -308,30 +316,30 @@ while (<IF>) {
goto spit;
}
my $tag;
if (defined($row{"pid"})) {
$tag = $row{"pid"} . ":" . $row{"eid"};
#
# Escape hatch for nodes reserved to experiments
# which are marked for external node management.
# Some other entity will be responsible for
# bootstrapping them in this case, so leave them
# out of the DHCP config file. This feature can
# be set on any or all of: swapper, project,
# experiment. Only do this when the experiment is
# swapping in.
#
my $experiment = Experiment->Lookup($row{"pid"},
$row{"eid"});
next
if (defined($experiment)
&& $experiment->state() eq EXPTSTATE_ACTIVATING()
&& EmulabFeatures->FeatureEnabled(
"ExternalNodeManagement", undef, undef,
$experiment));
#
# Neuter dhcp nodes reserved to experiments
# which are marked for external node management.
# Some other entity will be responsible for
# bootstrapping them in this case, so leave them
# out of the DHCP config file. This feature can
# be set on any or all of: swapper, project,
# experiment. Only do this when the experiment is
# swapping in.
#
if (defined($experiment) &&
$experiment->state() eq EXPTSTATE_ACTIVATING() &&
EmulabFeatures->FeatureEnabled(
"ExternalNodeManagement", undef, undef,
$experiment)) {
$hostname = "${spaces}\toption host-name ".
"\"$node_id\";\n";
$booting = "${spaces}\tignore booting;\n";
goto spit;
}
#
# Do different stuff for elabinelab / plab nodes.
#
if (defined($tag) && defined($servernodes{$tag}) &&
(($row{"inner_elab_boot"} == 1 &&
defined($row{"inner_elab_role"}) &&
......@@ -363,6 +371,9 @@ while (<IF>) {
}
}
}
#
# Defer to subbosses for dhcp and/or tftp if delegated.
#
elsif (defined $dhcp_subbosses{$node_id}) {
$hostname =
"${spaces}\toption host-name \"$node_id\";\n";
......@@ -372,6 +383,9 @@ while (<IF>) {
$tftp_subbosses{$node_id} . ";\n";
}
}
#
# The default case: just a plain old TB node.
#
else {
$hostname =
"${spaces}\toption host-name \"$node_id\";\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment