Add a function to return NAA
Adds a function to return NAA. This is required to match the WWID for multipath
This commit is contained in:
parent
cde040aeca
commit
cce719afb7
|
|
@ -52,6 +52,9 @@ sub run_lun_command {
|
||||||
if($method eq "list_view") {
|
if($method eq "list_view") {
|
||||||
return run_list_view($scfg, $timeout, $method, @params);
|
return run_list_view($scfg, $timeout, $method, @params);
|
||||||
}
|
}
|
||||||
|
if($method eq "list_extent") {
|
||||||
|
return run_list_extent($scfg, $timeout, $method, @params);
|
||||||
|
}
|
||||||
if($method eq "list_lu") {
|
if($method eq "list_lu") {
|
||||||
return run_list_lu($scfg, $timeout, $method, "name", @params);
|
return run_list_lu($scfg, $timeout, $method, "name", @params);
|
||||||
}
|
}
|
||||||
|
|
@ -109,6 +112,29 @@ sub run_list_lu {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
sub run_list_extent {
|
||||||
|
my ($scfg, $timeout, $method, @params) = @_;
|
||||||
|
my $object = $params[0];
|
||||||
|
my $result = undef;
|
||||||
|
|
||||||
|
my $luns = freenas_list_lu($scfg);
|
||||||
|
foreach my $lun (@$luns) {
|
||||||
|
if ($lun->{'iscsi_target_extent_path'} =~ /^$object$/) {
|
||||||
|
$result = $lun->{'iscsi_target_extent_naa'};
|
||||||
|
syslog("info","FreeNAS::list_extent($object): naa found $result");
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!defined($result)) {
|
||||||
|
syslog("info","FreeNAS::list_extent($object): naa not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue