Host Configuration
Checking and Installing the iSCSI Software Package
Checking the Software Package
The iSCSI software package is installed by default when you install Solaris. You can run the following command to check whether the software package is installed.
bash-3.2# pkginfo |grep iscsi
system SUNWiscsir Sun iSCSI Device Driver (root)
system SUNWiscsitgtr Sun iSCSI Target (Root)
system SUNWiscsitgtu Sun iSCSI Target (Usr)
system SUNWiscsiu Sun iSCSI Management Utilities (usr)
The command output indicates that the iSCSI software package has been installed.
Installing the Software Package
If the iSCSI software package is not installed, perform the following operations to install it:
- Insert the OS installation CD-ROM into the host's CD-ROM drive.
- Run the following command on the host to install the software.
The following uses SUNWiscsir as an example.
bash-3.2# pkgadd -d /cdrom/Solaris_10/Product SUNWiscsir Processing package instance <SUNWiscsir> from </cdrom/Solaris_10/Product> Sun iSCSI Device Driver (root)(sparc) 11.10.0,REV=2005.01.04.14.31 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. Using </> as the package base directory. ## Processing package information. ## Processing system information. 15 package pathnames are already properly installed. ## Verifying package dependencies. ## Verifying disk space requirements. ## Checking for conflicts with packages already installed. ## Checking for setuid/setgid programs. This package contains scripts which will be executed with super-user permission during the process of installing this package. Do you want to continue with the installation of <SUNWiscsir> [y,n,?] y Installing Sun iSCSI Device Driver (root) as <SUNWiscsir> ## Executing preinstall script. ## Installing part 1 of 1. /kernel/drv/iser.conf /kernel/drv/sparcv9/iscsi /kernel/drv/sparcv9/iser /kernel/misc/sparcv9/idm /lib/svc/method/iscsi-initiator /lib/svc/method/iscsid [ verifying class <none> ] Modifying /etc/ima.conf [ verifying class <build> ] [ verifying class <iscsiconf> ] [ verifying class <manifest> ] [ verifying class <rbac> ] ## Executing postinstall script. System configuration files modified but iser driver not loaded or attached. Installation of <SUNWiscsir> was successful. bash-3.2#
Configuring Service IP Addresses
Solaris 10 and Earlier
To configure IP addresses on Solaris 10 and earlier, perform the following steps:
- Determine the network port that connects to the storage system.
Generally, a Solaris server has four network ports of the same model, which are marked by 0, 1, 2, and 3. When the system is installed, one network port is selected and a management IP address is configured for it.
bash-3.2# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.23.61 netmask ffff0000 broadcast 192.168.255.255 ether 0:14:4f:a3:83:a6 bash-3.2#
In the preceding example, 192.168.23.61 is configured for network port 0. The network port type is bge, and the name of the network port is bge0.
According to the preceding information, the names of the other three network ports are bge1, bge2, and bge3. This example configures an IP address for bge3.
Alternatively, you can run the following command to query the names of all network ports:
bash-3.2# dladm show-dev bge0 link: up speed: 100 Mbps duplex: full bge1 link: unknown speed: 0 Mbps duplex: unknown bge2 link: unknown speed: 0 Mbps duplex: unknown bge3 link: down speed: 0 Mbps duplex: unknown bash-3.2#
- Create a configuration file for the selected network port.
Name the configuration file hostname.xx (xx represents the network port name and is bge3 in this example). The file is stored in the /etc directory. Add the network port name to the file.
For example:
bash-3.2# cat /etc/hostname.bge3 serv01 bash-3.2#
- Modify the hosts file.
Add the network port name included in the preceding configuration file to the hosts file, and configure an IP address for the network port.
For example:
bash-3.2# cat /etc/hosts # # Internet host table # ::1 localhost 127.0.0.1 localhost 192.168.23.61 osssvr-1 loghost 192.168.56.200 serv01 bash-3.2#
In the preceding example, the IP address is set to 192.168.56.200.
- Run the following commands on the host to restart network services for the configuration to take effect.
bash-3.2# svcadm restart network/physical bash-3.2# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.23.61 netmask ffff0000 broadcast 192.168.255.255 ether 0:14:4f:a3:83:a6 bge3: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3 inet 192.168.56.200 netmask ff000000 broadcast 192.255.255.255 ether 0:14:4f:a3:83:a9 bash-3.2#
After IP addresses are configured for hosts and storage systems, run the ping command to check whether the hosts can communicate with the storage systems. If the communication fails, check whether physical connections and IP addresses are correct.
Solaris 11 and Later
To configure IP addresses on Solaris 11 and later, perform the following steps:
- Change the network management mode from automatic to manual.
Before you can use the dladm and ipadm commands to configure the network, you must set DefaultFixed NCP to the Active (enable) state. Run the netadm enable -p ncp DefaultFixed command. The following is an example:
root@solaris:~# netadm enable -p ncp DefaultFixed ncp 'DefaultFixed' is already enabled
You can run the following command to check DefaultFixed NCP:
bash-3.2# netadm list netadm: DefaultFixed NCP is enabled; automatic network management is not available. 'netadm list' is only supported when automatic network management is active.
- Run the dladm show-phys command to determine the name of the network port for which you want to configure an IP address.
For example:
bash-3.2# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE net2 Ethernet up 10000 full hxge0 net3 Ethernet up 10000 full hxge1 net4 Ethernet up 10 full usbecm0 net0 Ethernet up 1000 full igb0 net1 Ethernet up 1000 full igb1 net9 Ethernet unknown 0 half e1000g0 net5 Ethernet unknown 0 half e1000g1 net10 Ethernet unknown 0 half e1000g2 net11 Ethernet unknown 0 half e1000g3
- Configure an IP address for the network port.
The following uses the net1 port as an example:
bash-3.2# ipadm create-ip net1 bash-3.2# ipadm create-addr -T static -a 192.168.5.5/24 net1/v4
In this example, 192.168.5.5 is configured for the net1 port. You can run the following command to verify the configuration.
bash-3.2# ipadm show-addr
- (Optional) Configure a gateway.
To configure the gateway, run the following command:
bash-3.2# route -p add default 192.168.0.1 add net default: gateway 192.168.0.1 add persistent net default: gateway 192.168.0.1 bash-3.2#
In this example, 192.168.0.1 is set as the default gateway. You can run the following command to query the current gateway:
root@solaris:~# route -p show persistent: route add default 8.44.128.1 root@solaris:~#
- Verify the network configuration.
After IP addresses are configured for hosts and storage systems, run the ping command to check whether the hosts can communicate with the storage systems. If the communication fails, check whether physical connections and IP addresses are correct.
(Optional) Configuring Initiators
After the network connectivity is normal between the host and storage system, perform the following steps to configure initiators:
- Query initiator information on the host.
bash-3.2# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:002128a400ea.5b150d29 Initiator node alias: solaris Login Parameters (Default/Configured): Header Digest: NONE/- Data Digest: NONE/- Max Connections: 65535/- Authentication Type: NONE RADIUS Server: NONE RADIUS Access: disabled Tunable Parameters (Default/Configured): Session Login Response Time: 60/- Maximum Connection Retry Time: 180/- Login Retry Time Interval: 60/- Configured Sessions: 1 bash-3.2#
In the command output, the initiator name is iqn.1986-03.com.sun:01:002128a400ea.5b150d29.
- If you need to change the initiator name, run the following command:
bash-3.2# iscsiadm modify initiator-node -N iqn.2004-10.com.SUN.host-1 bash-3.2# iscsiadm list initiator-node Initiator node name: iqn.2004-10.com.sun.host-1 Initiator node alias: solaris Login Parameters (Default/Configured): Header Digest: NONE/- Data Digest: NONE/- Max Connections: 65535/- Authentication Type: NONE RADIUS Server: NONE RADIUS Access: disabled Tunable Parameters (Default/Configured): Session Login Response Time: 60/- Maximum Connection Retry Time: 180/- Login Retry Time Interval: 60/- Configured Sessions: 1 bash-3.2#
In this example, the initiator name is changed to iqn.2004-10.com.SUN.host-1.
An iSCSI initiator name must comply with the following format:
iqn.domaindate.reverse.domain.name:optional name
An iSCSI initiator name contains only:
- Special characters: hyphens (-), periods (.), and colons (:)
- Lower-case letters
- Digits
An iSCSI initiator name can contain a maximum of 223 characters.
- Add or modify the initiator alias.
In Solaris, the initiator alias is empty by default. You must add an alias to establish the iSCSI connection between the host and the storage system.
In the following example, the initiator alias is changed to china.
bash-3.2# iscsiadm modify initiator-node -A china bash-3.2# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:002128a400ea.5b150d29 Initiator node alias: china Login Parameters (Default/Configured): Header Digest: NONE/- Data Digest: NONE/- Max Connections: 65535/- Authentication Type: NONE RADIUS Server: NONE RADIUS Access: disabled Tunable Parameters (Default/Configured): Session Login Response Time: 60/- Maximum Connection Retry Time: 180/- Login Retry Time Interval: 60/- Configured Sessions: 1 bash-3.2#
Configuring Services on Hosts
If the service IP addresses of the host and storage system can ping each other successfully, you can perform other necessary configurations on the host to establish a connection between them.
- Start the iSCSI service on the host.
Run the following command to check whether the iSCSI service has been started:
bash-3.2# svcs|grep iscsi online 16:58:10 svc:/network/iscsi/initiator:default bash-3.2#
The command output indicates that the iSCSI service has been started. If it is not started, run the svcadm enable svc:/network/iscsi/initiator:default command.
- Select a search mode.
Solaris supports both dynamic and static search modes.
- Dynamic device search
There are two dynamic search methods: SendTargets and Internet Storage Name Service (iSNS).
- SendTargets
When numerous targets (such as iSCSI-to-FC network bridges) are detected on iSCSI nodes, this mode can provide the combinations of IP addresses and port numbers of those nodes, and allow the iSCSI initiator to discover devices with the SendTargets function.
- iSNS
iSNS enables the iSCSI initiator to discover accessible targets with minimum configuration. It also notifies the iSCSI initiator of status changes on a storage node. The default port number of the iSNS server is 3205.
- SendTargets
- Static device search
If a small number of targets are detected on iSCSI nodes or targets that the initiator attempts to access are restricted, you can configure target-name in static mode based on the naming conventions of static target addresses.
In this example, the SendTargets mode is used. The configuration method is as follows:
bash-3.2# iscsiadm modify discovery --sendtargets enable bash-3.2# bash-3.2# iscsiadm list discovery Discovery: Static: disabled Send Targets: enabled iSNS: disabled bash-3.2#
The command output indicates that SendTargets has been enabled.
- Dynamic device search
- Add a detected target. In this example, the service IP address of the storage system is 192.168.5.6. Run the following commands on the host.
bash-3.2# iscsiadm add discovery-address 192.168.5.6:3260 bash-3.2# iscsiadm list discovery-address Discovery Address: 192.168.5.6:3260 bash-3.2#
- Create an iSCSI link for the local system.
bash-3.2# devfsadm -i iscsi
- If Challenge Handshake Authentication Protocol (CHAP) authentication is not needed between the host and storage system, no further action is required. To configure CHAP authentication, go to the next step.
- Configure CHAP authentication information on the host.
Run the iscsiadm command on the host to specify relevant parameters. The command format is as follows:
bash-3.2# iscsiadm modify initiator-node help iscsiadm: at least one option required iscsiadm modify initiator-node <OPTIONS> OPTIONS: -N, --node-name <initiator node name> -A, --node-alias <initiator node alias> -h, --headerdigest <none|CRC32> -d, --datadigest <none|CRC32> -C, --CHAP-secret (exclusive) -a, --authentication <CHAP|none> -R, --radius-access <enable|disable> -r, --radius-server <<IP address>[:port]> -P, --radius-shared-secret (exclusive) -H, --CHAP-name <CHAP name> -c, --configured-sessions <<# sessions>|<IP Address>[,<IP Address>]*> -T, --tunable-param <tunable-prop=value> For more information, please see iscsiadm(1M) bash-3.2#
The following is an example:
bash-3.2# iscsiadm modify initiator-node -a CHAP bash-3.2# iscsiadm modify initiator-node -H root bash-3.2# iscsiadm modify initiator-node -C Enter secret: Re-enter secret: bash-3.2# bash-3.2# iscsiadm list initiator-node Initiator node name: iqn.2004-10.com.sun.host-1 Initiator node alias: china Login Parameters (Default/Configured): Header Digest: NONE/- Data Digest: NONE/- Authentication Type: CHAP CHAP Name: root RADIUS Server: NONE RADIUS access: unknown Tunable Parameters (Default/Configured): Session Login Response Time: 60/- Maximum Connection Retry Time: 180/- Login Retry Time Interval: 60/- Configured Sessions: 1 bash-3.2#