Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:configure_a_system_as_either_an_iscsi_target_or_initiator_that_persistently_mounts_an_iscsi_target [2018/04/04 23:20] billdozor [Configure Initiator and iscsid] |
linux_wiki:configure_a_system_as_either_an_iscsi_target_or_initiator_that_persistently_mounts_an_iscsi_target [2018/05/30 21:47] billdozor [Firewall and Start Service] |
||
---|---|---|---|
Line 12: | Line 12: | ||
* server1.example.com (192.168.1.150) -> Client/ | * server1.example.com (192.168.1.150) -> Client/ | ||
* server2.example.com (192.168.1.151) -> Server/ | * server2.example.com (192.168.1.151) -> Server/ | ||
- | * **Add Disk**: Add a secondary disk to the Server/ | + | * **Add Disk**: Add a secondary disk to the Server/ |
---- | ---- | ||
+ | |||
+ | ====== Help ====== | ||
+ | |||
+ | Finding help in this section. | ||
+ | * iSCSI target (server)< | ||
+ | * iSCSI initiator (client)< | ||
+ | |||
+ | ---- | ||
+ | |||
====== iSCSI Targets (Storage Server) ====== | ====== iSCSI Targets (Storage Server) ====== | ||
Line 27: | Line 36: | ||
pvcreate /dev/sdb1 | pvcreate /dev/sdb1 | ||
vgcreate vgsan /dev/sdb1 | vgcreate vgsan /dev/sdb1 | ||
- | lvcreate --size 500M --name lvstor01 vgsan | + | lvcreate --extents 100%PVS |
</ | </ | ||
Line 67: | Line 76: | ||
\\ | \\ | ||
- | Create a block storage object within the targetcli interactive prompt | + | **Backing Storage: |
<code bash> | <code bash> | ||
- | /> backstores/ | + | /> backstores/ |
</ | </ | ||
* backstores/ | * backstores/ | ||
Line 76: | Line 85: | ||
\\ | \\ | ||
- | Create an iSCSI Target IQN (Iscsi Qualified Name) | + | **iSCSI Target**: |
<code bash> | <code bash> | ||
- | />iscsi/ create iqn.2016-08.com.example.server2: | + | /> iscsi/ create |
</ | </ | ||
* iscsi/ -> In the iscsi path | * iscsi/ -> In the iscsi path | ||
- | * create iqn.2016-08.com.example.server2: | + | * create iqn.2018-05.com.example.server2: |
* An IQN is how you refer to the target disk | * An IQN is how you refer to the target disk | ||
* All IQNs must start with " | * All IQNs must start with " | ||
Line 91: | Line 100: | ||
Change into the newly created IQN's TPG (Target Portal Group) and view the contents | Change into the newly created IQN's TPG (Target Portal Group) and view the contents | ||
<code bash> | <code bash> | ||
- | cd iqn.2016-08.com.example.server2: | + | /> cd iscsi/iqn.2018-05.com.example.server2: |
- | ls | + | / |
</ | </ | ||
* Objects listed: | * Objects listed: | ||
Line 98: | Line 107: | ||
* luns (logical unit number or the exported resource) | * luns (logical unit number or the exported resource) | ||
* portals (IP addresses: | * portals (IP addresses: | ||
+ | * **Note:** In some earlier versions (RHEL 7.0-7.1), a portal is NOT automatically created. This may need to be created manually. | ||
\\ | \\ | ||
- | Create | + | **Create portal: RHEL 7.0 - 7.1 only** |
<code bash> | <code bash> | ||
- | />luns/ create / | + | /iscsi/ |
+ | </ | ||
+ | |||
+ | \\ | ||
+ | **LUN to Storage Map:** Create a LUN within the target portal group | ||
+ | <code bash> | ||
+ | / | ||
</ | </ | ||
* luns/ -> In the luns path | * luns/ -> In the luns path | ||
Line 108: | Line 124: | ||
\\ | \\ | ||
- | Create an ACL for a client to be able to connect to the IQN in the future | + | **Client ACL: |
<code bash> | <code bash> | ||
- | />acls/ create iqn.2016-08.com.example: | + | /iscsi/ |
</ | </ | ||
* acls/ -> In the acls path | * acls/ -> In the acls path | ||
- | * create iqn.2016-08.com.example: | + | * create iqn.2018-05.com.example: |
* This is a combination of a new IQN (following a similar naming convention) and an identifier of your choosing. Together, this makes up the **client iscsi initiator name** that will be used. | * This is a combination of a new IQN (following a similar naming convention) and an identifier of your choosing. Together, this makes up the **client iscsi initiator name** that will be used. | ||
- | * iqn.2016-08.com.example -> IQN | + | * iqn.2018-05.com.example -> IQN |
* :server1 -> an identifier of your choosing | * :server1 -> an identifier of your choosing | ||
* **Alternatively: | * **Alternatively: | ||
Line 122: | Line 138: | ||
**OPTIONAL**: | **OPTIONAL**: | ||
<code bash> | <code bash> | ||
- | />cd acls/iqn.2016-08.com.example: | + | /iscsi/ |
- | />set auth userid=myuser | + | /iscsi/ |
- | />set auth password=mypassword | + | |
</ | </ | ||
\\ | \\ | ||
Save and exit the targetcli utility | Save and exit the targetcli utility | ||
- | <code bash> | + | <code bash>/ |
- | /> | + | /> saveconfig |
- | />exit | + | /> exit |
</ | </ | ||
Line 146: | Line 161: | ||
firewall-cmd --reload | firewall-cmd --reload | ||
</ | </ | ||
- | * iscsi-target service available as of RHEL 7.2 | + | * iscsi-target service available as of **RHEL 7.2** |
\\ | \\ | ||
Line 173: | Line 188: | ||
vim / | vim / | ||
- | InitiatorName=iqn.2016-08.com.example: | + | InitiatorName=iqn.2018-05.com.example: |
</ | </ | ||
* Identifying client information needed to mount the disk | * Identifying client information needed to mount the disk | ||
Line 197: | Line 212: | ||
===== Login to iSCSI Portal ===== | ===== Login to iSCSI Portal ===== | ||
+ | **Note**: See ' | ||
+ | |||
+ | \\ | ||
Use the iscsiadm command to discover IQN Information | Use the iscsiadm command to discover IQN Information | ||
<code bash> | <code bash> | ||
Line 206: | Line 224: | ||
\\ | \\ | ||
- | Login to the Target IQN | + | Login to the Target IQN (found during discovery) |
<code bash> | <code bash> | ||
- | iscsiadm --mode node --target iqn.2016-08.com.example.server2: | + | iscsiadm --mode node --target iqn.2018-05.com.example.server2: |
</ | </ | ||
* Default port is 3260 if not specified | * Default port is 3260 if not specified | ||
- | ===== View iSCSI Disk Information | + | ===== Configure |
View iSCSI Disk | View iSCSI Disk |