esxcfg-scsidevs–a output changed in vSphere 4.1


Last week I was busy converting one of my ks.cfg scripts which I use to install vSphere 4.0 update 2 to vSphere 4.1 and I found something, which I didn’t expect from VMware..

To find the iSCSI vmhba I use the following one-liner to save it into a variable VMHBA:

VMHBA=$(/usr/sbin/esxcfg-scsidevs -a |grep “Software iSCSI” |awk ‘{print $1}’)

But the this on-liner didn’t work anymore in vSphere 4.1. So I tried to run the script part by part and started with on a vSphere 4.1 host:

/usr/sbin/esxcfg-scsidevs -a

The following output was generated:

image

if you run the same command on a vSphere 4.0 update 2 host, you’ll see the difference:

image

So to fix this part of my ks.cfg I had to change the VMHBA one-liner and change the grep phrase to “iSCSI Software Adapater” instead of “Software iSCSI”:

VMHBA=$(/usr/sbin/esxcfg-scsidevs -a |grep “iSCSI Software Adapter” |awk ‘{print $1}’)

After changing this line, my ks.cfg script runs fine again. But the question remains unanswered; why did VMware change the output of esxcfg-scsidevs –a Winking smile.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s