coreos / coreos-assembler

Tooling container to assemble CoreOS-like systems
https://coreos.github.io/coreos-assembler/
Apache License 2.0
333 stars 165 forks source link

kola/qemuexec: Add a wwn option for scsis disks #3772

Closed jbtrystram closed 3 months ago

jbtrystram commented 4 months ago

Add a customizable WWN option for kola DiskSpec to have reliable links under /dev/disk/by-id/. With this change kola qemuxec can be run like: kola qemuexec -D "5G:channel=scsi,wwn=007"

Resulting in the following links:

[core@localhost ~]$ rpm -qa sg3_utils
sg3_utils-1.48-1.fc40.x86_64
[core@localhost ~]$ ls -l /dev/disk/by-id
total 0
lrwxrwxrwx. 1 root root  9 Apr  5 09:05 scsi-30000000000000007 -> ../../sda
lrwxrwxrwx. 1 root root  9 Apr  5 09:05 wwn-0x0000000000000007 -> ../../sda

This is motivated by recent changes in sg3_utils [1] which removed some udev links. At least one of our tests [2] relying on this started failing. This patch was suggested by @jlebon [3]

[1] https://listman.redhat.com/archives/dm-devel/2023-March/053645.html [2] https://github.com/coreos/fedora-coreos-tracker/issues/1670 [3] https://github.com/coreos/fedora-coreos-tracker/issues/1670#issuecomment-2037725303

jbtrystram commented 4 months ago

it looks like I messed up something:

Edit: Ok, solved. The issue was format=raw for the non multipath disk

/srv/bin/kola qemuexec -D "5G:channel=scsi,wwn=0011" --qemu-image fcos41.qcow2 --add-ignition autologin
[....]
[core@localhost ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 192.5K  0 disk

Wheras with /srv/bin/kola qemuexec -D "5G" I get:

[core@localhost ~]$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0    5G  0 disk
jlebon commented 3 months ago

/retest

jbtrystram commented 3 months ago

/retest