From d7d352daffd94a307b9fc3121925a676332ed3b3 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Wed, 1 May 2024 23:14:26 -0400 Subject: [PATCH] mantle/kola/testiso: add iscsi test for multipath on top of iscsi Here we modify the iscsi setup to define two ports `:0` and `:1` that both expose the same underlying block device, which means that multipath can be set up on top of those two paths. We then add a new test that provides `root=/dev/disk/by-label/dm-mpath-root` and `rd.multipath=default` to the kernel command line to perform the test. Note that this modifies the targetd setup and the iPXE config for all of the tests, but they still work fine, just accessing `:0` and leaving `:1` alone. --- mantle/cmd/kola/resources/iscsi_butane_setup.yaml | 14 +++++++++----- mantle/cmd/kola/testiso.go | 8 +++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mantle/cmd/kola/resources/iscsi_butane_setup.yaml b/mantle/cmd/kola/resources/iscsi_butane_setup.yaml index 9cde7e741c..9937e35d6a 100644 --- a/mantle/cmd/kola/resources/iscsi_butane_setup.yaml +++ b/mantle/cmd/kola/resources/iscsi_butane_setup.yaml @@ -47,9 +47,12 @@ storage: # FIXME: use RestartMode=direct instead in the systemd unit but we need systemd v254 while ! targetcli ls; do sleep 1; done targetcli /backstores/block create name=coreos dev=/dev/disk/by-id/virtio-target - targetcli iscsi/ create iqn.2024-05.com.coreos - targetcli iscsi/iqn.2024-05.com.coreos/tpg1/luns create /backstores/block/coreos - targetcli iscsi/iqn.2024-05.com.coreos/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1 + targetcli iscsi/ create iqn.2024-05.com.coreos:0 + targetcli iscsi/ create iqn.2024-05.com.coreos:1 + targetcli iscsi/iqn.2024-05.com.coreos:0/tpg1/luns create /backstores/block/coreos + targetcli iscsi/iqn.2024-05.com.coreos:1/tpg1/luns create /backstores/block/coreos + targetcli iscsi/iqn.2024-05.com.coreos:0/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1 + targetcli iscsi/iqn.2024-05.com.coreos:1/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1 " # Will return 0 if the discovery yield a valid portal iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1 | \ @@ -64,7 +67,8 @@ storage: # but we do need to provide it because otherwise this will # fail pointing to https://ipxe.org/1c0d6502 set initiator-iqn iqn.68cc69b9-1b54-4ff1-9d61-eedb570da8fd - sanboot iscsi:10.0.2.15::::iqn.2024-05.com.coreos + sanboot iscsi:10.0.2.15::::iqn.2024-05.com.coreos:0 \ + iscsi:10.0.2.15::::iqn.2024-05.com.coreos:1 - path: /usr/local/bin/install-coreos-iscsi mode: 0755 contents: @@ -77,7 +81,7 @@ storage: sleep 2 # Install coreos coreos-installer install \ - /dev/disk/by-path/ip-127.0.0.1\:3260-iscsi-iqn.2024-05.com.coreos-lun-0 \ + /dev/disk/by-path/ip-127.0.0.1\:3260-iscsi-iqn.2024-05.com.coreos\:0-lun-0 \ COREOS_INSTALLER_KARGS \ --console ttyS0,115200n8 \ -i /var/nested-ign.json diff --git a/mantle/cmd/kola/testiso.go b/mantle/cmd/kola/testiso.go index 10404780f2..7186babacf 100644 --- a/mantle/cmd/kola/testiso.go +++ b/mantle/cmd/kola/testiso.go @@ -90,6 +90,7 @@ var ( "iso-offline-install.mpath.bios", "iso-offline-install-fromram.4k.uefi", "iso-offline-install-iscsi.ibft.uefi", + "iso-offline-install-iscsi.ibft-with-mpath.bios", "iso-offline-install-iscsi.manual.bios", "miniso-install.bios", "miniso-install.nm.bios", @@ -114,6 +115,7 @@ var ( "miniso-install.4k.nm.s390fw", // FIXME https://github.com/coreos/fedora-coreos-tracker/issues/1657 //"iso-offline-install-iscsi.ibft.s390fw, + //"iso-offline-install-iscsi.ibft-with-mpath.s390fw", //"iso-offline-install-iscsi.manual.s390fw", } tests_ppc64le = []string{ @@ -129,6 +131,7 @@ var ( "pxe-offline-install.4k.ppcfw", // FIXME https://github.com/coreos/fedora-coreos-tracker/issues/1657 //"iso-offline-install-iscsi.ibft.ppcfw", + //"iso-offline-install-iscsi.ibft-with-mpath.ppcfw", //"iso-offline-install-iscsi.manual.ppcfw", } tests_aarch64 = []string{ @@ -147,6 +150,7 @@ var ( "pxe-online-install.4k.uefi", // FIXME https://github.com/coreos/fedora-coreos-tracker/issues/1657 //"iso-offline-install-iscsi.ibft.uefi", + //"iso-offline-install-iscsi.ibft-with-mpath.uefi", //"iso-offline-install-iscsi.manual.uefi", } ) @@ -618,7 +622,9 @@ func runTestIso(cmd *cobra.Command, args []string) (err error) { case "ibft": butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg rd.iscsi.firmware=1") case "manual": - butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg netroot=iscsi:10.0.2.15::::iqn.2024-05.com.coreos") + butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg netroot=iscsi:10.0.2.15::::iqn.2024-05.com.coreos:0") + case "ibft-with-mpath": + butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg rd.iscsi.firmware=1 --append-karg rd.multipath=default --append-karg root=/dev/disk/by-label/dm-mpath-root") default: plog.Fatalf("Unknown test name:%s", test) }