From 8ee1cb74571b92dd3f9057e54bd09b424de9e0ef Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 21 Apr 2014 19:47:21 -0700 Subject: [PATCH] Modify the dhcp config file use ip address of MN rather than a static IP address --- xCAT-server/lib/xcat/plugins/petitboot.pm | 28 ++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index 32efe409d..073d36fbe 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -447,20 +447,22 @@ sub process_request { if ($do_dhcpsetup) { foreach my $node (@normalnodeset) { - - my $fpath = "http://9.3.190.175/tftpboot/petitboot/$node"; - if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command - $sub_req->({command=>['makedhcp'], - node=> [$node], - arg=>['-l','-s','conf-file = \"'.$fpath.'\";']},$callback); - } else { - $sub_req->({command=>['makedhcp'], - node=> [$node], - arg=>['-s','conf-file = \"'.$fpath.'\";']},$callback); - } + my $server = xCAT::TableUtils->GetMasterNodeName($node); + my $ipfn = xCAT::NetworkUtils->my_ip_facing($server); + if(($server != 1) and defined($ipfn)) { + my $fpath = "http://$ipfn/tftpboot/petitboot/$node"; + if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command + $sub_req->({command=>['makedhcp'], + node=> [$node], + arg=>['-l','-s','conf-file = \"'.$fpath.'\";']},$callback); + } else { + $sub_req->({command=>['makedhcp'], + node=> [$node], + arg=>['-s','conf-file = \"'.$fpath.'\";']},$callback); + } + } } - - } + } } #now run the end part of the prescripts