Lots of people complain that iSCSI disk will be brought up with software iSCSI mode in kdump kernel, although this disk works with iBFT mode previously in 1st kernel. In addition, kdump kernel can boot from the disk which is brought up by software iSCSI, this may be different with 1st kernel.
To make it be consistent with 1st kernel, we should use iBFT mode to bring iSCSI disk up, instead of software iSCSI.
There is a difference between iBFT and software iSCSI, the value of node.discovery_type. The value of discovery_type for iBFT is fw, and software iSCSI is send_targets.
It is safe to return immediately from kdump_setup_iscsi_device, if iBFT mode is detected, since dracut can take care of iBFT.
Signed-off-by: Minfei Huang mhuang@redhat.com --- dracut-module-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4cd7107..0a59a91 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -494,7 +494,11 @@ kdump_get_iscsi_initiator() { return 1 }
-# No ibft handling yet. +# Figure out iBFT session according to session type +is_ibft() { + [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ] +} + kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -517,6 +521,10 @@ kdump_setup_iscsi_device() { return 1 fi
+ if is_ibft ${path}; then + return + fi + tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn[0].address")
Hi Minfei,
I try to adjust the patch log according to our discussion and my understanding, do you think it's OK?
--- From: Minfei Huang mhuang@redhat.com
There are several kinds of iSCSI mode we support currently. - Pure hardware iSCSI - iBFT iSCSI - Pure software iSCSI
Except of the 1st one because firmware takes care of everything to make it behave like a local disk, iBFT and pure software iSCSI mode need information passed to kdump kernel for configuring them correctly.
Currently kdump will take iBFT mode as a software iSCSI and collect the related information for setting up software iSCSI of 2nd kernel, though dracut can detect and collect information for setting up iBFT iSCSI of 2nd kernel. This brings up 2 problems:
1) For iBFT mode 2 sessions will be built in 2nd kernel, one is in iBFT mode, the other is pure software mode. This is because both kdump and dracut collect iSCSI inforamtion separately for a certain iBFT mode iSCSI of 1st kernel.
2) These 2 sessions of 2nd kernel for a certain session of 1st kernel could contain two "ip=xxx" cmdline option. This will cause cmdline handling error in dracut.
In order to avoid above 2 problems, kdump need detect iBFT mode iSCSI and leave it to dracut. This is what have been done in this patch.
For iBFT iSCSI In 1st kernel, the iscsi device could be software or hardware based. But we only use software iscsi in 2nd kernel. This is fine for software iscsi as it's consistent with 1st kernel. However kdump bringing up hardware iscsi in software mode could lead conflicts with dracut bringing up logic, depending on the configuration.
If boot disk is hardware iscsi, we should still use hardware iscsi in 2nd kernel. In this case, dracut will bring up the device like it does for normal boot. kdump don't need to do extra work to configure software iscsi.
Signed-off-by: Minfei Huang mhuang@redhat.com Signed-off-by: Baoquan He bhe@redhat.com --- dracut-module-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4cd7107..0a59a91 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -494,7 +494,11 @@ kdump_get_iscsi_initiator() { return 1 }
-# No ibft handling yet. +# Figure out iBFT session according to session type +is_ibft() { + [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ] +} + kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -517,6 +521,10 @@ kdump_setup_iscsi_device() { return 1 fi
+ if is_ibft ${path}; then + return + fi + tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn[0].address")
Sorry, there's editing problem. Reply it here again. --- From: Minfei Huang mhuang@redhat.com
There are several kinds of iSCSI mode we support currently. - Pure hardware iSCSI - iBFT iSCSI - Pure software iSCSI
Except of the 1st one because firmware takes care of everything to make it behave like a local disk, iBFT and pure software iSCSI mode need information passed to kdump kernel for configuring them correctly.
Currently kdump will take iBFT mode as a software iSCSI and collect the related information for setting it up in 2nd kernel, though dracut can detect it as iBFT mode and collect enough information. This brings 2 problems:
1) For iBFT mode 2 sessions will be built in 2nd kernel, one is in iBFT mode, the other is pure software mode. This is because both kdump and dracut collect iSCSI inforamtion separately for a certain iBFT mode iSCSI of 1st kernel.
2) These 2 sessions of 2nd kernel for a certain session of 1st kernel could contain two "ip=xxx" cmdline option. This will cause cmdline handling error in dracut.
In order to avoid above 2 problems, kdump need detect iBFT mode iSCSI and leave it to dracut. This is what have been done in this patch.
Signed-off-by: Minfei Huang mhuang@redhat.com Signed-off-by: Baoquan He bhe@redhat.com --- dracut-module-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4cd7107..50dee8d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -494,7 +494,11 @@ kdump_get_iscsi_initiator() { return 1 }
-# No ibft handling yet. +# Detect iBFT session according to session type +is_ibft() { + [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ] +} + kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -517,6 +521,10 @@ kdump_setup_iscsi_device() { return 1 fi
+ if is_ibft ${path}; then + return + fi + tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn[0].address")
On 05/26/16 at 04:44pm, Baoquan He wrote:
Sorry, there's editing problem. Reply it here again.
From: Minfei Huang mhuang@redhat.com
There are several kinds of iSCSI mode we support currently.
- Pure hardware iSCSI
- iBFT iSCSI
- Pure software iSCSI
It's better to use what documentation says about iSCSI type.
Except of the 1st one because firmware takes care of everything to make it behave like a local disk, iBFT and pure software iSCSI mode need information passed to kdump kernel for configuring them correctly.
Currently kdump will take iBFT mode as a software iSCSI and collect the related information for setting it up in 2nd kernel, though dracut can detect it as iBFT mode and collect enough information. This brings 2 problems:
- For iBFT mode 2 sessions will be built in 2nd kernel, one is in
iBFT mode, the other is pure software mode. This is because both kdump and dracut collect iSCSI inforamtion separately for a certain iBFT mode iSCSI of 1st kernel.
The result is that iSCSI disk will be brought up by iBFT mode, not software iSCSI mode.
- These 2 sessions of 2nd kernel for a certain session of 1st kernel
could contain two "ip=xxx" cmdline option. This will cause cmdline handling error in dracut.
Here two "ip=" option, one "ip=dhcp:netdev" is to setup network, the other "ip=ibft" is to setup network as well. So I think we can post a patch that kdump does not need to gather network configuration, if there is network configeration in /etc/cmdline.d/40-ibft.conf.
Then I think we will never meet the duplicated ip issue.
Thanks Minfei
In order to avoid above 2 problems, kdump need detect iBFT mode iSCSI and leave it to dracut. This is what have been done in this patch.
Signed-off-by: Minfei Huang mhuang@redhat.com Signed-off-by: Baoquan He bhe@redhat.com
dracut-module-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4cd7107..50dee8d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -494,7 +494,11 @@ kdump_get_iscsi_initiator() { return 1 }
-# No ibft handling yet. +# Detect iBFT session according to session type +is_ibft() {
- [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]
+}
kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -517,6 +521,10 @@ kdump_setup_iscsi_device() { return 1 fi
- if is_ibft ${path}; then
return
- fi
- tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn[0].address")
-- 2.5.5