11

I've seen a lot of information about how IQN's should be formatted, but there's not a lot of information on how to build them. I'm kind of a newb when it comes to iSCSI, and i have it working, but I'm wondering if i should just be making this stuff up, or if there's good reason to follow some sort of standard.

As an example, this is how (wikipedia http://en.wikipedia.org/wiki/ISCSI#Addressing) says you should format IQNs.

              Naming     String defined by
 Type  Date    Auth      "example.com" naming authority
+--++-----+ +---------+ +-----------------------------+
|  ||     | |         | |                             |     

iqn.1992-01.com.example:storage:diskarrays-sn-a8675309
iqn.1992-01.com.example
iqn.1992-01.com.example:storage.tape1.sys1.xyz
iqn.1992-01.com.example:storage.disk2.sys1.xyz[10]

My question is particularly, Why the date? Can it be anything, Does it mean anything? Are there any enforcements here? Will i ever run into a point where putting the 'wrong' date in will bite me?

Is the domain example reversed(like dns is) for a reason? If i have a domain name like starkindustries.pri would my iqn look like:

iqn.2006-05.pri.starkindustries:Linux:array0

Does this depend on DNS? (experience tells me it isn't, but it could be failing in sublte ways) And if it is dependent on DNS, do i use a host name, or just my domain name? i.e. Jarvis.starkindustries.pri or just starkindustries.pri ?

Also If i use an IP address(which some suggest if you're not using DNS which is more confusing because it works without DNS) do you reverse it like you do dns? i.e. 10.1.2.0

iqn.2006-05.0.2.1.10:Linux:array0 

Also, do you use a host address (of the iSCSI target?) or a network address.

Is there any enforcement of the 'string defined by "example.com" naming authority' i.e. is there a reason i can't use blahblahblah vs something useful? I realize a useful name is more descriptive, but are there any technical reasons for this? I also take a huge leap of faith that I'm the 'naming authority'.

I guess more than anything, I'm making up a bunch of stuff for these IQNs, and they appear to be working. I just want to know at least where to find some best practices when it comes to the actual generation of the iqns. I'm just considering that someday I'm going to not be the only one in charge of storage, so i need to pass down some standards, or i'm either going to make a mess, or have someone else make a mess when a new block of IQNs are needed.

Steve Butler
  • 1,016
  • 9
  • 19
  • The wiki page you referenced explains the date portion "date (yyyy-mm) that the naming authority took ownership of the domain". Why - it makes sense. It means what it says. It should be what it says it will be. Don't use incorrect data. ? – CrackerJack9 Jan 29 '14 at 03:12
  • I'm the naming authority. What date do i use? When i setup the DNS server. When the DNS name was first registered? When the Yankees last won the world series? – Steve Butler Jan 29 '14 at 17:44
  • I don't know about any of the rest, but the reason that the domain name is backwards is very simple: it goes from the least-specific part to the most-specific. The same is true about why the date format has the year first, then the month. This is also one of the most common ways of setting up code namespaces in languages that support them, like Java, C#, PHP. See [Wikipedia](http://en.wikipedia.org/wiki/Reverse_domain_name_notation). – Moshe Katz Jan 30 '14 at 18:59
  • I guess i get the reasons why it *could* be, but it just seems very arbitrary. There seems to be no enforcement, just guidelines. Guidelines are great, but if i can get away with iqn:host:Target:Lun i will. – Steve Butler Jan 30 '14 at 23:44

1 Answers1

9

The rationale behind this in RFC 3720 is that above all, IQNs should be unique. The date prepended is a reasonable guarantee that the entity that controlled the domain name represented (in the naming auth field) at that time a "naming authority" who could ensure uniqueness - domain names change hands all the time and since the only other unique stuff going on is to the RHS of that first : (which is a free-for-all) there might already be a Linux:array0 or something similarly imaginative floating around.

RFC 3720 uses the (often amusing) MUST to define the date as YYYY-MM and goes into pernicious detail about the precise format and time of use etc. I imagine this is simply to make parsing and sorting simpler (fixed field lengths, always increasing). Are the RFC cops going to break your door down if you call your target iqn.screwyouRFC3720? Will it break the internet? No.

It has absolutely nothing to do with DNS, DNS is merely a handy, delegated, hierarchical system that already gets you from any TLD to a single device, if you like, so it's an easy way to identify responsible parties.

Personally, I like to make sure the IQN says something about when, who, what, why, and how important the data is, so when I'm hunting for space somewhere I know who to ask.

Like it or not, you're the naming authority.

quadruplebucky
  • 5,041
  • 18
  • 23
  • 1
    Great explanation. I realize I'm the naming authority. Fortunately/Unfortunately the NetApps i use in production get very fussy about sticking to the RFC (while my test linux box doesn't seem to care), even to the point where i have to use com/net/org in the iqn. It's frustrating, especially since I would like to use more verbose and useful naming. i.e. iqn.{Arbitrary date}.{hostname}:{Array}{Lun}. Personally i'd also rather have it forwards than backwards. it's a lot easier to remember that the host jarvis.starkindustries.pri, has an iqn of iqn.2012-01.jarvis.starkindustries.pri – Steve Butler Feb 25 '14 at 19:20