Wednesday, February 9, 2011

How to configure iscsi from the cli in 4.1

Steps to follow:

Note: The esxi host uses the ip address 10.1.1.1 for its management network and 10.1.1.2 for iscsi. The iscsi server uses the ip address 10.1.1.3.

1. Create a new standard virtual switch
esxcfg-vswitch -a vSwitch1

2. Create a port group for ip storage
esxcfg-vswitch -A "Ip Storage" vSwitch1

3. Add a network card to the virtual switch
esxcfg-vswitch -L vmnic2 vSwitch1

4. Create a vmkernel port for ip storage with an ip address (10.1.1.2)
esxcfg-vmknic -a -i 10.1.1.2 -n 255.255.255.0 "Ip Storage"

5. Enable the iscsi driver
esxcfg-swiscsi -e

6. Verify that the driver has been enabled
esxcfg-swiscsi -q

7. Find the name of your iscsi hba
esxcfg-scsidevs -a (vmhba33 in this case)

8. Bind the vmkernel port to the port group and verify
esxcli swiscsi nic add -n vmk1 -d vmhba33
esxcli swiscsi nic list -d vmhba33

9. Discover the targets available from a particular server
vmkiscsi-tool -D -a -i 10.1.1.3 vmhba33

10. Use the esxcfg-rescan command to find the new devices
esxcfg-rescan vmhba33

Note:  You can now verify your results by either using the vsphere client or the cli

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.