<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FranGarcia.me (Posts about lab)</title><link>https://www.frangarcia.me/</link><description></description><atom:link href="https://www.frangarcia.me/categories/lab.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sat, 01 Jul 2023 22:22:34 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Configuring an iscsi volume for RHV usage</title><link>https://www.frangarcia.me/posts/configuring-an-iscsi-volume-for-rhv-usage/</link><dc:creator>Fran Garcia</dc:creator><description>&lt;p&gt;This is a cheatsheet to quickly configure storage and export it as an iSCSI
volume using RHEL7 targetcli and have it configured under RHV. This is by no means
a production configuration as your RHEL7 system might become a single point of
failure, but it convers nicely building a home lab or test environment.&lt;/p&gt;
&lt;p&gt;Just for clarity, a quick reminder of iSCSI concepts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;iSCSI target&lt;/strong&gt; provides some storage (here called server),&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;iSCSI initiator&lt;/strong&gt; uses this available storage (here called client).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;h3&gt;Configure server's storage&lt;/h3&gt;
&lt;p&gt;You can configure several types of backends, and for me the most versatile is
using LVM's Logical Volumes. You'll need to create your volumes in advance, for
example:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;lvcreate yourVG -n yourLV1 -L 50G
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Install software&lt;/h3&gt;
&lt;p&gt;Install the targetcli RPM:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;yum install -y targetcli
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Enable the &lt;code&gt;target&lt;/code&gt; daemon (NOT &lt;code&gt;targetd&lt;/code&gt;)&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;systemctl enable --now target.service
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Gather RHV configuration&lt;/h3&gt;
&lt;p&gt;You'll need to gather the following information from RHV:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IQN (iSCSI identifier) &lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Configure and enable iSCSI&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;targetcli&lt;/code&gt; provides a very simple way to create iscsi targets once you understand
how it works. Namely what needs to be done is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Add your backend devices&lt;/strong&gt;. This is where you add into targetcli's control the 
  LVM devices created in previous steps&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create an IQN target&lt;/strong&gt;. This is a collection of luns shared to the same system(s)
  under the same group. It is used later to apply ACLs so only certain hosts can use
  certain LUNs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add LUNs into your IQN target&lt;/strong&gt;. After creating your IQN target, you need to
  add the backstore devices so they're shared via iSCSI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add ACLs into your IQN target&lt;/strong&gt;. Unless configured otherwise, LUNs are not
  visible to systems unless they're added into the right ACL.  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a dump on how all this can be accomplished with targetcli:&lt;/p&gt;
&lt;h2&gt;Add storage into RHV&lt;/h2&gt;
&lt;p&gt;foo&lt;/p&gt;</description><category>iscsi</category><category>lab</category><category>rhev</category><category>rhv</category><category>targetcli</category><guid>https://www.frangarcia.me/posts/configuring-an-iscsi-volume-for-rhv-usage/</guid><pubDate>Tue, 29 Aug 2017 06:23:07 GMT</pubDate></item></channel></rss>