Giving Solaris Systems iSCSI IQNs That Make Sense

Posted on July 3, 2007

When working with iSCSI nothing can be more confusing and frustrating than dealing with WWN-like cryptic IQN’s (unique strings that identify an initiator or target). I mean, how meaningful is this?: Not very.

SysAdmin Rule #102: Take cryptic non-sensical string, add some sleep deprivation, insert into production environment, result? Disaster.

Thankfully changing that random string is easy. (see target.h for how that string is determined)

First, find out what your initiators IQN is by default:

root@aeon ~$ iscsiadm list initiator-node
Initiator node name:

Now change it like so:

root@aeon ~$ iscsiadm modify initiator-node --node-name

root@aeon ~$ iscsiadm list initiator-node
Initiator node name:

Sweet and simple. Just remember to craft your IQN’s by the rules:
See Section of RFC 3720 – Internet Small Computer Systems Interface (iSCSI): “Type “iqn.” (iSCSI Qualified Name)”

Please note that Target IQN’s may not be changed. Each Target is given a unqiue IQN and while you can change the Alias of a Target, you can’t change the IQN. This isn’t really a problem most of the time, however, because unlike NetApp Filers where a single storage system has a single IQN which is LUN masked, each Target has its distinct IQN. Besides that, the string used for the SCSI Target ID (ie: c2t0912309812039810983d0) is going to be funky anyway, nothing you can do about that. (That funky string is actually the targets GUID.)