Adjusting SCSI Target ID in ESX Server 3 with iSCSI

I had an issue with an iSCSI target LUN not being formatted as VMFS in ESX Server 3.0.X.  The problem turned out to be on my side, but I ended up with a number of blank SCSI Targets under VI -> Configuration -> Storage Adapters.  My SCSI Targets jumped from SCSI Target 2 to SCSI Target 9.  This was not an ideal situation as I want all of the members of the DRS/HA cluster to have the same configuration.  The way to fix up the SCSI Targets involves adjusting some of the configuration files on the ESX Server itself.  First you need to move any and all running VMs off of the host you’re going to be working on and put it into Maintenance Mode.

  • Log into the service console as root.
  • cd /var/lib/iscsi and there are two control files there: vmkbindings, vmkdiscovery
  • temporarily disable iSCSI: esxcfg-swiscsi -d
  • kill the iSCSI software: esxcfg-swiscsi -k
  • edit both the vmkbindings and vmkdiscovery to remove the LUNs that are no longer valid.  You can change the target ID as well if you want to move that around.
  • start iSCSI back up: esxcfg-swscsi -e
  • wait about 30 seconds and do a rescan from the command line: esxcfg-swscsi -s
  • once you do that you can go into the VI Client and rescan the Storage Adapters.  If this looks right now you’re all set.
  • take the server out of maintenance mode and move a VM to the server to make sure it is working correct

That’s it!  Good luck, this saved me a decent amount of time and I wasn’t able to find this information in the forums or on the interwebs.

Tags:

Comments are closed.