1saveconfig.json(5)            File Formats Manual           saveconfig.json(5)
2
3
4

NAME

6       saveconfig.json - Saved configuration file for rtslib-fb and LIO kernel
7       target
8

DESCRIPTION

10       /etc/target/saveconfig.json is the default  location  for  storing  the
11       configuration  of the Linux kernel target, also known as LIO. Since the
12       target is in the kernel, tools like targetctl or targetcli must be used
13       to save and restore the configuration across reboots.
14
15       Generating or modifying this file by hand, or with other tools, is also
16       supported. This fills a gap for users whose needs are not  met  by  the
17       targetcli  configuration  shell,  who  cannot  use  the  rtslib  Python
18       library, and yet also wish to avoid directly  manipulating  LIO's  con‐
19       figfs interface.
20

OVERVIEW

22       The  configuration  file  is  in  the "json" text format, which is both
23       human- and machine-readable. Its format is very closely modeled on  the
24       layout  and  terminology that LIO uses. Attributes may be string, bool‐
25       ean, or numeric values. All sizes are expressed in bytes.
26

LAYOUT

28   TOP LEVEL SUMMARY
29       storage_objects describes mappings of resources on  the  local  machine
30       that can be used to emulate block devices.
31
32       fabric_modules  describes  settings  for LIO fabrics -- the hardware or
33       software protocols that transport SCSI commands --  such  as  iSCSI  or
34       Fibre Channel over Ethernet (FCoE).
35
36       targets describes the SCSI target endpoints that export storage objects
37       over a fabric.
38
39   storage_objects
40       All storage objects must contain name and plugin values. Each name must
41       be unique for all storage objects of its plugin type.
42
43       plugin must be one of: fileio, block, pscsi, or ramdisk.
44
45       Objects with plugin value of fileio must also contain dev, which is the
46       full path to the file that is backing  the  storage  object.   Optional
47       fileio  attributes  are  wwn  (string),  write_back (boolean), and size
48       (number).  If the file given in dev does not exist, then size  must  be
49       present, and a backing file of that size will be created.
50
51       Objects  with plugin value of block must also contain dev, which is the
52       full path to the block device  that  is  backing  the  storage  object.
53       Optional  block  attributes are wwn (string), write_back (boolean), and
54       readonly (boolean).
55
56       Objects with plugin value of pscsi must also contain dev, which is  the
57       full path to the SCSI device that is backing the storage object.  There
58       are no optional attributes.
59
60       Objects with plugin value of ramdisk must also contain  size  (number),
61       which is the size in bytes of the ramdisk.  Optional ramdisk attributes
62       are wwn (string), and nullio (boolean).
63
64       All storage object definitions may also contain an  attributes  object.
65       This  contains  LIO  attribute  values, all of which are also optional.
66       Please see LIO documentation for more information on these.
67
68
69   fabric_modules
70       This section is limited to setting  discovery  authentication  settings
71       for fabrics that support it (currently just iscsi). Objects here should
72       contain name  (e.g.  "iscsi"),  userid,  password,  mutual_userid,  and
73       mutual_password string values.
74
75
76   targets
77       Target  configuration  is modeled on iSCSI, in which a named target can
78       contain multiple sub-configurations called Target Port  Groups  (TPGs).
79       LIO  follows  this  model for describing configuration even for fabrics
80       that do not support TPGs.
81
82       Objects in targets contain just three attributes: wwn is the world-wide
83       name  the  target  has been given. This may start with "iqn", or "naa",
84       for example.  fabric is the name of the fabric module  this  target  is
85       exported  over. Allowed values for this depend on the system configura‐
86       tion, but examples include "iscsi", "loopback", and "tcm_fc".  tpgs  is
87       a list of objects describing 1 or more TPGs, described below.
88
89
90   tpgs
91       TPG object attributes are all optional. Values not supplied will be set
92       to default values.  tag (number) allows the tpg tag  to  be  specified.
93       enable  (bool,  default  to  true)  allows  the  TPG  to be disabled or
94       enabled.   luns,  portals,  and  node_acls  contain  further  lists  of
95       objects, descibed below.  Finally, userid, password, mutual_userid, and
96       mutual_password allow main-phase authentication values to  be  set  for
97       fabrics (like iSCSI) that support TPG-level authentication. (Please see
98       targetcli(8) for  details  on  TPG  versus  ACL-based  authentication.)
99       Finally,  TPGs  can  also  contain  optional  attributes and parameters
100       lists, see LIO documentation for more information.
101
102
103   luns
104       This list of objects maps storage objects to the TPG.  index is a  TPG-
105       unique  number  for  the assignment, which may be used as the LU number
106       for fabrics that do not support  ACL  mappings.   storage_object  is  a
107       string  linking  back  to  a  storage  object,  of  the  format "/back‐
108       stores/<plugin>/<name>", where <plugin>  and  <name>  correspond  to  a
109       storage object defined under storage_objects.
110
111
112   portals
113       Portals  describe connection endpoints for iSCSI targets. Required val‐
114       ues are ip_address (string) and port (number).  iser  (boolean)  is  an
115       optional  value to enable iSER.  offload (boolean) is an optional value
116       to enable hardware offload.
117
118
119   node_acls
120       This  contains  information  about  explicit  initiator  LUN  mappings.
121       node_wwn (string) must be present.  Authentication may also be set on a
122       per-ACL basis with userid, password,  mutual_userid,  and  mutual_pass‐
123       word, similar to TPGs.  mapped_luns is a list of mapped luns, described
124       below.  Finally, node_acls can contain an optional attributes list.
125
126
127   mapped_luns
128       Objects in mapped_luns contain three required  attributes.   write_pro‐
129       tect  (boolean)  sets  the  write-protect  status  of  the  mapped LUN.
130       tpg_lun (number) corresponds to an existing entry  in  the  TPG's  luns
131       list.  index is the LU number that the mapped LUN will claim.
132
133

EXAMPLE CONFIGURATION

135       Since  tools  generate this file, one good way to understand its format
136       is to use a tool like targetcli to configure a target, then  run  save‐
137       config, and view the resulting json file.
138

SEE ALSO

140       targetcli(8), targetctl(8)
141

FILES

143       /etc/target/saveconfig.json
144

AUTHOR

146       Man page written by Andy Grover <agrover@redhat.com>.
147

REPORTING BUGS

149       Report bugs via <targetcli-fb-devel@lists.fedorahosted.org>
150       or <https://github.com/open-iscsi/rtslib-fb/issues>
151
152
153
154                                                            saveconfig.json(5)
Impressum