|
# nodels -v I don't see any file attached, so I pulled from svn trunk, this is the diff (also attached): # diff -w /opt/xcat/lib/perl/xCAT_plugin/dhcp.pm
trunk/xCAT-server/lib/xcat/plugins/dhcp.pm I'll send the connection info to your email Thanks On 28/12//2011 16:03, [email protected] wrote:
|
46a47
> my $nodetypeents;
52a54
> my $distro = xCAT::Utils->osver();
61a64,93
> # is this ubuntu ?
> if ( $distro =~ /ubuntu.*/ ){
> $dhcpconffile = '/etc/dhcp3/dhcpd.conf';
> }
>
> sub check_uefi_support {
> my $ntent = shift;
> my %blacklist = (
> "win2k3.*" => 1,
> "winxp.*" => 1,
> "SL5.*" => 1,
> "rhels5.*" => 1,
> "centos5.*" => 1,
> "sl5.*" => 1,
> "sles10.*" => 1,
> "esxi4.*" => 1);
> if ($ntent and $ntent->{os}) {
> foreach (keys %blacklist) {
> if ($ntent->{os} =~ /$_/) {
> return 0;
> }
> }
> }
> if ($ntent->{os} =~ /win/) { #UEFI support is a tad different, need to
> punt..
> return 2;
> }
> return 1;
> }
>
>
233a266
> my $ntent;
240a274,276
> if ($nodetypeents and $nodetypeents->{$node}) {
> $ntent = $nodetypeents->{$node}->[0];
> }
357a394
> my $douefi=check_uefi_support($ntent);
361c398,404
< $lstatements = 'if exists gpxe.bus-id { filename = \"\";
} else if exists client-architecture { filename = \"xcat/xnba.kpxe\"; }
'.$lstatements;
---
> $lstatements = 'if option client-architecture = 00:00 and
> not exists gpxe.bus-id { filename = \"xcat/xnba.kpxe\"; } else { filename =
> \"\"; } '.$lstatements;
> } else {
> #TODO: if windows uefi, do vendor-class-identifier of
> "PXEClient" to bump it over to proxydhcp.c
> if (($douefi == 2 and $chainent->{currstate} =~ /^install/)
> or $chainent->{currstate} =~ /^winshell/) { #proxy dhcp required in uefi
> invocation
> $lstatements = 'if option user-class-identifier =
> \"xNBA\" and option client-architecture = 00:00 { always-broadcast on;
> filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else
> if option client-architecture = 00:07 or option client-architecture = 00:09 {
> filename = \"\"; option vendor-class-identifier \"PXEClient\"; } else if
> option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else {
> filename = \"\"; }'.$lstatements; #Only PXE compliant clients should ever
> receive xNBA
> } elsif ($douefi and $chainent->{currstate} ne "boot" and
> $chainent->{currstate} ne "iscsiboot") {
> $lstatements = 'if option user-class-identifier =
> \"xNBA\" and option client-architecture = 00:00 { always-broadcast on;
> filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else
> if option user-class-identifier = \"xNBA\" and option client-architecture =
> 00:09 { filename =
> \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'.uefi\"; } else if
> option client-architecture = 00:07 { filename = \"xcat/xnba.efi\"; } else if
> option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else {
> filename = \"\"; }'.$lstatements; #Only PXE compliant clients should ever
> receive xNBA
363c406,407
< $lstatements = 'if option user-class-identifier =
\"xNBA\" { filename =
\"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else if exists
client-architecture { filename = \"xcat/xnba.kpxe\"; } '.$lstatements; #Only
PXE compliant clients should ever receive xNBA
---
> $lstatements = 'if option user-class-identifier =
> \"xNBA\" and option client-architecture = 00:00 { filename =
> \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else if option
> client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else {
> filename = \"\"; }'.$lstatements; #Only PXE compliant clients should ever
> receive xNBA
> }
696c740
< if ($mytype =~ /osi/) {
---
> if ($mytype->{nodetype} =~ /osi/) {
699c743
< unless ($mytype =~ /osi/) {
---
> unless ($mytype->{nodetype} =~ /osi/) {
745c789,790
< } else { #send the request to every dhservers
---
> } elsif (@nodes > 0 or grep /-n/,@{$req->{arg}}) { #send the request to
> every dhservers
> $req->{'node'}=\@nodes;
1017c1062
< #add the active nics to /etc/sysconfig/dhcpd
---
> #add the active nics to /etc/sysconfig/dhcpd or
> /etc/default/dhcp3-server(ubuntu)
1019c1064,1065
< foreach $dhcpver ("dhcpd","dhcpd6") {
---
> my %missingfiles = ( "dhcpd"=>1, "dhcpd6"=>1, "dhcp3-server"=>1 );
> foreach $dhcpver ("dhcpd","dhcpd6","dhcp3-server") {
1020a1067,1072
> if ($dhcpver eq "dhcpd") {
> delete($missingfiles{dhcpd});
> delete($missingfiles{"dhcp3-server"});
> } else {
> delete($missingfiles{$dhcpver});
> }
1055,1057c1107,1119
< } elsif ($_ eq "dhcpd" or $usingipv6) {
< $callback->({error=>"The file /etc/sysconfig/$_ doesn't exist,
check the dhcp server"});
< # return;
---
> }elsif (-e "/etc/default/$dhcpver") { #ubuntu
> delete($missingfiles{dhcpd});
> delete($missingfiles{"dhcp3-server"});
> open DHCPD_FD, "/etc/default/$dhcpver";
> my $syscfg_dhcpd = "";
> my $found = 0;
> my $dhcpd_key = "INTERFACES";
> my $os = xCAT::Utils->osver();
>
> my $ifarg = "$dhcpd_key=\"";
> foreach (keys %activenics) {
> if (/!remote!/) { next; }
> $ifarg .= " $_";
1058a1121,1141
> $ifarg =~ s/^ //;
> $ifarg .= "\"\n";
>
> while (<DHCPD_FD>) {
> if ($_ =~ m/^$dhcpd_key/) {
> $found = 1;
> $syscfg_dhcpd .= $ifarg;
> }else {
> $syscfg_dhcpd .= $_;
> }
> }
>
> if ( $found eq 0 ) {
> $syscfg_dhcpd .= $ifarg;
> }
> close DHCPD_FD;
>
> open DBG_FD, '>', "/etc/default/$dhcpver";
> print DBG_FD $syscfg_dhcpd;
> close DBG_FD;
>
1060a1144,1151
> if ($usingipv6 and $missingfiles{dhcpd6}) {
> $callback->({error=>"The file /etc/sysconfig/dhcpd6 doesn't
> exist, check the dhcp server"});
> }
> if ($missingfiles{dhcpd}) {
> $callback->({error=>"The file /etc/sysconfig/dhcpd doesn't exist,
> check the dhcp server"});
> }
>
> }
1153c1244
< unless ($ntype =~ /osi/) {
---
> unless ($ntype->{nodetype} =~
> /osi/) {
1245c1336,1341
< my $iscsitab = xCAT::Table->new('iscsi');
---
> my $nodetypetab;
> $nodetypetab = xCAT::Table->new('nodetype',-create=>0);
> if ($nodetypetab) {
> $nodetypeents =
> $nodetypetab->getNodesAttribs($req->{node},[qw(os)]);
> }
> my $iscsitab = xCAT::Table->new('iscsi',-create=>0);
1297,1298c1393
< error => ["Unable to find mac address for
$node"],
< errorcode => [1]
---
> warning => ["Unable to find mac address for
> $node"]
1310a1406,1411
> elsif ( $distro =~ /ubuntu.*/)
> {
> #ubuntu config
> system("chmod a+r /etc/dhcp3/dhcpd.conf");
> system("/etc/init.d/dhcp3-server restart");
> }
1767c1868
< push @netent, " if option user-class-identifier = \"xNBA\" { #x86,
xCAT Network Boot Agent\n";
---
> push @netent, " if option user-class-identifier = \"xNBA\" and
> option client-architecture = 00:00 { #x86, xCAT Network Boot Agent\n";
1768a1870,1871
> push @netent, " } else if option user-class-identifier = \"xNBA\"
> and option client-architecture = 00:09 { #x86, xCAT Network Boot Agent\n";
> push @netent, " filename =
> \"http://$tftp/tftpboot/xcat/xnba/nets/".$net."_".$maskbits.".uefi\";\n";
1773a1877,1882
> " } else if option client-architecture = 00:07 { #x86_64 uefi\n
> ";
> push @netent, " filename \"xcat/xnba.efi\";\n";
> push @netent,
> " } else if option client-architecture = 00:09 { #x86_64 uefi
> alternative id\n ";
> push @netent, " filename \"xcat/xnba.efi\";\n";
> push @netent,
1949a2059,2060
> @dhcpconf=(); #dispose of the file contents in memory, no longer needed
> @aixcfg=();
1965a2077
> @dhcp6conf=();
2021a2134,2135
> push @dhcpconf, "option tcode code 101 = text;\n";
>
2027a2142,2144
> if ($::XCATSITEVALS{timezone}) {
> push @dhcpconf, "option tcode \"".$::XCATSITEVALS{timezone}."\";\n";
> }
------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________ xCAT-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xcat-user
