You should open a case, since that 322 vs. 32A looks like a bug.
Original Message:
Sent: Wed January 29, 2025 08:53 AM
From: Martin Pavliska
Subject: Why lsmap forces different columns order than I want
Hi Russell,
thanks for reply.
Yes that I found later also - I checked / working with that -npiv flag, so therefore it was hide for me fist. I also checked documentation for Power8,9,10 and only the P7 has this longer note - for the others it is little bit shorter :D
" Note: The order that you specify the attributes is not assured to be the same order as they are returned."
So I suppose it is really historical setup and change in this can cause a lot of troubles after all these years. But Good to know.
I found another strange thing in that lsmap output and it is related to Flags there.
When I use "standard" output - there is 32A but when it is via -field list, there is 322
# lsmap -vadapter vfchost10 -npiv
Name Physloc ClntID ClntName ClntOS
------------- ---------------------------------- ------ -------------- -------
vfchost10 U8286.42A.21B85FV-V1-C19 4 z-aix73t AIX
Status:LOGGED_IN
FC name:fcs3 FC loc code:U78C9.001.WZS0894-P1-C8-T2
Ports logged in:3
Flags:0x32a<LOGGED_IN,STRIP_MERGE,SCSI_CLIENT>
VFC client name:fcs1 VFC client DRC:U8286.42A.21B85FV-V4-C4
# lsmap -vadapter vfchost10 -fmt : -npiv -field clntid clntname clntos flags
4:z-aix73t:AIX:322
The different is only here other 2 flags (which I saw until now) are same.
Flags:0x301<NOT_MAPPED,NOT_CONNECTED>
Flags:0x304<NOT_LOGGED>
# lsmap -vadapter vfchost7 -fmt : -npiv -field clntid clntname clntos flags
7: : :301
# lsmap -vadapter vfchost4 -fmt : -npiv -field clntid clntname clntos flags
8: : :304
------------------------------
Martin Pavliska
Original Message:
Sent: Wed January 22, 2025 08:28 AM
From: Russell Adams
Subject: Why lsmap forces different columns order than I want
Unfortunately the documentation states that the field order isn't preserved.
https://www.ibm.com/docs/en/power7?topic=commands-lsmap-command#lsmap__lsmap_field_flag
"Note: The order that you specify the attributes is not guaranteed to be the same order as they are returned. The attributes of the virtual host adapter (vhostX) are always listed before the attributes of the virtual target device (VTD). You can specify the order of the attributes within the virtual host adapter and the order of the attributes within the virtual target device. But, you cannot intermix the attributes of the virtual host adapter and the attributes of the virtual target device."
------------------------------
========================
Russell Adams
https://adamssystems.nl/
========================
Original Message:
Sent: Fri January 10, 2025 04:55 AM
From: Martin Pavliska
Subject: Why lsmap forces different columns order than I want
Hello everyone,
Please, I am playing with a script for a VIOS side (inspired by Oussama Nazih) and I noticed that lsmap command is forcing different order than I requested in -field parameter.
In case of two parameters:
# /usr/ios/cli/ioscli lsmap -vadapter vfchost18 -fmt : -npiv -field physloc vfcclientdrc
U8286.42A.21B85FV-V2-C4:U8286.42A.21B85FV-V14-C3
# /usr/ios/cli/ioscli lsmap -vadapter vfchost18 -fmt : -npiv -field vfcclientdrc physloc
U8286.42A.21B85FV-V2-C4:U8286.42A.21B85FV-V14-C3
In case of more:
-field name clntid clntname clntos vfcclient
vfchost18:14:aix72dev-e610b7c4-000003fa:AIX:fcs0
-field name clntid clntname clntos vfcclientdrc
vfchost18:14:aix72dev-e610b7c4-000003fa:AIX:U8286.42A.21B85FV-V14-C3
-field name clntid clntname clntos vfcclient vfcclientdrc
vfchost18:14:aix72dev-e610b7c4-000003fa:AIX:fcs0:U8286.42A.21B85FV-V14-C3
-field physloc name clntid clntname clntos vfcclient vfcclientdrc
U8286.42A.21B85FV-V2-C4:vfchost18:14:aix72dev-e610b7c4-000003fa:AIX:fcs0:U8286.42A.21B85FV-V14-C3
-field name clntid clntname clntos vfcclient vfcclientdrc physloc
vfchost18:14:aix72dev-e610b7c4-000003fa:AIX:U8286.42A.21B85FV-V2-C4:fcs0:U8286.42A.21B85FV-V14-C3
First I thought it is some bug, I tested it on VIOS 4.1.0.10 and VIOS 4.1.1.00, but it is the same for VIOS 3.1.4.31
Do you have please any idea what is behind this and why? Probably some historical relations? :)
Thank you
------------------------------
Martin Pavliska
------------------------------