Centos 6 Linux VMs running inside vSphere 4.1 appear to dynamically discover new LUNs

I came across an interesting discovery yesterday while working on a CentOS 6 gluster node. The node was virtualized inside vSphere 4.1 and needed some additional storage added to it. I went into the VI client and added a new disk while the server was running, expecting to have to reboot or rescan the storage devices in the server. Well, I was pleasantly surprised when the following messages popped up on the console:

null

Nice, it looks like the device was added to the system dynamically! I ran dmesg to confirm:

$ dmesg | tail -14

mptsas: ioc0: attaching ssp device: fw_channel 0, fw_id 1, phy 1, sas_addr 0x5000c295575f0957
scsi 2:0:1:0: Direct-Access     VMware   Virtual disk     1.0  PQ: 0 ANSI: 2
sd 2:0:1:0: [sdb] 75497472 512-byte logical blocks: (38.6 GB/36.0 GiB)
sd 2:0:1:0: [sdb] Write Protect is off
sd 2:0:1:0: [sdb] Mode Sense: 03 00 00 00
sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
sd 2:0:1:0: Attached scsi generic sg2 type 0
sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
 sdb: unknown partition table
sd 2:0:1:0: [sdb] Cache data unavailable
sd 2:0:1:0: [sdb] Assuming drive cache: write through
sd 2:0:1:0: [sdb] Attached SCSI disk

Rock on! In the past I’ve had to reboot virtual machines or rescan the storage devices to find new LUNs. This VM was configured with a LSI Logic SAS controller and is running CentOS 6. I’m not sure if something changed in the storage stack in CentOS 6, or if the SAS controller is the one to thank for this nicety. Either way I’m a happy camper, and I love it when things just work! :)

3 thoughts on “Centos 6 Linux VMs running inside vSphere 4.1 appear to dynamically discover new LUNs”

  1. Pingback: Centos 6 Linux VMs running inside vSphere 4.1 appear to … | Linux - Vše o Linuxu
  2. Pingback: Centos 6 Linux VMs running inside vSphere 4.1 appear to dynamically discover new LUNs | Linux - Vše o Linuxu
  3. With 6.x you don’t need to run any third party scripts, you just have to give the HBA a kick.

    For FC:
    echo “1” > /sys/class/fc_host/host#/issue_lip

    For all other SCSI attached storage:
    echo “- – -” > /sys/class/scsi_host/host#/scan

    I haven’t seen it automatically pulling in new drives, but VMware may have issued it’s own bus reset when you added the drive.

Leave a Reply

Your email address will not be published. Required fields are marked *