Storage

Set DNS name of ESXi hosts for easy IQN naming

If vSphere administration will engrain one thing in your mind, it's the importance of consistency. Rickatron shows a tip in this post to set host configuration consistency for iSCSI networks.

When it comes to vSphere host names, we have a number of nomenclature processes and standards. Those are all good, but we should also extend this to other elements of an ESXi host. One area where I’ve started executing a bit more consistency is the software iSCSI adapter and, in particular, its name.

The name of the iSCSI initiator on the ESXi host is an important aspect of identifying host connectivity on the storage system, so it would behoove us as vSphere administrators to put in the extra effort to have the iSCSI initiator be configured in the same manner as the host. One particular aspect is the iSCSI Qualified Name (IQN). The software initiator within ESXi will, by default, have the IQN name have the default name, localhost, in its IQN name if the host's name isn’t changed. Figure A shows a host with the default IQN name having localhost in the name.

Figure A

The IQN default name is used

The IQN default name is used.
You’ll quickly learn once multiple ESXi hosts are involved that having a name of localhost for an ESXi host is utterly useless when managing a storage system. Secondly, you’ll notice that configuring a local DNS configuration on the ESXi host will help this happen. One frequent misconfiguration of ESXi hosts is to set a DNS entry on the DNS server(s) for the hosts, but not configure the hosts for the DNS servers. Figure B shows where DNS is configured in the host (Host Configuration, DNS and Routing):

Figure B

The DNS configuration of the host is set here

The DNS configuration of the host is set here.
Once the DNS is set, the “name” of the ESXi host can match that which is set in the DNS server for the host, which is always a good thing for consistency. If the iSCSI software initiator has already been added, it would be worth changing its name to remove localhost from the IQN name. For an ESXi host system in use, I’d recommend doing this in maintenance mode. Secondly, ensure that no iSCSI hosts are locked in to using the previous IQN name. Consider any other configuration or requirement by IQN name that may be going on in your storage configuration as well. Once that is cleared, you can change the name of the IQN for the ESXi host right in the interface by selecting the configure button, as shown in Figure C.

Figure C

The name of the IQN can easily changed, but use maintenance mode on the host.

The name of the IQN can easily changed, but use maintenance mode on the host.

Changing the IQN is straightforward; ensuring the host is set up correctly before you start using it is the hard part. I’m guilty of that too from time to time.

What tricks have you employed to make your IQN names be more clear? Share your tips below.

About

Rick Vanover is a software strategy specialist for Veeam Software, based in Columbus, Ohio. Rick has years of IT experience and focuses on virtualization, Windows-based server administration, and system hardware.

2 comments
Cincinnerdi
Cincinnerdi

Thx, Rick. I would concur. Also, helpful to name it like esx1, then use that as prefix for datastores, too. So a datastore names can be like "esx3DS2" making it very simple to know exactly where a given VM is located. Scott Ledyard

Editor's Picks