Imported Upstream version 3.2.0
[debian/amanda] / man / xml-source / amanda-changers.7.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
4 [
5   <!-- entities files to use -->
6   <!ENTITY % global_entities SYSTEM 'global.entities'>
7   %global_entities;
8 ]>
9
10 <refentry id='amanda-changers.7'>
11
12 <refmeta>
13 <refentrytitle>amanda-changers</refentrytitle>
14 <manvolnum>7</manvolnum>
15 &rmi.source;
16 &rmi.version;
17 &rmi.manual.7;
18 </refmeta>
19 <refnamediv>
20 <refname>amanda-changers</refname>
21 <refpurpose>Configuring and Using Amanda Changers</refpurpose>
22 </refnamediv>
23 <refentryinfo>
24 &author.dustin;
25 </refentryinfo>
26 <!-- body begins here -->
27
28 <refsect1><title>DESCRIPTION</title>
29
30 <para>Amanda uses changers to arbitrate access to devices
31 (<manref name="amanda-devices" vol="7"/>)
32 and data volumes.  Changers provide an abstraction of tape robots, but are used
33 to manage non-tape media, too.  Amanda communicates with changers through the
34 Changer API.  This manpage contains a <emphasis>user-level</emphasis> overview
35 of the API, and does not address details that are only of concern to
36 developers.  For that purpose, consult the Amanda source code and
37 http://wiki.zmanda.com.</para>
38
39 </refsect1>
40
41 <refsect1><title>TRANSITION</title>
42
43 <para>The Amanda Changer API is in transition from version 1.0 - driven by
44 shell scripts invoked for each changer operation - to version 2.0, composed of
45 perl objects that can manage parallel access to multiple devices and other
46 complexity.  At this point, all Amanda programs use the new Changer API directly,
47 although 1.0 changer scripts are still fully supported via <code>chg-compat</code>.
48 </para>
49
50 <para>The Changer API strives to treat all changers identically, so that
51 Amanda's behavior is independent of the changer in use.  However, some parts of
52 Amanda operate differently depending on whether a changer can efficiently
53 search for a volume with a given label.  This distinction is really only
54 apparent with tape libraries: those with barcode readers can quickly find a
55 desired tape, while those without may fall back to an inefficient scan of each
56 volume.  The capability to perform quick searches is called "fast-search", and
57 each changer is annotated below to indicate its support.</para>
58
59 </refsect1>
60
61 <refsect1><title>SPECIFYING CHANGERS</title>
62
63 <para>Changer specifications are strings like
64 <computeroutput>chg-disk:/my/vtapes</computeroutput>.  The
65 <computeroutput>chg-</computeroutput> prefix serves to differentiate changers
66 from devices (see <manref name="amanda-devices" vol="7"/>).  The next portion
67 (<computeroutput>disk</computeroutput>, in this case) identifies the particular
68 changer driver to use, and everything that follows the
69 <computeroutput>:</computeroutput> is interpreted by the driver.  Note that the
70 <computeroutput>:</computeroutput> character is required, even when nothing
71 follows it.  This is an easy way to distinguish new changer specifications from
72 old.</para>
73
74 <para>A name which does not match this pattern, but which matches an old
75 changer script (e.g., <computeroutput>chg-zd-mtx</computeroutput>), invokes the
76 backward-compatibility changer driver as e.g.,
77 <computeroutput>chg-compat:chg-zd-mtx</computeroutput>.  If the name does not
78 match an old changer, then it is treated as an Amanda device, and is wrapped by
79 the single-device changer, e.g.,
80 <computeroutput>chg-single:tape:/dev/rmt/0</computeroutput>.</para>
81
82 <para>Changers which require additional parameters can also be described in
83 &amconf; with "changer" sections.  Such a changer defininition creates a
84 changer "alias", in this case named <emphasis>hp-robot</emphasis>, which can
85 then be named where an application expects a changer - for example, the target
86 of the <command>amvault</command> command or in a global
87 <command>tpchanger</command> parameter.</para>
88
89 <refsect2><title>CONFIGURATION</title>
90
91 <para>The preferred method of specifying configuration for a changer is as a
92 "changer" section in &amconf;.  The <emphasis>tapedev</emphasis> parameter
93 then indicates, by name, the changer that will be used by default by most
94 Amanda programs.  For example:
95 <programlisting>
96 define changer hp-robot {
97     tapedev "chg-robot:/dev/sg1"
98     property "tape-device" "0=tape:/dev/nst0"
99     property append "tape-device" "1=tape:/dev/nst1"
100     device-property "BLOCK_SIZE" "512k"
101 }
102 # ...
103 tapedev "hp-robot"
104 </programlisting>
105 </para>
106
107 <para>Several changer drivers accept <emphasis>changer properties</emphasis> which
108 control the behavior of the changer.  These properties must be specified in a
109 changer definition, as in the <emphasis>hp-robot</emphasis> example, above.</para>
110
111 <para>Devices, too, can take properties to control their behavior (see <manref
112 name="amanda-devices" vol="7" />).  Device properties can come from four
113 places: implicit device properties (from tapetype parameters), global device
114 properties (from global <emphasis>device-property</emphasis> parameters),
115 properties in device definitions, and properties in changer definitions.
116 Properties are applied in this order, with later properties taking
117 priority.</para>
118
119 <para>There are only three implicit properties:
120 <emphasis>MAX_VOLUME_USAGE</emphasis> is set based on the tapetype
121 <emphasis>length</emphasis> parameter, <emphasis>READ_BLOCK_SIZE</emphasis> is
122 set if <emphasis>readblocksize</emphasis> is set, and
123 <emphasis>BLOCK_SIZE</emphasis> is set based on the
124 <emphasis>blocksize</emphasis> parameter.</para>
125
126 <para>Global device properties always apply.  If the changer specifies a device
127 by alias, then device properties from the definition apply.  If the changer is
128 specified by an alias, then properties from that definition applied.</para>
129
130 </refsect2>
131 </refsect1>
132
133 <refsect1><title>CHANGER DRIVERS</title>
134
135 <para>This section lists the changer drivers included with Amanda, and basic instructions for using them.  For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com.</para>
136
137 <refsect2><title>chg-disk:VTAPEROOT (new)</title>
138 <programlisting>
139 tpchanger "chg-disk:/u01/vtapes"
140 </programlisting>
141
142 <para>This changer driver replaces the old <command>chg-disk</command>,
143 supporting parallel access to vtapes stored in directories named
144 <computeroutput>slotN</computeroutput> in the directory specified after
145 <computeroutput>chg-disk:</computeroutput>.  It does so by creating numbered
146 "drives" so that simultaneous processes can access distinct slots.  This changer is fast-search capable.</para>
147
148 <para>The current slot can be accessed using the device name
149 <computeroutput>file:VTAPEROOT</computeroutput>. This is useful for the <manref
150 name="amrestore" vol="8" /> command line.</para>
151
152 </refsect2>
153
154 <refsect2><title>chg-disk (old)</title>
155 <programlisting>
156 tapedev "file:/u01/vtapes"
157 tpchanger "chg-disk"
158 changerfile "chg-disk.conf"     # optional file
159 </programlisting>
160
161 <para>This changer script supports sequential access to vtapes stored in
162 directories named <computeroutput>slotN</computeroutput> in the directory
163 specified by the <emphasis>tapedev</emphasis> parameter.
164 The configuration file parameter is:
165 <programlisting>
166 LASTSLOT=number    # The number of slots, default to tapecycle setting.
167 </programlisting>
168 </para>
169
170 <para>This changer is not fast-search capable.</para>
171
172 </refsect2>
173
174 <refsect2><title>chg-multi:DEVICE-LIST</title>
175 <programlisting>
176 tpchanger "chg-multi:{/dev/nst0,/dev/nst1,/dev/nst2}"
177 changerfile "chg-multi-state"
178 </programlisting>
179
180 <para>This script simply round-robins a number of distinct device names, as
181 specified in the <emphasis>tpchanger</emphasis> setting.  It is useful when
182 all volumes for a configuration have different device names -- for example,
183 if you have many standalone drive.  The <emphasis>changerfile</emphasis> must exist; it is used to save the state file.
184 </para>
185
186 <para>The child devices are specified using the same syntax as for the RAIT
187 device (see <manref name="amanda-changers" vol="7"/>).  The range
188 specification can be especially useful here:
189 <programlisting>
190 tpchanger "chg-multi:s3:mycompany-backups/tape-{001..100}"
191 </programlisting>
192 </para>
193
194 <para>This changer is not fast-search capable.</para>
195
196 <refsect3><title>Properties</title>
197 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
198
199 <variablelist>
200 <!-- ==== -->
201 <varlistentry><term>FIRST-SLOT</term><listitem>
202 This property gives the number of the first slot. The default value is "1".
203 </listitem></varlistentry>
204 <!-- ==== -->
205 </variablelist>
206
207 </refsect3>
208
209 <refsect3><title>Special Operations</title>
210
211 <para>A number of special operations are available for <command>chg-multi</command> via
212 <manref name="amtape" vol="8" /> subcommands.</para>
213
214 <para>The <command>reset</command> subcommand will change the current slot to
215 the first available slot, but does not erase any stored state maintained by the
216 changer.</para>
217
218 <para>The <command>eject</command> subcommand will eject the volume in the
219 given drive</para>
220
221 <para>The <command>clean</command> subcommand is not yet implemented.</para>
222
223 <para>The <command>update</command> subcommand instructs the changer to update
224 its state database.  Given no arguments, the changer will scan all available
225 slots, loading each tape and reading its label.  Especially for large libraries,
226 this can take a long time.  If only a few slots have changed, they can be listed
227 on the command line:
228 <programlisting>
229 amtape CONFIG update 1-3,9
230 </programlisting>
231 In this case, the changer will only scan the stated slots.  Finally, the changer
232 will not scan at all if it is given the tape label for the slot:
233 <programlisting>
234 amtape CONFIG update 2=DailySet-028
235 </programlisting>
236 In this case, the changer updates its state to indicate that
237 <computeroutput>DailySet-028</computeroutput> is in slot 2, without trying to
238 load the tape.
239 <programlisting>
240 amtape CONFIG update 1-3,9=
241 </programlisting>
242 In this case, the changer marks the stated slots as an unknown state.
243 </para>
244
245 </refsect3>
246
247 </refsect2>
248
249 <refsect2><title>chg-multi (old)</title>
250 <programlisting>
251 tpchanger "chg-multi"
252 changerfile "chg-multi-state"
253 </programlisting>
254
255 <para>This script simply round-robins a number of distinct device names, as
256 specified in its configuration file.  It is useful when all volumes for a
257 configuration have different device names -- for example, with S3 devices.
258 The <emphasis>changerfile</emphasis> need not exist; it is used as a prefix
259 for filenames of state files.
260 </para>
261
262 <para>The configuration file has simple lines with a parameter and its value separated by a space.  The # character introduces a comment.  The configuration parameters are: </para>
263
264 <variablelist>
265 <varlistentry><term>multieject</term><listitem>If this is 1, use an 'mt
266 offline' command to change to the next tape, or multiple such commands for
267 skipping several tapes at a time.
268 </listitem></varlistentry>
269
270 <varlistentry><term>needeject</term><listitem>This option is incompatible with
271 'multieject'. This should be 1 for changers accessed through several virtual
272 tape devices, when the changer needs the current tape to be ejected before
273 changing to another device.
274 </listitem></varlistentry>
275
276 <varlistentry><term>gravity</term><listitem>Set this to 1 if the
277 changer/stacker is unable to loop back to the first tape after unloading the
278 last one, or if you don't want amanda to go through the tape stack looking for
279 the exact tape it wants instead of using the first acceptable one.
280 </listitem></varlistentry>
281
282 <varlistentry><term>slot X</term><listitem>The configuration file should list
283 as many 'slot X' statements as the number of slots supported by the changer or
284 the number of separate tape drives used.
285 </listitem></varlistentry>
286 </variablelist>
287
288 <para>This changer is not fast-search capable.</para>
289
290 </refsect2>
291
292 <refsect2><title>chg-manual</title>
293 <programlisting>
294 tpchanger "chg-manual"
295 changerfile "chg-manual.conf"
296 </programlisting>
297
298 <para>This script simply provides distinct device names in a round-robin
299 fashion, as specified in its configuration file.  It is useful when all volumes
300 for a configuration have different device names -- for example, with S3
301 devices.  The configuration file parameters are (as listed in the script):
302 <programlisting>
303 resend_mail=900       # resend mail every __ seconds
304 timeout_mail=604800   # time out after this many seconds (default 7 days)
305 request="[type]"      # How to request a new tape (default "tty_email")
306   request="tty"       # Use the tty to ask the user to change tape.
307                       # Can't be use by cron
308   request="email"     # Send an email to ask the user to change tape.
309   request="tty_email" # Use the tty if it exist or send an email.
310 </programlisting>
311 </para>
312
313 <para>This changer is not fast-search capable.</para>
314
315 </refsect2>
316
317 <refsect2><title>chg-zd-mtx (old)</title>
318 <programlisting>
319 tpchanger "chg-zd-mtx"
320 changerdev "/dev/sg0"         # used with 'mtx -f'
321 changerfile "chg-zd-mtx.conf"
322 tapedev "tape:/dev/nst0"
323 </programlisting>
324
325 <para>This script interfaces with a tape drive using the Zubkoff/Dandelion
326 version of mtx.  That's the version that takes a device specifier with the
327 <command>-f</command> option and has subcommands like
328 <command>status</command>.  The configuration file parameters are (as listed in
329 the script itself):
330 <programlisting>
331 firstslot=?                 #### First storage slot (element)
332 lastslot=?                  #### Last storage slot (element)
333 cleanslot=-1                #### Slot with cleaner tape -- default is "-1"
334                             #### Set negative to indicate no cleaner available
335 driveslot=0                 #### Drive slot number.  Defaults to 0
336                             #### Use the 'Data Transfer Element' you want
337 autoclean=0                 #### Set to '1' or greater to enable
338 autocleancount=99           #### Number of access before a clean.
339 havereader=0                #### If you have a barcode reader, set to 1.
340 offline_before_unload=0     #### Does your robot require an
341                             #### 'mt offline' before mtx unload?
342 poll_drive_ready=NN         #### Time (seconds) between tests to see if
343                             #### the tape drive has gone ready (default: 3).
344 max_drive_wait=NN           #### Maximum time (seconds) to wait for the
345                             #### tape drive to become ready (default: 120).
346 initial_poll_delay=NN       #### initial delay after load before polling for
347                             #### readiness
348 slotinfofile=FILENAME       #### record slot information to this file, in
349                             #### the line-based format "SLOT LABEL\n"
350 </programlisting>
351 </para>
352
353 <para>This changer is fast-search capable if and only if
354 <command>havereader</command> is true.</para>
355
356 </refsect2>
357
358 <refsect2><title>chg-rait:{CHILD1,CHILD2,..}</title>
359 <programlisting>
360 define changer vtape {
361     tpcanger "chg-disk:/path/to/vtape"
362 }
363 define changer robot {
364     tpchanger "chg-robot:/dev/sg0"
365     tapedev "tape:/dev/nst0"
366 }
367 tpchanger "chg-rait:{vtape,robot}"
368 </programlisting>
369
370 <para>This changer script constructs RAIT devices out of the devices provided
371 by several "sub-changers".  The sub-changers are specified using the same
372 shell-like syntax as the RAIT device (see <manref name="amanda-devices"
373     vol="7"/>).</para>
374
375 <para>Chg-rait does not require that all of the child changers have the same slot names: compound slot names are created by combining the slot names supplied by the child changers using the same shell-like syntax.  For example, if the child changers return slots "<computeroutput>top</computeroutput>", "<computeroutput>strange</computeroutput>", and "<computeroutput>3</computeroutput>", then the RAIT changer will return "<computeroutput>{top,strange,3}</computeroutput>".  This makes it possible to, for example, mirror data on tapes in slots 1-10 to tapes in slots 11-20 of the same robot, using two <command>chg-zd-mtx</command> child changers (and, naturally, two tape drives).  In this arrangement, the first slot would be named <computeroutput>{1,11}</computeroutput>.</para>
376
377 <para>As a convenience to the user, the RAIT changer will also accept un-braced slot names, and supply the same name to each child changer. Thus with a 4-device RAIT changer, "<computeroutput>17</computeroutput>" is equivalent to "<computeroutput>{17,17,17,17}</computeroutput>".</para>
378
379 <para>Drive names are parsed in a similar fashion, for operations that take drive names (clean and eject).</para>
380
381 <para>This changer is fast-search capable only if all of its child changers are fast-search capable.</para>
382
383 <note>The old chg-rait script is no longer supported nor shipped with Amanda, although the old script will continue to function via <command>chg-compat</command>, giving users time to upgrade their configuration.
384 </note><!-- previous newline is important -->
385
386 </refsect2>
387
388 <refsect2><title>chg-null:</title>
389 <programlisting>
390 tpchanger "chg-null:"
391 </programlisting>
392
393 <para>This changer always provides the device "null:".  It is sometimes useful in conjunction with <command>chg-rait:</command>.</para>
394
395 </refsect2>
396
397 <refsect2><title>chg-robot:DEVICE</title>
398 <programlisting>
399 define changer robot {
400     tpchanger "chg-robot:/dev/sg0"
401     property "tape-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
402     property "eject-before-unload" "yes"
403     property "use-slots" "1-5,11-20"
404 }
405 tpchanger "robot"
406 </programlisting>
407
408 <para>This changer drives a robotic tape library using the operating system's
409 <command>mtx</command> command.  It replaces the ancient
410 <command>chg-zd-mtx</command> script.  The changer uses all of the information
411 available to operate as efficiently as possible.  Even without a barcode
412 reader, the changer can usually load a tape immediately, without resorting to a
413 sequential scan of many tapes.  It is capable of sharing state across multiple
414 Amanda configurations, avoiding conflicts and optimally tracking the contents
415 of the library.</para>
416
417 <para>This changer does not accept a <command>changerdev</command> parameter,
418 but the <command>changerfile</command> parameter can be used to specify a
419 filename at which it should store its state.  Ordinarily, this state is stored
420 in a file named after the changer device under
421 <emphasis>$localstatedir/amanda</emphasis>, e.g.,
422 <command>/var/amanda/chg-robot-dev-sg0</command>.  There should be a single
423 such statefile for each distinct tape library attached to the Amanda server, even
424 if multiple Amanda configurations reference that library.</para>
425
426 <para>With a barcode reader present, it is possible for
427 <command>chg-robot</command> to track the state of the library reliably, even
428 recognizing tapes that are removed and later re-inserted (by remembering their
429 barcodes).  Without barcodes, the changer can still remember the slot in which
430 it last saw the tape with a particular label, although this information can
431 become stale if the tapes are rearranged by an operator.  In any case, the
432 changer will never "hunt" for a tape by repeatedly loading slots and checking
433 labels.  If the changer's state is inaccurate, use the
434 <manref name="amtape" vol="8" /> subcommand <command>update</command>.</para>
435
436 <para>This changer is fast-search capable even without a barcode reader.  For
437 such libraries, it is the responsibility of the operator to
438 <command>update</command> the changer when tapes are added to or removed from
439 the library.</para>
440
441 <para>There is a shell script in the <filename>contrib/</filename> directory of
442 Amanda's source distribution which can help you convert a
443 <command>chg-zd-mtx</command> configuration into a <command>chg-robot</command>
444 configuration.  Just give it your Amanda configuration name:
445 <programlisting>
446   sh contrib/convert-zd-mtx-to-robot.sh $config
447 </programlisting>
448 The script can be downloaded at <uri
449 type="webpage">http://github.com/zmanda/amanda/raw/master/contrib/convert-zd-mtx-to-robot.sh</uri></para>
450
451 <refsect3><title>Special Operations</title>
452
453 <para>A number of special operations are available for <command>chg-robot</command> via
454 <manref name="amtape" vol="8" /> subcommands.</para>
455
456 <para>The <command>reset</command> subcommand will change the current slot to
457 the first available slot, but does not erase any stored state maintained by the
458 changer.</para>
459
460 <para>The <command>eject</command> subcommand will unload the volume in the
461 given drive, ejecting first if the changer properties dictate.  Note that,
462 despite the subcommand name, the changer attempts to avoid the state where a
463 volume has been ejected from the drive but not unloaded back to a storage
464 slot.</para>
465
466 <para>The <command>clean</command> subcommand is not yet implemented.</para>
467
468 <para>The <command>update</command> subcommand instructs the changer to update
469 its state database.  Given no arguments, the changer will scan all available
470 slots, loading each tape and reading its label.  Especially for large libraries,
471 this can take a long time.  If only a few slots have changed, they can be listed
472 on the command line:
473 <programlisting>
474 amtape CONFIG update 1-3,9
475 </programlisting>
476 In this case, the changer will only scan the stated slots.  Finally, the changer
477 will not scan at all if it is given the tape label for the slot:
478 <programlisting>
479 amtape CONFIG update 2=DailySet-028
480 </programlisting>
481 In this case, the changer updates its state to indicate that
482 <computeroutput>DailySet-028</computeroutput> is in slot 2, without trying to
483 load the tape.
484 <programlisting>
485 amtape CONFIG update 1-3,9=
486 </programlisting>
487 In this case, the changer marks the stated slots as an unknown state.
488 </para>
489
490 </refsect3>
491
492 <refsect3><title>Properties</title>
493 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
494
495 <variablelist>
496 <!-- ==== -->
497 <varlistentry><term>DRIVE-CHOICE</term><listitem>
498 This property controls the algorithm used to select a drive in which to load a
499 tape.  If set to the default ("lru"), the changer attempts to use the least
500 recently used drive, resulting in a round-robin behavior.  The "firstavail"
501 algorithm selects the first available drive, thus preferring the first drive
502 specified via the TAPE-DEVICE property.
503 </listitem></varlistentry>
504 <!-- ==== -->
505 <varlistentry><term>EJECT-BEFORE-UNLOAD</term><listitem>
506 Set this boolean property to true if the library requires an
507 <command>offline</command> operation be performed on the tape drive before it
508 can be unloaded.  If set, then <command>mt</command> will be invoked to
509 perform this operation.  Most libraries do not require this workaround.
510 </listitem></varlistentry>
511 <!-- ==== -->
512 <varlistentry><term>EJECT-DELAY</term><listitem>
513 This is the time between ejecting a tape and unloading the volume to a storage slot, and
514 defaults to 0 seconds.  It is only used if EJECT-BEFORE-UNLOAD is true.  See "Timing", below.
515 </listitem></varlistentry>
516 <!-- ==== -->
517 <varlistentry><term>FAST-SEARCH</term><listitem>
518 This boolean property indicates whether the changer advertises the ability to find
519 volumes without sequential scanning.  The traditional taperscan algorithm alters its
520 behavior based on this flag, so it is sometimes necessary to adjust it, although the
521 changer will always search for a desired tape using the most efficient means
522 available.  The default value is true.
523 </listitem></varlistentry>
524 <!-- ==== -->
525 <varlistentry><term>IGNORE-BARCODES</term><listitem>
526 If this boolean property is true, then chg-robot will ignore any barcode information
527 that the library provides.  This property is probably only useful when the library
528 returns incorrect barcodes, for example due to a malfunction in the barcode reader.
529 </listitem></varlistentry>
530 <!-- ==== -->
531 <varlistentry><term>LOAD-POLL</term><listitem>
532 <para>This property specifies the timing of Amanda's polling for the tape drive to
533 be ready after loading a new tape.  See "Timing", below.</para>
534
535 <para>The script "polls" by trying to open the tape device repeatedly until no
536 error is encountered.  The property specifies the time to wait before the first
537 poll (D), the frequency at which to poll and retry on errors (P); and the time
538 after which it should give up (U).  The format is
539 <programlisting>
540 "D [poll P [until U]]"
541 </programlisting>
542 For a simple delay with no polling, use e.g.,
543 <programlisting>
544 property "load-poll" "13s"
545 </programlisting>
546 To delay and then poll, use e.g.,
547 <programlisting>
548 property "load-poll" "13s poll 5s"
549 </programlisting>
550 and to add a maximum total time, use e.g.,
551 <programlisting>
552 property "load-poll" "0s poll 5s until 2m"
553 </programlisting>
554 The default value is <command>"0s poll 3s until 2m"</command>.
555 </para>
556 </listitem></varlistentry>
557 <!-- ==== -->
558 <varlistentry><term>MTX</term><listitem>
559 The path to the 'mtx' binary.  The default value is defined at compile time.
560 </listitem></varlistentry>
561 <!-- ==== -->
562 <varlistentry><term>STATUS-INTERVAL</term><listitem>
563 This is the minimum time between invocations of <command>mtx status</command>
564 to determine the state of the changer library.  The default value, 2 seconds,
565 avoids back-to-back status invocations but ensures that the metadata is up to
566 date.  For operating systems or libraries where the <command>mtx
567 status</command> takes a considerable time to complete, this value should be
568 increased.  See "Timing", below.
569 </listitem></varlistentry>
570 <!-- ==== -->
571 <varlistentry><term>TAPE-DEVICE</term><listitem>
572 This property describes the correspondance of drive numbers in the library to
573 Amanda devices, in the format <emphasis>DRIVE=DEVICE</emphasis>.  The property
574 can be specified multiple times to describe multiple devices.  The device will
575 usually be a tape device name starting with <command>tape:</command>, but may
576 also refer to a device alias (see <manref name="amanda-devices" vol="7"/>). As
577 a shortcut, if the <command>tapedev</command> parameter is specified in the
578 changer definition, then it is assumed to be the device name for drive 0.
579 </listitem></varlistentry>
580 <!-- ==== -->
581 <varlistentry><term>UNLOAD-DELAY</term><listitem>
582 This specifies the minimum time between an unload operation any any subsequent
583 operation.  The default value is 0 seconds.  See "Timing", below.
584 </listitem></varlistentry>
585 <!-- ==== -->
586 <varlistentry><term>USE-SLOTS</term><listitem>
587 This property, if specifies, enumerates the slots to which this changer should
588 limit itself.  The slots are specified as a comma-separated list of ranges,
589 e.g., "1-5,11-15,19,22".  The property can be specified more than once, and
590 the resulting sets will be combined.  The changer will refuse to load tapes
591 not found in these slots, except for import/export purposes.
592 </listitem></varlistentry>
593 </variablelist>
594 </refsect3>
595
596 <refsect3><title>Timing</title>
597
598 <para>Tape libraries are fickle, and in many cases will report that an
599 operation is complete when it is still in progress.  Chg-robot takes several
600 timing-related properties to accomodate such behavior.</para>
601
602 <para>A typical sequence of operations performed during a load are: get library
603 status, eject a tape, unload the tape back to a storage slot, load a new tape,
604 and read the label on that tape to ensure the drive is ready.</para>
605
606 <para>On most systems, the library status check is nearly instantaneous -- the
607 changer library provides its cached state to the host without initiating any
608 robot motion.  In order to keep its metadata up-to-date, chg-robot runs this
609 command very frequently, but this frequency can be reduced (at the cost of
610 potentially stale metadata) by setting the STATUS-INTERVAL property to a larger
611 value.</para>
612
613 <para>Some tape libraries do not integrate the eject operation (performed by
614 the embedded tape drive) with the unload operation (performed by the library
615 robot), and can actually cause physical damage by attempting to remove the tape
616 before the ejection is complete.  For such changers, set the EJECT-DELAY
617 property to allow enough time for the eject to complete.</para>
618
619 <para>Once a tape is unloaded, if the library needs time to "quiesce" before
620 processing another command, add that time to the UNLOAD-DELAY parameter.  No
621 other operations will be performed on the library until this delay has
622 elapsed.</para>
623
624 <para>Once a tape has been loaded, chg-robot waits until the drive is ready before
625 allowing Amanda to use the volume, as described for LOAD-POLL, above.</para>
626
627 <para>Each of the times specified in these properties may be given as integers
628 with the optional suffix <command>s</command> for seconds (the default) or
629 <command>m</command> for minutes.</para>
630
631 </refsect3>
632
633 </refsect2>
634
635 <refsect2><title>chg-ndmp:HOST[:PORT]@SCSIDEV</title>
636 <programlisting>
637     tpchanger "chg-ndmp:filer.company.com@/dev/sg0"
638     property        "tape-device" "0=ndmp:filer.company.com@/dev/rtape0"
639     property append "tape-device" "1=ndmp:filer.company.com@/dev/rtape1"
640     property "use-slots" "1-12"
641     property "ndmp-auth" "text"
642     property "ndmp-username" "luke"
643     property "ndmp-password" "leia"
644 </programlisting>
645
646 <para>This changer is very similar to <command>chg-robot</command>, but
647 controls a tape changer on an NDMP server instead of a local device.  The
648 <command>HOST</command> in the <command>tpchanger</command> should be the
649 hostname of the NDMP server.  The <command>PORT</command> is optional.  The
650 <command>SCSIDEV</command> should specify the SCSI device on the NDMP server
651 which controls the changer.  The format of this parameter is
652 implementation-specific.</para>
653
654 <para>The appropriate authentication properties will be automatically set on
655 any devices created by this changer.</para>
656
657 <refsect3><title>Properties</title>
658
659 <para>This changer supports all of the properties supported by
660 <command>chg-robot</command>, although the value of <command>MTX</command> is
661 ignored.  The following properties are also recognized:</para>
662
663 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
664 <variablelist>
665 <!-- ==== -->
666 <varlistentry><term>NDMP_AUTH</term><listitem>
667 Authentication method to use to connect to the NDMP server.  One of
668 "md5" (default), "text", "none" (for an empty authentication attempt) or "void" (for
669 no authentication attempt at all).
670 </listitem></varlistentry>
671 <!-- ==== -->
672 <varlistentry><term>NDMP-PASSWORD</term><listitem>
673 The password for the NDMP server.
674 </listitem></varlistentry>
675 <!-- ==== -->
676 <varlistentry><term>NDMP-USERNAME</term><listitem>
677 The username for the NDMP server.
678 </listitem></varlistentry>
679 <!-- ==== -->
680 <varlistentry><term>VERBOSE</term><listitem>
681 If true, enables the NDMJOB library's verbose (packet-level) debugging.
682 </listitem></varlistentry>
683 <!-- ==== -->
684 </variablelist>
685
686 </refsect3>
687
688 </refsect2>
689
690 <refsect2><title>Unmaintained Changers</title>
691
692 <para>Amanda has many other changer scripts and programs beyond those described
693 here (see the <computeroutput>changer-src/</computeroutput> in the source
694 directory), but most of these scripts are unmaintained and undocumented, and
695 will be removed when the new changer API is fully implemented.</para>
696
697 </refsect2>
698
699 </refsect1>
700
701 <seealso>
702 <manref name="amanda.conf" vol="5"/>,
703 <manref name="amanda-devices" vol="7"/>,
704 </seealso>
705
706
707 </refentry>