Date: Thu, 16 Jan 2020 17:27:49 +0200 From: Andriy Gapon <avg@FreeBSD.org> To: freebsd-scsi@freebsd.org Subject: [wtf] vtscsi aka virtio_scsi does not see disk at target 7 Message-ID: <c0e529c8-a111-4caa-37a9-5b447abb9a2a@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
I think I see what's going on, but it was a WTF moment for me. We use virtio_scsi driver on GCE VMs. We typically configure VMs with 6 or less disks, but recently we started to use VMs with 8+ disks. On some of them, after a reboot, one disk is missing. Here is an example: # camcontrol devlist -v scbus0 on vtscsi0 bus 0: <Google PersistentDisk 1> at scbus0 target 1 lun 0 (pass0,da0) <Google PersistentDisk 1> at scbus0 target 2 lun 0 (pass1,da1) <Google PersistentDisk 1> at scbus0 target 3 lun 0 (pass2,da2) <Google PersistentDisk 1> at scbus0 target 4 lun 0 (pass3,da3) <Google PersistentDisk 1> at scbus0 target 5 lun 0 (pass4,da4) <Google PersistentDisk 1> at scbus0 target 6 lun 0 (pass5,da5) <Google PersistentDisk 1> at scbus0 target 8 lun 0 (pass6,da6) <Google PersistentDisk 1> at scbus0 target 9 lun 0 (pass7,da7) We noticed that it is always target 7 that is missing. After looking at the code, the problem is kind of obvious. scsi_scan_bus: for (i = low_target; i <= max_target; i++) { cam_status status; if (i == initiator_id) continue; vtscsi_cam_path_inquiry: cpi->initiator_id = VTSCSI_INITIATOR_ID; /* * Specification doesn't say, use traditional SCSI default. */ #define VTSCSI_INITIATOR_ID 7 >From what I see, on GCE at least, target 7 is a valid target and it is not reserved for the initiator. At the same time, I see that target 0 is never used for disks. Also, it seems that virtio configuration gives 253 as the maximum target ID on those instances. I would appreciate any suggestions on what to use for initiator_id in this driver. Thanks! -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c0e529c8-a111-4caa-37a9-5b447abb9a2a>