Hi All,

I have a Suse 12 server VM on ESX6.

I am seeing an issue with the drivers are not claiming the devices in sequence. As we can see below host0 and host3 are allocated for disks and claimed by mptspi driver. host2 is allocated by CD ROM and claimed by ata_piix driver.
The issue here is that mptspi is not claiming the disks consecutively. Ideally host0 and host1 should have been claimed by mptspi and the rest of the host entices by ata_piix.

I want to know why OS is showing such behavior on ESX 6 while on all other machines (like ESX 5.5 or physical machines) they as showing as expected behavior of claiming the devices consequently.

# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 02 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 03 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02

The scsi subsystem shows below entries:

# for f in `ls /sys/class/scsi_host`; do echo ${f#host}; done | sort -n | xargs -i ls -ld /sys/class/scsi_host/host{}
lrwxrwxrwx 1 root root 0 Feb 2 11:52 /sys/class/scsi_host/host0 -> ../../devices/pci0000:00/0000:00:10.0/host0/scsi_host/host0
lrwxrwxrwx 1 root root 0 Feb 2 11:52 /sys/class/scsi_host/host1 -> ../../devices/pci0000:00/0000:00:07.1/ata1/host1/scsi_host/host1
lrwxrwxrwx 1 root root 0 Feb 2 11:52 /sys/class/scsi_host/host2 -> ../../devices/pci0000:00/0000:00:07.1/ata2/host2/scsi_host/host2
lrwxrwxrwx 1 root root 0 Feb 2 11:52 /sys/class/scsi_host/host3 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/host3/scsi_host/host3

Corresponding drivers for these hosts:

# for f in `ls /sys/class/scsi_host`; do echo ${f#host}; done | sort -n | xargs -i cat /sys/class/scsi_host/host{}/proc_name
mptspi
ata_piix
ata_piix
mptspi


The dmesg log shows below details.

Interleaving is happening between when drivers are loaded and the devices are claimed

Good scenario: where mptspi driver is initialized and immediately it claims the scsi ports.
[ 3.046897] Fusion MPT SPI Host driver 3.04.20 ===> DRIVER LOADED
[ 3.048534] mptbase: ioc0: Initiating bringup ===> DRIVER INITIALIZED
[ 3.122900] ioc0: LSI53C1030 B0: Capabilities={Initiator} ===> DRIVER INITIALIZED
[ 3.283185] scsi0 : ioc0: LSI53C1030 B0, FwRev=01032920h, Ports=1, MaxQ=128, IRQ=17 ===> SCSI PORT ALLOCATION
[ 3.394412] scsi 0:0:0:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2 ===> SCSI PORT CLAIMED

Bad Scenario: where mptspi driver is initialized but before it claims the scsi ports, ata_piix is initialized the it claims the ports.

[ 3.402079] mptbase: ioc1: Initiating bringup ===> DRIVER_1 INITIALIZED
[ 3.403323] Console: switching to colour frame buffer device 100x37
[ 3.404468] [drm] Initialized vmwgfx 2.4.0 20120209 for 0000:00:0f.0 on minor 0
[ 3.404516] ata_piix 0000:00:07.1: version 2.13 ===> DRIVER_2 INITIALIZED
[ 3.405185] scsi1 : ata_piix ====> SCSI PORT ALLOCATION FOR DRIVER_2
[ 3.405302] scsi2 : ata_piix ====> SCSI PORT CLAIMED FOR DRIVER_2
[ 3.405351] ata1: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0x1060 irq 14
[ 3.405353] ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0x1068 irq 15
[ 3.474407] ioc1: LSI53C1030 B0: Capabilities={Initiator} ===> DRIVER_1 INITIALIZED
[ 3.574243] ata2.00: ATAPI: VMware Virtual IDE CDROM Drive, 00000001, max UDMA/33 ===> DRIVER_2 RELATED MESSAGES
[ 3.590207] ata2.00: configured for UDMA/33
[ 3.590746] scsi 2:0:0:0: CD-ROM NECVMWar VMware IDE CDR10 1.00 PQ: 0 ANSI: 5 ====> SCSI PORT CLAIMED FOR DRIVER_2
[ 3.591122] scsi 2:0:0:0: Attached scsi generic sg1 type 5
[ 3.602558] sr0: scsi3-mmc drive: 1x/1x writer dvd-ram cd/rw xa/form2 cdda tray
[ 3.602561] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 3.602761] sr 2:0:0:0: Attached scsi CD-ROM sr0
[ 3.634875] scsi3 : ioc1: LSI53C1030 B0, FwRev=01032920h, Ports=1, MaxQ=128, IRQ=18 ====> SCSI PORT ALLOCATION FOR DRIVER_1
[ 3.746283] scsi 3:0:0:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2 ====> SCSI PORT CLAIMED FOR DRIVER_1

Please let me know what is happening here.

Thanks,
Shilpa