[wtf] vtscsi aka virtio_scsi does not see disk at target 7

Andriy Gapon <[email protected]>
Newsgroups gmane.os.freebsd.devel.scsi
Message-ID <[email protected]>
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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.