Configure software iSCSI networking from the CLI.

Follow these steps to configure software iSCSI networking on an ESX server. In this case I’ll be creating a new vSwitch, new Port Group on the new vSwitch and I’ll add the VMkernel port to the vSwitch. This setup will support the Jumbo Frames (MTU 9000). After that I’ll add an iSCSI target to the iSCSI software adapter and rescan the adapter for new targets.

  1. Login as Root user on your ESX server.
  2. List the vSwitches with #esxcfg-vswitch -l and check the next available switch name. In this case I’ll be using vSwitch2.
  3. Create a new vSwitch: #esxcfg-vswitch -a vSwitch2
  4. Set the MTU to 9000: #esxcfg-vswitch vSwitch2 -m 9000
  5. List available NIC’s that can be used with the new vSwitch: #esxcfg-nics -l. In this case I’ll use vmnic4 and vmnic5.
  6. Add the vmnic4 to the new vSwitch: #esxcfg-vswitch vSwitch2 -L vmnic4
  7. Add the vmnic5 to the new vSwitch: #esxcfg-vswitch vSwitch2 -L vmnic5
  8. Add a Port Group to the new vSwitch: #esxcfg-vswitch vSwitch2 -A “VMkernel iSCSI”
  9. Add the VMkernel port to the new Port Group: #esxcfg-vmknic -a -i <IP address>-n <Network Mask> -m 9000 “VMkernel iSCSI”
  10. Enable the software iSCSI adapter: #esxcfg-swiscsi -e
  11. Add the iSCSI target to the software iSCSI adapter: #vmkiscsi-tool -D -a <IP address> <vmhba#> . Repeat this step if you have more iSCSI targets.
  12. Rescan the vmhba adapter with: #esxcfg-rescan <vmhba#>
  13. When the targets are discovered, you can view them with: #vmkiscsi-tool -T -l <vmhba#>
  14. Restart your server if necessary.

All done 🙂

Tested on ESX 4.0.0, Build 164009. Should also work on ESX 3.x.x.


– Marek.Z

1 Comment

Leave a reply...