<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>install targetcli centos7 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/install-targetcli-centos7/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Thu, 03 May 2018 13:02:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to Configure Storage Server with iSCSI in Redhat and Centos 7</title>
		<link>https://www.osradar.com/how-to-configure-storage-server-with-iscsi-in-redhat-and-centos-7/</link>
					<comments>https://www.osradar.com/how-to-configure-storage-server-with-iscsi-in-redhat-and-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Wed, 25 Apr 2018 22:11:01 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[install Iscsi centos7]]></category>
		<category><![CDATA[install targetcli centos7]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=2753</guid>

					<description><![CDATA[<p>Let me start with wikipedia definition of  ISCSi . In computing, iSCSI is an acronym for Internet Small Computer Systems Interface, an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. It provides block-level access to storage devices by carrying SCSI commands over a TCP/IP network. iSCSI is used to facilitate data transfers over intranets and to manage storage over long distances. It can be used to transmit data [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-storage-server-with-iscsi-in-redhat-and-centos-7/">How to Configure Storage Server with iSCSI in Redhat and Centos 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Let me start with wikipedia definition of  ISCSi . In computing, <b>iSCSI</b> is an acronym for <b>Internet Small Computer Systems Interface</b>, an Internet Protocol (IP)-based storage networking standard for linking data storage facilities. It provides block-level access to storage devices by carrying SCSI commands over a TCP/IP network. iSCSI is used to facilitate data transfers over intranets and to manage storage over long distances. It can be used to transmit data over local area networks (LANs), wide area networks (WANs), or the Internet and can enable location-independent data storage and retrieval.</p>
<p><strong>How to Configure Storage Server with iSCSI in Redhat and Centos 7</strong></p>
<p><strong>My System : </strong></p>
<p><img loading="lazy" class="alignnone size-full wp-image-2754" src="https://www.osradar.com/wp-content/uploads/2018/04/hostb.png" alt="" width="1099" height="257" srcset="https://www.osradar.com/wp-content/uploads/2018/04/hostb.png 1099w, https://www.osradar.com/wp-content/uploads/2018/04/hostb-300x70.png 300w, https://www.osradar.com/wp-content/uploads/2018/04/hostb-768x180.png 768w, https://www.osradar.com/wp-content/uploads/2018/04/hostb-1024x239.png 1024w, https://www.osradar.com/wp-content/uploads/2018/04/hostb-696x163.png 696w, https://www.osradar.com/wp-content/uploads/2018/04/hostb-1068x250.png 1068w" sizes="(max-width: 1099px) 100vw, 1099px" /></p>
<p><strong>Available  disks </strong></p>
<p><img loading="lazy" class="alignnone size-full wp-image-2755" src="https://www.osradar.com/wp-content/uploads/2018/04/fdisk.png" alt="" width="1121" height="414" srcset="https://www.osradar.com/wp-content/uploads/2018/04/fdisk.png 1121w, https://www.osradar.com/wp-content/uploads/2018/04/fdisk-300x111.png 300w, https://www.osradar.com/wp-content/uploads/2018/04/fdisk-768x284.png 768w, https://www.osradar.com/wp-content/uploads/2018/04/fdisk-1024x378.png 1024w, https://www.osradar.com/wp-content/uploads/2018/04/fdisk-696x257.png 696w, https://www.osradar.com/wp-content/uploads/2018/04/fdisk-1068x394.png 1068w" sizes="(max-width: 1121px) 100vw, 1121px" /></p>
<p>&nbsp;</p>
<p>We will use /dev/sdb as iscsi disk, and  before that we need to install some needed package to make this possible:</p>
<pre>#yum  install   targetcli

===========================================================================================================
 Package Arch Version Repository Size
===========================================================================================================
Installing:
 targetcli noarch 2.1.fb46-1.el7 base 64 k
Installing for dependencies:
 libnl x86_64 1.1.4-3.el7 base 128 k
 pyparsing noarch 1.5.6-9.el7 base 94 k
 python-configshell noarch 1:1.1.fb23-3.el7 base 67 k
 python-ethtool x86_64 0.8-5.el7 base 33 k
 python-kmod x86_64 0.9-4.el7 base 57 k
 python-rtslib noarch 2.1.fb63-2.el7 base 97 k
 python-six noarch 1.9.0-2.el7 base 29 k
 python-urwid x86_64 1.1.1-3.el7 base 654 k</pre>
<p>installing targetcli is generating python-rtslib package, which provides the /usr/lib/systemd/system/target.service file.</p>
<p><strong>Lets Enable and start the server</strong></p>
<pre># systemctl enable target
Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.

# systemctl start target</pre>
<p><strong>Start The Targetcli  Console</strong></p>
<pre># targetcli 
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.</pre>
<pre>/backstores/block&gt; create disk1 /dev/sdb
Created block storage object disk1 using /dev/sdb.
/backstores/block&gt; /backstores/fileio</pre>
<h6>####### Or  disk based on created file</h6>
<pre>/backstores/fileio&gt; create disk2 /root/disk2.img 3G
Created fileio disk2 with size 3221225472
/backstores/fileio&gt;</pre>
<p>you can always  use command &#8221; ls &#8221; to see the created Contents.</p>
<pre>/&gt; ls 
o- / ................................................................................................................ [...]
 o- backstores ..................................................................................................... [...]
 | o- block ......................................................................................... [Storage Objects: 1]
 | | o- disk1 ................................................................. [/dev/sdb (5.0GiB) write-thru deactivated]
 | | o- alua .......................................................................................... [ALUA Groups: 1]
 | | o- default_tg_pt_gp .............................................................. [ALUA state: Active/optimized]
 | o- fileio ........................................................................................ [Storage Objects: 1]
 | | o- disk2 .......................................................... [/root/disk2.img (3.0GiB) write-back deactivated]
 | | o- alua .......................................................................................... [ALUA Groups: 1]
 | | o- default_tg_pt_gp .............................................................. [ALUA state: Active/optimized]
 | o- pscsi ......................................................................................... [Storage Objects: 0]
 | o- ramdisk ....................................................................................... [Storage Objects: 0]
 o- iscsi ................................................................................................... [Targets: 0]
 o- loopback ................................................................................................ [Targets: 0]
/&gt;</pre>
<p>&nbsp;</p>
<p><img loading="lazy" class="alignnone size-full wp-image-2761" src="https://www.osradar.com/wp-content/uploads/2018/04/ls2.png" alt="" width="985" height="260" srcset="https://www.osradar.com/wp-content/uploads/2018/04/ls2.png 985w, https://www.osradar.com/wp-content/uploads/2018/04/ls2-300x79.png 300w, https://www.osradar.com/wp-content/uploads/2018/04/ls2-768x203.png 768w, https://www.osradar.com/wp-content/uploads/2018/04/ls2-696x184.png 696w" sizes="(max-width: 985px) 100vw, 985px" /></p>
<p>&nbsp;</p>
<p><strong>Create and Configure ISCSI Qualified  name (IQN)</strong></p>
<pre>/iscsi&gt; create iqn.2018-04.org.osradar.com.centos7.disk1
Created target iqn.2018-04.org.osradar.com.centos7.disk1.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/iscsi&gt;</pre>
<p><strong>Configure ACL</strong></p>
<p>its Access Control Lists (ACLs) to  restrict access to LUNs from remote systems  (it&#8217;s the IQN of an initiator you permit to connect)</p>
<p>you can create it like this :</p>
<pre>/iscsi/iqn.20...sk1/tpg1/acls&gt; create iqn.2018-04.org.osradar.com.centos7.share
Created Node ACL for iqn.2018-04.org.osradar.com.centos7.share
/iscsi/iqn.20...sk1/tpg1/acls&gt;</pre>
<p><strong>Target Portal Group (TPG)</strong></p>
<p>The default portal of 0.0.0.0:3260 allows the iSCSI server to listen on all IPv4 addresses on port 3260. u can also specify the IP address if you like</p>
<pre>/iscsi/iqn.20.../tpg1/portals&gt; ls
o- portals ............................................................................................................ [Portals: 1]
 o- 0.0.0.0:3260 ............................................................................................................. [OK]
/iscsi/iqn.20.../tpg1/portals&gt;</pre>
<p><strong>Adding ISCSI disken to Target Portal Group</strong></p>
<pre>/iscsi/iqn.20...sk1/tpg1/luns&gt; create /backstores/block/disk1 
Created LUN 0.
Created LUN 0-&gt;0 mapping in node ACL iqn.2018-04.org.osradar.com.centos7.share
/iscsi/iqn.20...sk1/tpg1/luns&gt; create /backstores/fileio/disk2 
Created LUN 1.
Created LUN 1-&gt;1 mapping in node ACL iqn.2018-04.org.osradar.com.centos7.share
/iscsi/iqn.20...sk1/tpg1/luns&gt;</pre>
<p>before to save the configuration Please that all settings are there with &#8220;ls&#8221; command:</p>
<p><img loading="lazy" class="alignnone size-full wp-image-2769" src="https://www.osradar.com/wp-content/uploads/2018/04/totaal.png" alt="" width="976" height="420" srcset="https://www.osradar.com/wp-content/uploads/2018/04/totaal.png 976w, https://www.osradar.com/wp-content/uploads/2018/04/totaal-300x129.png 300w, https://www.osradar.com/wp-content/uploads/2018/04/totaal-768x330.png 768w, https://www.osradar.com/wp-content/uploads/2018/04/totaal-696x300.png 696w" sizes="(max-width: 976px) 100vw, 976px" /></p>
<p>Please before to  exit Save The Configuration with command  saveconfig :</p>
<pre>/&gt; saveconfig
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
/&gt; exit</pre>
<p>Check if The port listening :</p>
<pre>[root@osradar.com ~]# ss -pant | grep 3260
LISTEN 0 256 *:3260 *:*</pre>
<p>Or</p>
<pre>[root@osradar.com ~]# netstat -plunt | grep 3260
tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN - 

</pre>
<p><strong>Firewall Configuration:</strong></p>
<p>Please  allow  the service or Ip on firewallcmd</p>
<pre>[root@osradar ~]# firewall-cmd --permanent --add-port=3260/tcp 
success
[root@osradar ~]# firewall-cmd --reload 
success</pre>
<p>Now you are ready to share your ISCSI with other hosts using the ACL.</p>
<h2><a href="https://www.osradar.com/install-and-configure-iscsi-initiator/">How to install and configure the  ISCSI Initiator </a></h2>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-storage-server-with-iscsi-in-redhat-and-centos-7/">How to Configure Storage Server with iSCSI in Redhat and Centos 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-configure-storage-server-with-iscsi-in-redhat-and-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
