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:

VMWare Resizing

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! :)

This article was posted by Matty on 2011-11-27 08:50:00 -0400 -0400