Skip to content
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

Merged

Conversation

changzhi1990
Copy link
Contributor

@changzhi1990 changzhi1990 commented Aug 4, 2020

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.

@changzhi1990
Copy link
Contributor Author

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.

@changzhi1990
Copy link
Contributor Author

changzhi1990 commented Aug 4, 2020

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
zthinUserID is CHAZ00D4
multipathd service is active and running.
Error: non-zero CP response for command 'q fcp': #40
Done
Done
Done
Done
Done
These WWPNs will be operated: 5005076802400c1a 5005076802400c1b
/dev/disk/by-path/ccw-0.0.5c73-zfcp-0x5005076802400c1a:0x0000000000000000 is: /dev/disk/by-path/ccw-0.0.5c73-zfcp-0x5005076802400c1a:0x0000000000000000
/dev/disk/by-path/ccw-0.0.5d73-zfcp-0x5005076802400c1a:0x0000000000000000 is: /dev/disk/by-path/ccw-0.0.5d73-zfcp-0x5005076802400c1a:0x0000000000000000
/dev/disk/by-path/ccw-0.0.5c74-zfcp-0x5005076802400c1a:0x0000000000000000 is: /dev/disk/by-path/ccw-0.0.5c74-zfcp-0x5005076802400c1a:0x0000000000000000
/dev/disk/by-path/ccw-0.0.5d74-zfcp-0x5005076802400c1a:0x0000000000000000 is: /dev/disk/by-path/ccw-0.0.5d74-zfcp-0x5005076802400c1a:0x0000000000000000
Multipath is enabled, using multipath devNode: /dev/disk/by-id/dm-uuid-part1-mpath-36005076802880052a000000000004047.
Begin to refreshZIPL.
devNode is: /dev/disk/by-id/dm-uuid-part1-mpath-36005076802880052a000000000004047 point: /mnt/qySgR
Use as much as possible of FCP devices: 5d74 5d73 5c74 5c71 5c73 and WWPN: 5005076802400c1a 5005076802400c1b rd.zfcp: 5d74,0x5005076802400c1a 5d73,0x5005076802400c1b 5c74,0x5005076802400c1a 5c71,0x5005076802400c1b 5c73,0x5005076802400c1a 5d74,0x5005076802400c1b 5d73,0x5005076802400c1a 5c74,0x5005076802400c1b
Refresh rhel78 zipl.
Updating /mnt/qySgR/etc/fstab
Move stale multipath bindings and wwids if any
WWPNs: 5005076802400c1a 5005076802400c1b
FCPs: 5d74 5d73 5c74 5c71 5c73
Begin to cleanup umount dir.
Finish cleanuping umount dir.
Begin to disconnect FCPs
Disconnect FCP device: 5d74
Disconnect FCP device: 5d74
FCP device 5d74 has already detached.
Disconnect FCP device: 5d73
Disconnect FCP device: 5d73
FCP device 5d73 has already detached.
Disconnect FCP device: 5c74
Disconnect FCP device: 5c74
FCP device 5c74 has already detached.
Disconnect FCP device: 5c71
Disconnect FCP device: 5c71
FCP device 5c71 has already detached.
Disconnect FCP device: 5c73
Disconnect FCP device: 5c73
FCP device 5c73 has already detached.
Finish disconnecting FCPs.
Begin to refresh multipath bindings.
Cleaning up multipath bindings and wwids.
Finish refreshing multipath bindings.

do
for w in ${wwpns[@]}

# For rhel8.x, the max support items of "rd.zfcp" is 8, so we need to judge the
Copy link
Contributor

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 ))
Copy link
Contributor

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?

Copy link
Contributor Author

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[@]}
Copy link
Contributor

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."
Copy link
Contributor

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
Copy link
Contributor

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.

@changzhi1990 changzhi1990 force-pushed the limit_length_rd_zfcp branch 3 times, most recently from 3e91dff to b830ae9 Compare August 4, 2020 05:37
@dongyanyang
Copy link
Contributor

@bjhuangr @jichenjc pls help to review, thanks

@bjhuangr
Copy link
Contributor

bjhuangr commented Aug 4, 2020

@changzhi1990 The code change looks good to me. Please add some words to describe the change into commit message.

wwpn_index=0
fi

x=${fcps[$fcp_index]},0x${wwpns[$wwpn_index]}" "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing $lun?

@changzhi1990
Copy link
Contributor Author

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

The VM works fine:
image

Copy link
Contributor

@bjhuangr bjhuangr left a 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>
@changzhi1990
Copy link
Contributor Author

Please add the commit message

done

@bjhuangr bjhuangr merged commit d247d47 into openmainframeproject:master Aug 12, 2020
haolp pushed a commit to haolp/python-zvm-sdk that referenced this pull request Sep 2, 2020
…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>
haolp pushed a commit to haolp/python-zvm-sdk that referenced this pull request Sep 2, 2020
…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>
haolp pushed a commit to haolp/python-zvm-sdk that referenced this pull request Sep 2, 2020
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants