-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit the length of rd.zfcp when refresh bootmap #329
Limit the length of rd.zfcp when refresh bootmap #329
Conversation
2ea6fdc
to
2b89d74
Compare
Boot from volume maybe fails at the refreshbootmap stage for length of kernel parameter line exceed the maximum allowed. So the production recommend is 8 paths of rd.zfcp. If the count of FCP devices is greater than 8, it will report an error and exit directly. If the count of WWPN is greater than 8, it will report a warning and don't exit. |
With this pr, if the path is less than 8, it would work fine. If the path is greater than 8, the output is: [root@rhel82-com ~]# sudo /opt/zthin/bin/refresh_bootmap --fcpchannel=5c73,5d73,5c74,5c71,5d74 --wwpn=5005076802100C1A,5005076802200C1A,5005076802400C1A,5005076802300C1A,5005076802300C1B,5005076802200C1B,5005076802100C1B,5005076802400C1B --lun=0000000000000000 |
do | ||
for w in ${wwpns[@]} | ||
|
||
# For rhel8.x, the max support items of "rd.zfcp" is 8, so we need to judge the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not only rhel8.x
@@ -295,14 +295,59 @@ function refreshZIPL { | |||
os=$os$version | |||
fi | |||
# Prepare the new rd.zfcp parameter value | |||
fcps_len=${#fcps[@]} | |||
wwpns_len=${#wwpns[@]} | |||
res=$(( $fcps_len * $wwpns_len )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we have handled the case when fcps_len or wwpns_len is zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
fi | ||
|
||
# Check the count of WWPN, if greater than 8, warning and don't exit. | ||
wwpns_len=${#wwpns[@]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check after get the real wwpn, here the wwpn is the passed in parameters.
fcps_len=${#fcps[@]} | ||
if [ $fcps_len -gt 8 ] | ||
then | ||
inform "ERROR: The count of FCP devices can't greater than 8." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FCP channel count %d is greater than 8.
# If the result of fcps_len multiply wwpns_len greater than 8, we need to use | ||
# every FCP device and as much as possible to use WWPN. | ||
else | ||
if [ $fcps_len -gt $wwpns_len ];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These code logic can be simplified.
3e91dff
to
b830ae9
Compare
@changzhi1990 The code change looks good to me. Please add some words to describe the change into commit message. |
b830ae9
to
d55b4c0
Compare
wwpn_index=0 | ||
fi | ||
|
||
x=${fcps[$fcp_index]},0x${wwpns[$wwpn_index]}" " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing $lun?
d55b4c0
to
047e2ad
Compare
For 4 FCPs and 4 WWPNs scenarios, the output is: Aug 10 02:33:19 112-cmp-cz root[31258]: 28492.0 refresh_bootmap: refresh_bootmap: refreshZIPL: Use as much as possible of FCP devices: 1d0c 1b0b 1c09 1a09 and WWPN: 500507680b25bac6 500507680b25bac7 500507680b26bac6 500507680b26bac7 rd.zfcp: rd.zfcp=0.0.1d0c,0x500507680b25bac6,0x0000000000000000 rd.zfcp=0.0.1b0b,0x500507680b25bac7,0x0000000000000000 rd.zfcp=0.0.1c09,0x500507680b26bac6,0x0000000000000000 rd.zfcp=0.0.1a09,0x500507680b26bac7,0x0000000000000000 rd.zfcp=0.0.1d0c,0x500507680b25bac7,0x0000000000000000 rd.zfcp=0.0.1b0b,0x500507680b26bac6,0x0000000000000000 rd.zfcp=0.0.1c09,0x500507680b26bac7,0x0000000000000000 rd.zfcp=0.0.1a09,0x500507680b25bac6,0x0000000000000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the commit message
In the boot from volume scenario for RHEL, the VM may fail if the length of kernel parameter line exceeds the maximum allowed. So the production recommend is 8 different paths of rd.zfcp. If the count of FCP devices is greater than 8, it will report an error and exit directly. If the count of WWPN is greater than 8, it will report a warning and don't exit. Signed-off-by: changzhi <changzhi1990@gmail.com>
2f9d31c
to
e19188b
Compare
done |
…t#329) In the boot from volume scenario for RHEL, the VM may fail if the length of kernel parameter line exceeds the maximum allowed. So the production recommend is 8 different paths of rd.zfcp. If the count of FCP devices is greater than 8, it will report an error and exit directly. If the count of WWPN is greater than 8, it will report a warning and don't exit. Signed-off-by: changzhi <changzhi1990@gmail.com> Co-authored-by: changzhi <changzhi1990@gmail.com>
…t#329) In the boot from volume scenario for RHEL, the VM may fail if the length of kernel parameter line exceeds the maximum allowed. So the production recommend is 8 different paths of rd.zfcp. If the count of FCP devices is greater than 8, it will report an error and exit directly. If the count of WWPN is greater than 8, it will report a warning and don't exit. Signed-off-by: changzhi <changzhi1990@gmail.com> Co-authored-by: changzhi <changzhi1990@gmail.com>
…t#329) In the boot from volume scenario for RHEL, the VM may fail if the length of kernel parameter line exceeds the maximum allowed. So the production recommend is 8 different paths of rd.zfcp. If the count of FCP devices is greater than 8, it will report an error and exit directly. If the count of WWPN is greater than 8, it will report a warning and don't exit. Signed-off-by: changzhi <changzhi1990@gmail.com> Co-authored-by: changzhi <changzhi1990@gmail.com>
In the boot from volume scenario for RHEL, the VM may fail if the length of kernel parameter line exceeds the maximum allowed. So the production recommend is 8 different paths of rd.zfcp.
If the count of FCP devices is greater than 8, it will report an error and exit directly.
If the count of WWPN is greater than 8, it will report a warning and don't exit.