Change iSCSI Adapter Name – ESXi 6.7

Problem

I accidentally forgot to set a hostname before making the iSCSI software adapter live. There are no datastore attached to the host yet but i like the IQNs to be recognizable.

Solution

This ESXI was newly created so please don’t use these commands on a live system unless you’ve done your due diligence – or you may lose SAN access.

Log into ESXi host via SSH

1)  List adapter

esxcli iscsi adapter list

iqn1

As you’ll see the adapter name is vmhba64

2) Get current IQN

esxcli iscsi adapter get -A vmhba64

iqn2

As you’ll see the name of the iqn is: iqn.1998-01.com.vmware:5e564f8f-2276-07e8-7b66-0025b5a1000c-23fe06c8

Note you can trim down the output by using

esxcli iscsi adapter get -A vmhba64 | grep iqn

3) Change IQN name

Syntax:

esxcli iscsi adapter set -A vmhba64 -n iqn.1998-01.com.vmware:{new_name}

Command used:

esxcli iscsi adapter set -A vmhba64 -n iqn.1998-01.com.vmware:tstukth-esx03

iqn3