As he said it would be tremendously useful if you need to physically replace the server and don’t want to modify all your storage infrastructure, it’s easier to just modify the iqn of the new server and set it to the old name.
The task is as easier as the one described in last post. Using esxcli command with the iscsi namespace you can change the name and the alias of the adapter.
As a precaution first retrieve the current iqn to check that it’s the correct server.
To change the name you have to provide the adapter and the new name.
Hope you find this useful, any comments and suggestions are welcome as always.
Back in 2010 I wrote a post about how to get the iSCSI iqn of an ESXi 4.x server using vSphere CLI from the vMA or any other system with the vCLI installed on it.
The method described in that article is still valid for ESXi 5.0 since the old vicfg and esxcfg commands are still available, however with 5.0 version you can get a similar result using the new esxcli namespaces, following is how to do it.
First task is to get a list of the iSCSI HBAs in order to know the name of the software iSCSI initiator.
Next we get the info of the adapter.
Look at the Name field to get the iqn and we are done.