code change to support lsslp and rscan for IVM. fix the issue that IVM lpar boots to openfirmware after os deployment by adding a command [chsyscfg boot_mode=norm] after rnetboot to make the bootmode to normal instead of of

This commit is contained in:
daniceexi 2014-07-23 10:18:11 -04:00
parent 67ee622cdd
commit 82adc2746b
3 changed files with 49 additions and 4 deletions

View File

@ -350,6 +350,27 @@ sub do_rnetboot {
last;
}
}
# Set the boot mode to norm from 'of' (open firmware)
# NOW, only necessary for IVM
my $hwtype = @$exp[2];
if ($hwtype eq "ivm") {
my $server = @$exp[3];
# creat connection first
my @newexp = xCAT::PPCcli::connect( $request, $hwtype, $server );
if (ref($newexp[0]) eq "Expect" ) {
my $cfg = "lpar_id=@$d[0],boot_mode=norm";
# change the boot mode to 'norm'
xCAT::PPCcli::chsyscfg(\@newexp, "prof", $d, $cfg);
xCAT::PPCcli::disconnect(\@newexp);
} else {
my $rsp;
$rsp->{data} = ["Failed to set the boot mode to normal. For rnetboot command, you have to rpower off and then on the node after finishing the OS deployment."];
xCAT::MsgUtils->message("E", $rsp, $request->{callback});
}
}
return $result;
}

View File

@ -287,7 +287,7 @@ sub dodiscover {
if ($rethash{$peername}) {
next; #got a dupe, discard
}
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'});
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'}, peername=>$peername, callback=>$args{reqcallback});
if ($result) {
if ($peername =~ /\./) { #ipv4
$peername =~ s/::ffff://;
@ -371,9 +371,10 @@ sub process_slp_packet {
if ($parsedpacket->{FunctionId} == 2) {#Service Reply
parse_service_reply($parsedpacket->{payload},$parsedpacket);
unless (ref $parsedpacket->{service_urls} and scalar @{$parsedpacket->{service_urls}}) { return undef; }
if ($parsedpacket->{attributes}) { #service reply had ext
return $parsedpacket; #don't bother sending attrrequest, already got it in first packet
if ($parsedpacket->{attributes} && get_mac_for_addr($args{peername})) {
#service reply had ext. Stop here if has gotten attributes and got mac.
#continue the unicast request for service attributes if cannot find mac for peernode
return $parsedpacket; #don't bother sending attrrequest, already got it in first packet
}
my $srvtype = $xid_to_srvtype_map{$parsedpacket->{Xid}};
my $packet = generate_attribute_request(%args,SrvType=>$srvtype);

View File

@ -1090,6 +1090,29 @@ sub parse_responses {
trace( $request, "Discover node $atthash{hostname}: type is $atthash{type},\
mtm is $atthash{mtm},sn is $atthash{serial}, ip is $atthash{ip},\
mac is $atthash{mac}, otherinterfaces is $atthash{otherinterfaces}" );
} elsif ($type eq SERVICE_IVM) {
$atthash{type} = $service_slp{$type};
$atthash{mtm} = ${$attributes->{'machinetype-model'}}[0];
$atthash{serial} = ${$attributes->{'serial-number'}}[0];
$atthash{id} = ${$attributes->{'lparid'}}[0];
$atthash{ip} = ${$attributes->{'ip-address'}}[0];
$atthash{hostname} = get_host_from_url($request, $attributes);
my @ips = @{$attributes->{'ip-address'}};
foreach my $tmpip (@ips) {
if (exists($::OLD_DATA_CACHE{"ivm*".$atthash{mtm}."*".$atthash{serial}})){
$atthash{hostname} = $::OLD_DATA_CACHE{"ivm*".$atthash{mtm}."*".$atthash{serial}};
push @matchnode, 'Server-'.$atthash{mtm}.'-SN'.$atthash{serial};
$atthash{ip} = $tmpip;
}
}
$atthash{mac} = $rsp;
$atthash{url} = ${$searchmacs{$rsp}}{payload};
$atthash{otherinterfaces} = ${$attributes->{'ip-address'}}[0];
$outhash{'Server-'.$atthash{mtm}.'-SN'.$atthash{serial}} = \%atthash;
$$length = length( $atthash{ip}) if ( length( $atthash{ip} ) > $$length );
trace( $request, "Discover node $atthash{hostname}: type is $atthash{type},\
mtm is $atthash{mtm},sn is $atthash{serial}, ip is $atthash{ip},\
mac is $atthash{mac}, otherinterfaces is $atthash{otherinterfaces}" );
}elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|1457|7954/ )) {
# Skip this entry if "-s CEC" was specified - we do not list FSP entries for Flex when only CECs were requested
next unless ($option_s ne "CEC");