Skip to content

Commit c333f91

Browse files
Ajaykumar Rajappahoeppnerj
authored andcommitted
ziomon/ziorep_config: Add fcp-lun to -M option output
Update the ‘ziorep_config’ utility to print FCP-LUN details when the ‘-M’ option is used. Now, ‘ziorep_config -M' option prints FCP LUN(fcp-lun) ID along with the existing FCP device bus-id and WWPN. This addition helps correlate the output with command 'multipathd -k', subcommand 'show topo' output, aiding in better visibility and mapping of FCP devices to their respective LUNs in multipath environments. $ ziorep_config -t -M adapter remote_port LUN scsi_dev multipath_device ======================================================================== 0.0.1967 0x500507630704572c 0x405240f500000000 /dev/sda /dev/mapper/mpatha 0.0.1967 0x500507630704572c 0x405340f500000000 /dev/sdb /dev/mapper/mpathb 0.0.1927 0x500507630700572c 0x405240f500000000 /dev/sdc /dev/mapper/mpatha 0.0.1967 0x500507630704572c 0x405440f500000000 /dev/sdd /dev/mapper/mpathc 0.0.1927 0x500507630700572c 0x405340f500000000 /dev/sde /dev/mapper/mpathb 0.0.1927 0x500507630700572c 0x405440f500000000 /dev/sdf /dev/mapper/mpathc 0.0.1967 0x500507630704572c 0x405540f500000000 /dev/sdg /dev/mapper/mpathd 0.0.1927 0x500507630700572c 0x405540f500000000 /dev/sdh /dev/mapper/mpathd The LUN IDs from the above output can be correlated with multipath's H-C-T-L(LUN ID in decimal) of each FCP devices as shown below, $ multipathd -k multipathd > show topo create: mpatha (36005076307ffd72c00000000000052f5) dm-0 IBM,2107900 size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw `-+- policy='service-time 0' prio=50 status=active |- 0:0:0:1089814610 sdc 8:32 active ready running `- 1:0:0:1089814610 sda 8:0 active ready running create: mpathb (36005076307ffd72c00000000000053f5) dm-1 IBM,2107900 size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw `-+- policy='service-time 0' prio=50 status=active |- 0:0:0:1089814611 sde 8:64 active ready running `- 1:0:0:1089814611 sdb 8:16 active ready running create: mpathc (36005076307ffd72c00000000000054f5) dm-4 IBM,2107900 size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw `-+- policy='service-time 0' prio=50 status=active |- 0:0:0:1089814612 sdf 8:80 active ready running `- 1:0:0:1089814612 sdd 8:48 active ready running create: mpathd (36005076307ffd72c00000000000055f5) dm-5 IBM,2107900 size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw `-+- policy='service-time 0' prio=50 status=active |- 0:0:0:1089814613 sdh 8:112 active ready running `- 1:0:0:1089814613 sdg 8:96 active ready running Signed-off-by: Ajaykumar Rajappa <ajaykr@linux.ibm.com> Reviewed-by: Chinmaya Kajagar <chinmayk@linux.ibm.com> Reviewed-by: Nihar Panda <niharp@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
1 parent 095e5ee commit c333f91

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ziomon/ziorep_config

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ sub mapper_report
303303
{
304304
my $adapters = shift;
305305
my $ports = shift;
306+
my $luns = shift;
306307
my $s_devs = shift;
307308
my $m_devs = shift;
308309
my @out_str;
@@ -312,18 +313,20 @@ sub mapper_report
312313
return;
313314
}
314315
if ($_[0]) {
315-
print "adapter remote_port scsi_dev multipath_device\n",
316-
"=====================================================\n";
316+
print "adapter remote_port LUN scsi_dev multipath_device\n",
317+
"========================================================================\n";
317318
}
318319
foreach my $hctl (sort keys %devices) {
319320
next if (!defined $devices{$hctl}{mp_dev});
320321
next if (@$adapters && "@$adapters" !~ /\b$devices{$hctl}{hba_id}\b/);
321322
next if (@$ports && "@$ports" !~ /\b$devices{$hctl}{wwpn}\b/);
323+
next if (@$luns && "@$luns" !~ /\b$devices{$hctl}{lun}\b/);
322324
next if (@$s_devs && "@$s_devs" !~ /\b$devices{$hctl}{dev}\b/);
323325
next if (@$m_devs && "@$m_devs" !~ /\b$mapper_dev{$devices{$hctl}{mp_dev_mm}}\b/);
324326
my @line_str;
325327
push @line_str, $devices{$hctl}{hba_id};
326328
push @line_str, $devices{$hctl}{wwpn};
329+
push @line_str, $devices{$hctl}{lun};
327330
push @line_str, "/dev/".$devices{$hctl}{dev};
328331
push @line_str, "/dev/mapper/".$mapper_dev{$devices{$hctl}{mp_dev_mm}};
329332
push @out_str, "@line_str\n";
@@ -510,6 +513,6 @@ if ($device_rep) {
510513
}
511514

512515
if ($map_rep) {
513-
mapper_report(\@adapter, \@port, \@s_dev, \@m_dev, $header);
516+
mapper_report(\@adapter, \@port, \@lun, \@s_dev, \@m_dev, $header);
514517
}
515518

0 commit comments

Comments
 (0)