2013-08-18 22:15:35 +00:00
|
|
|
From be8702e609fdfd417547f758cb88956066b63023 Mon Sep 17 00:00:00 2001
|
2013-01-22 21:44:13 +00:00
|
|
|
From: Chris Leech <cleech@redhat.com>
|
|
|
|
Date: Mon, 19 Nov 2012 16:38:45 -0800
|
|
|
|
Subject: use var for config
|
|
|
|
|
|
|
|
---
|
|
|
|
README | 33 ++++++++++++++++-----------------
|
|
|
|
doc/iscsiadm.8 | 8 ++++----
|
|
|
|
usr/idbm.c | 6 +++---
|
2013-08-18 22:15:35 +00:00
|
|
|
usr/idbm.h | 13 +++++++------
|
2013-01-22 21:44:13 +00:00
|
|
|
usr/iface.h | 4 +++-
|
2013-08-18 22:15:35 +00:00
|
|
|
5 files changed, 33 insertions(+), 31 deletions(-)
|
2013-01-22 21:44:13 +00:00
|
|
|
|
|
|
|
diff --git a/README b/README
|
2013-08-18 22:15:35 +00:00
|
|
|
index 90e2074..9cc62ca 100644
|
2013-01-22 21:44:13 +00:00
|
|
|
--- a/README
|
|
|
|
+++ b/README
|
|
|
|
@@ -156,8 +156,7 @@ Usage: iscsid [OPTION]
|
|
|
|
|
|
|
|
Open-iSCSI persistent configuration is stored in a number of
|
|
|
|
directories under a configuration root directory, using a flat-file
|
|
|
|
-format. This configuration root directory is /etc/iscsi by default,
|
|
|
|
-but may also commonly be in /var/lib/iscsi.
|
|
|
|
+format. This configuration root directory is /var/lib/iscsi by default.
|
|
|
|
|
|
|
|
Configuration is contained in directories for:
|
|
|
|
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -467,7 +466,7 @@ a scsi_host per HBA port).
|
2008-02-06 21:02:29 +00:00
|
|
|
To manage both types of initiator stacks, iscsiadm uses the interface (iface)
|
|
|
|
structure. For each HBA port or for software iscsi for each network
|
|
|
|
device (ethX) or NIC, that you wish to bind sessions to you must create
|
|
|
|
-a iface config /etc/iscsi/ifaces.
|
|
|
|
+a iface config /var/lib/iscsi/ifaces.
|
|
|
|
|
2011-10-23 08:29:01 +00:00
|
|
|
Prep:
|
2010-05-06 21:41:12 +00:00
|
|
|
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -501,29 +500,29 @@ Running:
|
2010-05-06 21:41:12 +00:00
|
|
|
iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
|
|
|
|
iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
|
2008-02-06 21:02:29 +00:00
|
|
|
|
|
|
|
-Will report iface configurations that are setup in /etc/iscsi/ifaces.
|
|
|
|
+Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
|
|
|
|
The format is:
|
|
|
|
|
2010-05-06 21:41:12 +00:00
|
|
|
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
|
2008-02-06 21:02:29 +00:00
|
|
|
|
|
|
|
For software iscsi, you can create the iface configs by hand, but it is
|
|
|
|
reccomended that you use iscsiadm's iface mode. There is a iface.example in
|
|
|
|
-/etc/iscsi/ifaces which can be used as a template for the daring.
|
|
|
|
+/var/lib/iscsi/ifaces which can be used as a template for the daring.
|
|
|
|
|
|
|
|
For each network object you wish to bind a session to you must create
|
|
|
|
-a seperate iface config in /etc/iscsi/ifaces and each iface config file
|
|
|
|
+a seperate iface config in /var/lib/iscsi/ifaces and each iface config file
|
|
|
|
must have a unique name which is less than or equal to 64 characters.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with
|
|
|
|
MAC address 00:C0:DD:08:63:E7 and you wanted to do software iscsi over
|
|
|
|
-TCP/IP. Then in /etc/iscsi/ifaces/iface0 you would enter:
|
|
|
|
+TCP/IP. Then in /var/lib/iscsi/ifaces/iface0 you would enter:
|
|
|
|
|
|
|
|
iface.transport_name = tcp
|
|
|
|
iface.hwaddress = 00:0F:1F:92:6B:BF
|
|
|
|
|
|
|
|
-and in /etc/iscsi/ifaces/iface1 you would enter:
|
|
|
|
+and in /var/lib/iscsi/ifaces/iface1 you would enter:
|
|
|
|
|
|
|
|
iface.transport_name = tcp
|
|
|
|
iface.hwaddress = 00:C0:DD:08:63:E7
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -573,7 +572,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
|
2011-10-23 08:29:01 +00:00
|
|
|
qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
|
2010-05-06 21:41:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
-Will report iface configurations that are setup in /etc/iscsi/ifaces.
|
|
|
|
+Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
|
|
|
|
The format is:
|
2008-02-06 21:02:29 +00:00
|
|
|
|
2010-05-06 21:41:12 +00:00
|
|
|
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -659,7 +658,7 @@ need a seperate network connection to the target for discovery purposes.
|
2010-05-06 21:41:12 +00:00
|
|
|
*This will be fixed in the next version of open-iscsi*
|
|
|
|
|
|
|
|
For compatibility reasons, when you run iscsiadm to do discovery, it
|
|
|
|
-will check for interfaces in /etc/iscsi/iscsi/ifaces that are using
|
|
|
|
+will check for interfaces in /var/lib/iscsi/ifaces that are using
|
|
|
|
tcp for the iface.transport and it will bind the portals that are discovered
|
|
|
|
so that they will be logged in through those ifaces. This behavior can also
|
|
|
|
be overriden by passing in the interfaces you want to use. For the case
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -677,7 +676,7 @@ we do not bind a session to a iface, then you can use the special iface
|
2008-02-06 21:02:29 +00:00
|
|
|
|
2010-07-12 19:10:19 +00:00
|
|
|
iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
|
2008-02-06 21:02:29 +00:00
|
|
|
|
|
|
|
-And if you did not define any interfaces in /etc/iscsi/ifaces and do
|
|
|
|
+And if you did not define any interfaces in /var/lib/iscsi/ifaces and do
|
|
|
|
not pass anything into iscsiadm, running iscsiadm will do the default
|
|
|
|
behavior, where we allow the network subsystem to decide which
|
|
|
|
device to use.
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -719,7 +718,7 @@ To now log into targets it is the same as with sofware iscsi. See section
|
2010-07-12 19:10:19 +00:00
|
|
|
|
|
|
|
./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
|
|
|
|
|
|
|
|
- This will search /etc/iscsi/send_targets for a record with the
|
|
|
|
+ This will search /var/lib/iscsi/send_targets for a record with the
|
|
|
|
ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
|
|
|
|
will perform discovery using the settings stored in the record.
|
|
|
|
If a record does not exist, it will be created using the iscsid.conf
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -728,7 +727,7 @@ To now log into targets it is the same as with sofware iscsi. See section
|
2011-10-23 08:29:01 +00:00
|
|
|
The argument to -p may also be a hostname instead of an address.
|
|
|
|
./iscsiadm -m discoverydb -t st -p smoehost --discover
|
2010-07-12 19:10:19 +00:00
|
|
|
|
|
|
|
- For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for
|
|
|
|
+ For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for
|
|
|
|
interfaces using software iscsi. If any are found then nodes found
|
|
|
|
during discovery will be setup so that they can logged in through
|
|
|
|
those interfaces. To specify a specific iface, pass the
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -784,7 +783,7 @@ To now log into targets it is the same as with sofware iscsi. See section
|
2010-05-06 21:41:12 +00:00
|
|
|
This command will perform discovery, but not manipulate the node DB.
|
2008-02-06 21:02:29 +00:00
|
|
|
|
2008-09-30 12:21:47 +00:00
|
|
|
- SendTargets iSCSI Discovery with a specific interface. If you
|
2008-02-06 21:02:29 +00:00
|
|
|
- wish to only use a subset of the interfaces in /etc/iscsi/ifaces
|
|
|
|
+ wish to only use a subset of the interfaces in /var/lib/iscsi/ifaces
|
|
|
|
then you can pass them in during discovery:
|
|
|
|
|
2010-07-12 19:10:19 +00:00
|
|
|
./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -1145,8 +1144,8 @@ where targetname is the name of the target and ip_address:port is the address
|
2008-09-30 12:21:47 +00:00
|
|
|
and port of the portal. tpgt, is the portal group tag of
|
|
|
|
the portal, and is not used in iscsiadm commands except for static
|
|
|
|
record creation. And iface name is the name of the iscsi interface
|
|
|
|
-defined in /etc/iscsi/ifaces. If no interface was defined in
|
|
|
|
-/etc/iscsi/ifaces or passed in, the default behavior is used.
|
|
|
|
+defined in /var/lib/iscsi/ifaces. If no interface was defined in
|
|
|
|
+/var/lib/iscsi/ifaces or passed in, the default behavior is used.
|
|
|
|
Default here is iscsi_tcp/tcp to be used over which ever NIC the
|
|
|
|
network layer decides is best.
|
|
|
|
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -1261,7 +1260,7 @@ If set, iscsid will perform discovery to the address every
|
2010-07-12 19:10:19 +00:00
|
|
|
discovery.isns.discoveryd_poll_inval or
|
|
|
|
discovery.sendtargets.discoveryd_poll_inval seconds,
|
|
|
|
and it will log into any portals found from the discovery source using
|
|
|
|
-the ifaces in /etc/iscsi/ifaces.
|
|
|
|
+the ifaces in /var/lib/iscsi/ifaces.
|
|
|
|
|
|
|
|
Note that for iSNS the poll_interval does not have to be set. If not set,
|
|
|
|
iscsid will only perform rediscovery when it gets a SCN from the server.
|
2013-01-22 21:44:13 +00:00
|
|
|
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
|
2013-08-18 22:15:35 +00:00
|
|
|
index 6b15fcd..30811bd 100644
|
2013-01-22 21:44:13 +00:00
|
|
|
--- a/doc/iscsiadm.8
|
|
|
|
+++ b/doc/iscsiadm.8
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -101,7 +101,7 @@ This option is only valid for ping submode.
|
2013-01-22 21:44:13 +00:00
|
|
|
.TP
|
|
|
|
\fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
|
|
|
|
The interface argument specifies the iSCSI interface to use for the operation.
|
|
|
|
-iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
|
|
|
|
+iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware
|
|
|
|
iSCSI (qla4xxx) the iface config must have the hardware address
|
|
|
|
(iface.hwaddress = port's MAC address)
|
|
|
|
and the driver/transport_name (iface.transport_name). The iface's name is
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -178,7 +178,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
|
2013-01-22 21:44:13 +00:00
|
|
|
of their respective records are displayed; for \fIsession\fR, all active
|
|
|
|
sessions and connections are displayed; for \fIfw\fR, all boot firmware
|
|
|
|
values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
|
|
|
|
-for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
|
|
|
|
+for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fB\-n\fR, \fB\-\-name=\fIname\fR
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -562,10 +562,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
|
2013-01-22 21:44:13 +00:00
|
|
|
The file containing the iSCSI InitiatorName and InitiatorAlias read by
|
|
|
|
\fBiscsid\fR and \fBiscsiadm\fR on startup.
|
|
|
|
.TP
|
|
|
|
-/etc/iscsi/nodes/
|
|
|
|
+/var/lib/iscsi/nodes/
|
|
|
|
This directory contains the nodes with their targets.
|
|
|
|
.TP
|
|
|
|
-/etc/iscsi/send_targets
|
|
|
|
+/var/lib/iscsi/send_targets
|
|
|
|
This directory contains the portals.
|
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
diff --git a/usr/idbm.c b/usr/idbm.c
|
2013-08-18 22:15:35 +00:00
|
|
|
index 634e547..4bb9810 100644
|
2013-01-22 21:44:13 +00:00
|
|
|
--- a/usr/idbm.c
|
|
|
|
+++ b/usr/idbm.c
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -2721,9 +2721,9 @@ free_info:
|
2008-09-30 12:21:47 +00:00
|
|
|
int idbm_init(idbm_get_config_file_fn *fn)
|
|
|
|
{
|
2007-10-05 07:40:40 +00:00
|
|
|
/* make sure root db dir is there */
|
|
|
|
- if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) {
|
|
|
|
- if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) {
|
|
|
|
- log_error("Could not make %s %d\n", ISCSI_CONFIG_ROOT,
|
|
|
|
+ if (access(ISCSIVAR, F_OK) != 0) {
|
|
|
|
+ if (mkdir(ISCSIVAR, 0660) != 0) {
|
|
|
|
+ log_error("Could not make %s %d\n", ISCSIVAR,
|
|
|
|
errno);
|
2008-09-30 12:21:47 +00:00
|
|
|
return errno;
|
2007-03-20 19:52:42 +00:00
|
|
|
}
|
2013-01-22 21:44:13 +00:00
|
|
|
diff --git a/usr/idbm.h b/usr/idbm.h
|
2013-08-18 22:15:35 +00:00
|
|
|
index 5e4038d..1e9b132 100644
|
2013-01-22 21:44:13 +00:00
|
|
|
--- a/usr/idbm.h
|
|
|
|
+++ b/usr/idbm.h
|
2013-08-18 22:15:35 +00:00
|
|
|
@@ -29,12 +29,13 @@
|
2013-01-22 21:44:13 +00:00
|
|
|
#include "list.h"
|
2013-08-18 22:15:35 +00:00
|
|
|
#include "flashnode.h"
|
2007-03-20 19:52:42 +00:00
|
|
|
|
2007-10-05 07:40:40 +00:00
|
|
|
-#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes"
|
|
|
|
-#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp"
|
|
|
|
-#define ISNS_CONFIG_DIR ISCSI_CONFIG_ROOT"isns"
|
|
|
|
-#define STATIC_CONFIG_DIR ISCSI_CONFIG_ROOT"static"
|
2010-05-06 21:41:12 +00:00
|
|
|
-#define FW_CONFIG_DIR ISCSI_CONFIG_ROOT"fw"
|
2007-10-05 07:40:40 +00:00
|
|
|
-#define ST_CONFIG_DIR ISCSI_CONFIG_ROOT"send_targets"
|
2013-08-20 21:03:56 +00:00
|
|
|
+#define ISCSIVAR "/var/lib/iscsi/"
|
2007-10-05 07:40:40 +00:00
|
|
|
+#define NODE_CONFIG_DIR ISCSIVAR"nodes"
|
|
|
|
+#define SLP_CONFIG_DIR ISCSIVAR"slp"
|
|
|
|
+#define ISNS_CONFIG_DIR ISCSIVAR"isns"
|
|
|
|
+#define STATIC_CONFIG_DIR ISCSIVAR"static"
|
2010-05-06 21:41:12 +00:00
|
|
|
+#define FW_CONFIG_DIR ISCSIVAR"fw"
|
2013-08-18 22:15:35 +00:00
|
|
|
+#define ST_CONFIG_DIR ISCSIVAR"send_targets"
|
2007-10-05 07:40:40 +00:00
|
|
|
#define ST_CONFIG_NAME "st_config"
|
2010-07-12 19:10:19 +00:00
|
|
|
#define ISNS_CONFIG_NAME "isns_config"
|
2007-03-20 19:52:42 +00:00
|
|
|
|
2013-01-22 21:44:13 +00:00
|
|
|
diff --git a/usr/iface.h b/usr/iface.h
|
|
|
|
index 01f7074..f396918 100644
|
|
|
|
--- a/usr/iface.h
|
|
|
|
+++ b/usr/iface.h
|
2010-05-06 21:41:12 +00:00
|
|
|
@@ -20,7 +20,9 @@
|
2008-09-30 12:21:47 +00:00
|
|
|
#ifndef ISCSI_IFACE_H
|
|
|
|
#define ISCSI_IFACE_H
|
|
|
|
|
|
|
|
-#define IFACE_CONFIG_DIR ISCSI_CONFIG_ROOT"ifaces"
|
2010-05-06 21:41:12 +00:00
|
|
|
+#include "idbm.h"
|
|
|
|
+
|
|
|
|
+#define IFACE_CONFIG_DIR ISCSIVAR"ifaces"
|
2008-09-30 12:21:47 +00:00
|
|
|
|
|
|
|
struct iface_rec;
|
|
|
|
struct list_head;
|
2013-01-22 21:44:13 +00:00
|
|
|
--
|
2013-08-18 22:15:35 +00:00
|
|
|
1.8.1.4
|
2013-01-22 21:44:13 +00:00
|
|
|
|