Skip to content

Commit

Permalink
mantle/kola/testiso: add iscsi test for multipath on top of iscsi
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dustymabe committed May 2, 2024
1 parent ccf4c24 commit 462d48f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 9 additions & 5 deletions mantle/cmd/kola/resources/iscsi_butane_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,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 | \
Expand All @@ -63,7 +66,8 @@ storage:
# set some random uuid as the initiator iqn, 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:
Expand All @@ -76,7 +80,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
Expand Down
8 changes: 7 additions & 1 deletion mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-multipath.bios",
"iso-offline-install-iscsi.manual.bios",
"miniso-install.bios",
"miniso-install.nm.bios",
Expand All @@ -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-multipath.s390fw",
//"iso-offline-install-iscsi.manual.s390fw",
}
tests_ppc64le = []string{
Expand All @@ -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-multipath.ppcfw",
//"iso-offline-install-iscsi.manual.ppcfw",
}
tests_aarch64 = []string{
Expand All @@ -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-multipath.uefi",
//"iso-offline-install-iscsi.manual.uefi",
}
)
Expand Down Expand Up @@ -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-multipath":
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)
}
Expand Down

0 comments on commit 462d48f

Please sign in to comment.