From 21c56912937d01b51271651bba0cd8d6fe1144c2 Mon Sep 17 00:00:00 2001 From: nott Date: Fri, 2 Nov 2012 14:13:05 +0000 Subject: [PATCH] changes for multi-domain support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14231 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ontap.pm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ontap.pm b/xCAT-server/lib/xcat/plugins/ontap.pm index abe1eb3d4..9e205103a 100644 --- a/xCAT-server/lib/xcat/plugins/ontap.pm +++ b/xCAT-server/lib/xcat/plugins/ontap.pm @@ -25,6 +25,7 @@ use xCAT::SvrUtils; my $output_handler; my $newiqns; my $domain; +my %nodedomains; my $iscsitab; my $nodetypeinfo; @@ -57,17 +58,10 @@ sub process_request { return; } my @nodes = @{$request->{node}}; - #my $sitetab = xCAT::Table->new('site'); - #(my $dent) = $sitetab->getAttribs({key=>'domain'},'value'); - my @entries = xCAT::TableUtils->get_site_attribute("domain"); - my $t_entry = $entries[0]; - if ( defined($t_entry) ) { - $domain = $t_entry; - $domain = join(".",reverse(split(/\./,$domain))); - } else { - xCAT::SvrUtils::sendmsg([1,"Cannot determine domain name for iqn generation from site table"], $output_handler); - return; - } + + my $nd = xCAT::NetworkUtils->getNodeDomains(\@nodes); + %nodedomains = %{$nd}; + my $nodetype =xCAT::Table->new('nodetype',-create=>0); unless ($nodetype) { xCAT::SvrUtils::sendmsg([1,"ONTAP plugin requires nodetype table to be populated"], $output_handler); @@ -115,6 +109,15 @@ sub build_lunmap { foreach $node (@nodes) { $tgr = undef; $iqn = $iscsicfg{$controller}->{$node}->{iname}; + + $domain = $nodedomains{$node}; + if ( $domain ) { + $domain = join(".",reverse(split(/\./,$domain))); + } else { + xCAT::SvrUtils::sendmsg([1,"Cannot determine domain name for iqn generation"], $output_handler); + next; # ???? + } + unless ($iqn) { #We must control client iqn, ONTAP acls require it $newiqns->{$node} = sprintf("iqn.%d-%02d.%s:%s-initiator",$year,$month,$domain,$node); $iqn = $newiqns->{$node};