mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	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:
		| @@ -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; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
| @@ -1092,6 +1092,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");   | ||||
|   | ||||
		Reference in New Issue
	
	Block a user