VMware – How to setup Software iSCSI with ESXCLI

To configure Software iSCSI, it can be done via HTML5 Web UI. But when you need to setup or configure Software iSCSI for many esxi host, it will take long time to do via HTML5 Web UI.

This job can be speed by setting up Software iSCSI with esxcli command line tool.

Below are most common esxcli command that i used to setup Software iSCSI

1) Enable software iSCSI

Command:

esxcli iscsi software set -e true

2) To view host’s iSCSI adapter

Command:

esxcli iscasi adapter list

3) Rename the ISCSI adapter IQN according to your desired name

Command:

esxcli iscsi adapter set -n <insertNewIQNname> -A vmhbaxx

4) Check status of Software iSCSI

Command:

esxcli iscsi software get

Note: true=iSCSI Enable ; false=iSCSI Disable

5) Add dynamic discovery address

Note: with dynamic discovery, all storage targets associated with a host name or IP Address will be discovered.

Command:

esxcli iscsi adapter discovery sendtarget add –address=<IP/FQDN[:port]> –adapter=<adapter_name>

Example

esxcli iscsi adapter discovery sendtarget add –address=10.112.254.164:3260 –adapter=vmhba64

6) List iSCSI targets with IP and Port

Command:

esxcli iscsi adapter target portal list

7) Re-discover and re-scan iSCSI adapters

Command

esxcli iscsi adapter discovery rediscover -A adapter_name

esxcli storage core adapter rescan -A adapter_name

8) List the mounted VMFS volumes

Command

esxcli storage vmfs extent list

Leave a Reply

Your email address will not be published. Required fields are marked *