Imported Upstream version 3.1.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>This changer is not fast-search capable.</para>
187
188 <refsect3><title>Properties</title>
189 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
190
191 <variablelist>
192 <!-- ==== -->
193 <varlistentry><term>FIRST-SLOT</term><listitem>
194 This property gives the number of the first slot. The default value is "1".
195 </listitem></varlistentry>
196 <!-- ==== -->
197 </variablelist>
198
199 </refsect3>
200
201 <refsect3><title>Special Operations</title>
202
203 <para>A number of special operations are available for <command>chg-multi</command> via
204 <manref name="amtape" vol="8" /> subcommands.</para>
205
206 <para>The <command>reset</command> subcommand will change the current slot to
207 the first available slot, but does not erase any stored state maintained by the
208 changer.</para>
209
210 <para>The <command>eject</command> subcommand will eject the volume in the
211 given drive</para>
212
213 <para>The <command>clean</command> subcommand is not yet implemented.</para>
214
215 <para>The <command>update</command> subcommand instructs the changer to update
216 its state database.  Given no arguments, the changer will scan all available
217 slots, loading each tape and reading its label.  Especially for large libraries,
218 this can take a long time.  If only a few slots have changed, they can be listed
219 on the command line:
220 <programlisting>
221 amtape CONFIG update 1-3,9
222 </programlisting>
223 In this case, the changer will only scan the stated slots.  Finally, the changer
224 will not scan at all if it is given the tape label for the slot:
225 <programlisting>
226 amtape CONFIG update 2=DailySet-028
227 </programlisting>
228 In this case, the changer updates its state to indicate that
229 <computeroutput>DailySet-028</computeroutput> is in slot 2, without trying to
230 load the tape.
231 <programlisting>
232 amtape CONFIG update 1-3,9=
233 </programlisting>
234 In this case, the changer marks the stated slots as an unknown state.
235 </para>
236
237 </refsect3>
238
239 </refsect2>
240
241 <refsect2><title>chg-multi (old)</title>
242 <programlisting>
243 tpchanger "chg-multi"
244 changerfile "chg-multi-state"
245 </programlisting>
246
247 <para>This script simply round-robins a number of distinct device names, as
248 specified in its configuration file.  It is useful when all volumes for a
249 configuration have different device names -- for example, with S3 devices.
250 The <emphasis>changerfile</emphasis> need not exist; it is used as a prefix
251 for filenames of state files.
252 </para>
253
254 <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>
255
256 <variablelist>
257 <varlistentry><term>multieject</term><listitem>If this is 1, use an 'mt
258 offline' command to change to the next tape, or multiple such commands for
259 skipping several tapes at a time.
260 </listitem></varlistentry>
261
262 <varlistentry><term>needeject</term><listitem>This option is incompatible with
263 'multieject'. This should be 1 for changers accessed through several virtual
264 tape devices, when the changer needs the current tape to be ejected before
265 changing to another device.
266 </listitem></varlistentry>
267
268 <varlistentry><term>gravity</term><listitem>Set this to 1 if the
269 changer/stacker is unable to loop back to the first tape after unloading the
270 last one, or if you don't want amanda to go through the tape stack looking for
271 the exact tape it wants instead of using the first acceptable one.
272 </listitem></varlistentry>
273
274 <varlistentry><term>slot X</term><listitem>The configuration file should list
275 as many 'slot X' statements as the number of slots supported by the changer or
276 the number of separate tape drives used.
277 </listitem></varlistentry>
278 </variablelist>
279
280 <para>This changer is not fast-search capable.</para>
281
282 </refsect2>
283
284 <refsect2><title>chg-manual</title>
285 <programlisting>
286 tpchanger "chg-manual"
287 changerfile "chg-manual.conf"
288 </programlisting>
289
290 <para>This script simply provides distinct device names in a round-robin
291 fashion, as specified in its configuration file.  It is useful when all volumes
292 for a configuration have different device names -- for example, with S3
293 devices.  The configuration file parameters are (as listed in the script):
294 <programlisting>
295 resend_mail=900       # resend mail every __ seconds
296 timeout_mail=604800   # time out after this many seconds (default 7 days)
297 request="[type]"      # How to request a new tape (default "tty_email")
298   request="tty"       # Use the tty to ask the user to change tape.
299                       # Can't be use by cron
300   request="email"     # Send an email to ask the user to change tape.
301   request="tty_email" # Use the tty if it exist or send an email.
302 </programlisting>
303 </para>
304
305 <para>This changer is not fast-search capable.</para>
306
307 </refsect2>
308
309 <refsect2><title>chg-zd-mtx (old)</title>
310 <programlisting>
311 tpchanger "chg-zd-mtx"
312 changerdev "/dev/sg0"         # used with 'mtx -f'
313 changerfile "chg-zd-mtx.conf"
314 tapedev "tape:/dev/nst0"
315 </programlisting>
316
317 <para>This script interfaces with a tape drive using the Zubkoff/Dandelion
318 version of mtx.  That's the version that takes a device specifier with the
319 <command>-f</command> option and has subcommands like
320 <command>status</command>.  The configuration file parameters are (as listed in
321 the script itself):
322 <programlisting>
323 firstslot=?                 #### First storage slot (element)
324 lastslot=?                  #### Last storage slot (element)
325 cleanslot=-1                #### Slot with cleaner tape -- default is "-1"
326                             #### Set negative to indicate no cleaner available
327 driveslot=0                 #### Drive slot number.  Defaults to 0
328                             #### Use the 'Data Transfer Element' you want
329 autoclean=0                 #### Set to '1' or greater to enable
330 autocleancount=99           #### Number of access before a clean.
331 havereader=0                #### If you have a barcode reader, set to 1.
332 offline_before_unload=0     #### Does your robot require an
333                             #### 'mt offline' before mtx unload?
334 poll_drive_ready=NN         #### Time (seconds) between tests to see if
335                             #### the tape drive has gone ready (default: 3).
336 max_drive_wait=NN           #### Maximum time (seconds) to wait for the
337                             #### tape drive to become ready (default: 120).
338 initial_poll_delay=NN       #### initial delay after load before polling for
339                             #### readiness
340 slotinfofile=FILENAME       #### record slot information to this file, in
341                             #### the line-based format "SLOT LABEL\n"
342 </programlisting>
343 </para>
344
345 <para>This changer is fast-search capable if and only if
346 <command>havereader</command> is true.</para>
347
348 </refsect2>
349
350 <refsect2><title>chg-rait:{CHILD1,CHILD2,..}</title>
351 <programlisting>
352 define changer vtape {
353     tpcanger "chg-disk:/path/to/vtape"
354 }
355 define changer robot {
356     tpchanger "chg-robot:/dev/sg0"
357     tapedev "tape:/dev/nst0"
358 }
359 tpchanger "chg-rait:{vtape,robot}"
360 </programlisting>
361
362 <para>This changer script constructs RAIT devices out of the devices provided by several "sub-changers".  The sub-changers are specified using the same shell-like syntax as the RAIT device (see
363 <manref name="amanda-devices" vol="7"/>).</para>
364
365 <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>
366
367 <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>
368
369 <para>Drive names are parsed in a similar fashion, for operations that take drive names (clean and eject).</para>
370
371 <para>This changer is fast-search capable only if all of its child changers are fast-search capable.</para>
372
373 <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.
374 </note><!-- previous newline is important -->
375
376 </refsect2>
377
378 <refsect2><title>chg-null:</title>
379 <programlisting>
380 tpchanger "chg-null:"
381 </programlisting>
382
383 <para>This changer always provides the device "null:".  It is sometimes useful in conjunction with <command>chg-rait:</command>.</para>
384
385 </refsect2>
386
387 <refsect2><title>chg-robot:DEVICE</title>
388 <programlisting>
389 define changer robot {
390     tpchanger "chg-robot:/dev/sg0"
391     property "tape-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
392     property "eject-before-unload" "yes"
393     property "use-slots" "1-5,11-20"
394 }
395 tpchanger "robot"
396 </programlisting>
397
398 <para>This changer drives a robotic tape library using the operating system's
399 <command>mtx</command> command.  It replaces the ancient
400 <command>chg-zd-mtx</command> script.  The changer uses all of the information
401 available to operate as efficiently as possible.  Even without a barcode
402 reader, the changer can usually load a tape immediately, without resorting to a
403 sequential scan of many tapes.  It is capable of sharing state across multiple
404 Amanda configurations, avoiding conflicts and optimally tracking the contents
405 of the library.</para>
406
407 <para>This changer does not accept a <command>changerdev</command> parameter,
408 but the <command>changerfile</command> parameter can be used to specify a
409 filename at which it should store its state.  Ordinarily, this state is stored
410 in a file named after the changer device under
411 <emphasis>$localstatedir/amanda</emphasis>, e.g.,
412 <command>/var/amanda/chg-robot-dev-sg0</command>.  There should be a single
413 such statefile for each distinct tape library attached to the Amanda server, even
414 if multiple Amanda configurations reference that library.</para>
415
416 <para>With a barcode reader present, it is possible for
417 <command>chg-robot</command> to track the state of the library reliably, even
418 recognizing tapes that are removed and later re-inserted (by remembering their
419 barcodes).  Without barcodes, the changer can still remember the slot in which
420 it last saw the tape with a particular label, although this information can
421 become stale if the tapes are rearranged by an operator.  In any case, the
422 changer will never "hunt" for a tape by repeatedly loading slots and checking
423 labels.  If the changer's state is inaccurate, use the
424 <manref name="amtape" vol="8" /> subcommand <command>update</command>.</para>
425
426 <para>This changer is fast-search capable even without a barcode reader.  For
427 such libraries, it is the responsibility of the operator to
428 <command>update</command> the changer when tapes are added to or removed from
429 the library.</para>
430
431 <para>There is a shell script in the <filename>contrib/</filename> directory of
432 Amanda's source distribution which can help you convert a
433 <command>chg-zd-mtx</command> configuration into a <command>chg-robot</command>
434 configuration.  Just give it your Amanda configuration name:
435 <programlisting>
436   sh contrib/convert-zd-mtx-to-robot.sh $config
437 </programlisting>
438 The script can be downloaded at <uri
439 type="webpage">http://github.com/zmanda/amanda/raw/master/contrib/convert-zd-mtx-to-robot.sh</uri></para>
440
441 <refsect3><title>Special Operations</title>
442
443 <para>A number of special operations are available for <command>chg-robot</command> via
444 <manref name="amtape" vol="8" /> subcommands.</para>
445
446 <para>The <command>reset</command> subcommand will change the current slot to
447 the first available slot, but does not erase any stored state maintained by the
448 changer.</para>
449
450 <para>The <command>eject</command> subcommand will unload the volume in the
451 given drive, ejecting first if the changer properties dictate.  Note that,
452 despite the subcommand name, the changer attempts to avoid the state where a
453 volume has been ejected from the drive but not unloaded back to a storage
454 slot.</para>
455
456 <para>The <command>clean</command> subcommand is not yet implemented.</para>
457
458 <para>The <command>update</command> subcommand instructs the changer to update
459 its state database.  Given no arguments, the changer will scan all available
460 slots, loading each tape and reading its label.  Especially for large libraries,
461 this can take a long time.  If only a few slots have changed, they can be listed
462 on the command line:
463 <programlisting>
464 amtape CONFIG update 1-3,9
465 </programlisting>
466 In this case, the changer will only scan the stated slots.  Finally, the changer
467 will not scan at all if it is given the tape label for the slot:
468 <programlisting>
469 amtape CONFIG update 2=DailySet-028
470 </programlisting>
471 In this case, the changer updates its state to indicate that
472 <computeroutput>DailySet-028</computeroutput> is in slot 2, without trying to
473 load the tape.
474 <programlisting>
475 amtape CONFIG update 1-3,9=
476 </programlisting>
477 In this case, the changer marks the stated slots as an unknown state.
478 </para>
479
480 </refsect3>
481
482 <refsect3><title>Properties</title>
483 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
484
485 <variablelist>
486 <!-- ==== -->
487 <varlistentry><term>DRIVE-CHOICE</term><listitem>
488 This property controls the algorithm used to select a drive in which to load a
489 tape.  If set to the default ("lru"), the changer attempts to use the least
490 recently used drive, resulting in a round-robin behavior.  The "firstavail"
491 algorithm selects the first available drive, thus preferring the first drive
492 specified via the TAPE-DEVICE property.
493 </listitem></varlistentry>
494 <!-- ==== -->
495 <varlistentry><term>EJECT-BEFORE-UNLOAD</term><listitem>
496 Set this boolean property to true if the library requires an
497 <command>offline</command> operation be performed on the tape drive before it
498 can be unloaded.  If set, then <command>mt</command> will be invoked to
499 perform this operation.  Most libraries do not require this workaround.
500 </listitem></varlistentry>
501 <!-- ==== -->
502 <varlistentry><term>EJECT-DELAY</term><listitem>
503 This is the time between ejecting a tape and unloading the volume to a storage slot, and
504 defaults to 0 seconds.  It is only used if EJECT-BEFORE-UNLOAD is true.  See "Timing", below.
505 </listitem></varlistentry>
506 <!-- ==== -->
507 <varlistentry><term>FAST-SEARCH</term><listitem>
508 This boolean property indicates whether the changer advertises the ability to find
509 volumes without sequential scanning.  The traditional taperscan algorithm alters its
510 behavior based on this flag, so it is sometimes necessary to adjust it, although the
511 changer will always search for a desired tape using the most efficient means
512 available.  The default value is true.
513 </listitem></varlistentry>
514 <!-- ==== -->
515 <varlistentry><term>IGNORE-BARCODES</term><listitem>
516 If this boolean property is true, then chg-robot will ignore any barcode information
517 that the library provides.  This property is probably only useful when the library
518 returns incorrect barcodes, for example due to a malfunction in the barcode reader.
519 </listitem></varlistentry>
520 <!-- ==== -->
521 <varlistentry><term>LOAD-POLL</term><listitem>
522 <para>This property specifies the timing of Amanda's polling for the tape drive to
523 be ready after loading a new tape.  See "Timing", below.</para>
524
525 <para>The script "polls" by trying to open the tape device repeatedly until no
526 error is encountered.  The property specifies the time to wait before the first
527 poll (D), the frequency at which to poll and retry on errors (P); and the time
528 after which it should give up (U).  The format is
529 <programlisting>
530 "D [poll P [until U]]"
531 </programlisting>
532 For a simple delay with no polling, use e.g.,
533 <programlisting>
534 property "load-poll" "13s"
535 </programlisting>
536 To delay and then poll, use e.g.,
537 <programlisting>
538 property "load-poll" "13s poll 5s"
539 </programlisting>
540 and to add a maximum total time, use e.g.,
541 <programlisting>
542 property "load-poll" "0s poll 5s until 2m"
543 </programlisting>
544 The default value is <command>"0s poll 3s until 2m"</command>.
545 </para>
546 </listitem></varlistentry>
547 <!-- ==== -->
548 <varlistentry><term>MTX</term><listitem>
549 The path to the 'mtx' binary.  The default value is defined at compile time.
550 </listitem></varlistentry>
551 <!-- ==== -->
552 <varlistentry><term>STATUS-INTERVAL</term><listitem>
553 This is the minimum time between invocations of <command>mtx status</command>
554 to determine the state of the changer library.  The default value, 2 seconds,
555 avoids back-to-back status invocations but ensures that the metadata is up to
556 date.  For operating systems or libraries where the <command>mtx
557 status</command> takes a considerable time to complete, this value should be
558 increased.  See "Timing", below.
559 </listitem></varlistentry>
560 <!-- ==== -->
561 <varlistentry><term>TAPE-DEVICE</term><listitem>
562 This property describes the correspondance of drive numbers in the library to
563 Amanda devices, in the format <emphasis>DRIVE=DEVICE</emphasis>.  The property
564 can be specified multiple times to describe multiple devices.  The device will
565 usually be a tape device name starting with <command>tape:</command>, but may
566 also refer to a device alias (see <manref name="amanda-devices" vol="7"/>). As
567 a shortcut, if the <command>tapedev</command> parameter is specified in the
568 changer definition, then it is assumed to be the device name for drive 0.
569 </listitem></varlistentry>
570 <!-- ==== -->
571 <varlistentry><term>UNLOAD-DELAY</term><listitem>
572 This specifies the minimum time between an unload operation any any subsequent
573 operation.  The default value is 0 seconds.  See "Timing", below.
574 </listitem></varlistentry>
575 <!-- ==== -->
576 <varlistentry><term>USE-SLOTS</term><listitem>
577 This property, if specifies, enumerates the slots to which this changer should
578 limit itself.  The slots are specified as a comma-separated list of ranges,
579 e.g., "1-5,11-15,19,22".  The property can be specified more than once, and
580 the resulting sets will be combined.  The changer will refuse to load tapes
581 not found in these slots, except for import/export purposes.
582 </listitem></varlistentry>
583 </variablelist>
584 </refsect3>
585
586 <refsect3><title>Timing</title>
587
588 <para>Tape libraries are fickle, and in many cases will report that an
589 operation is complete when it is still in progress.  Chg-robot takes several
590 timing-related properties to accomodate such behavior.</para>
591
592 <para>A typical sequence of operations performed during a load are: get library
593 status, eject a tape, unload the tape back to a storage slot, load a new tape,
594 and read the label on that tape to ensure the drive is ready.</para>
595
596 <para>On most systems, the library status check is nearly instantaneous -- the
597 changer library provides its cached state to the host without initiating any
598 robot motion.  In order to keep its metadata up-to-date, chg-robot runs this
599 command very frequently, but this frequency can be reduced (at the cost of
600 potentially stale metadata) by setting the STATUS-INTERVAL property to a larger
601 value.</para>
602
603 <para>Some tape libraries do not integrate the eject operation (performed by
604 the embedded tape drive) with the unload operation (performed by the library
605 robot), and can actually cause physical damage by attempting to remove the tape
606 before the ejection is complete.  For such changers, set the EJECT-DELAY
607 property to allow enough time for the eject to complete.</para>
608
609 <para>Once a tape is unloaded, if the library needs time to "quiesce" before
610 processing another command, add that time to the UNLOAD-DELAY parameter.  No
611 other operations will be performed on the library until this delay has
612 elapsed.</para>
613
614 <para>Once a tape has been loaded, chg-robot waits until the drive is ready before
615 allowing Amanda to use the volume, as described for LOAD-POLL, above.</para>
616
617 <para>Each of the times specified in these properties may be given as integers
618 with the optional suffix <command>s</command> for seconds (the default) or
619 <command>m</command> for minutes.</para>
620
621 </refsect3>
622
623 </refsect2>
624
625 <refsect2><title>chg-ndmp:HOST[:PORT]@SCSIDEV</title>
626 <programlisting>
627     tpchanger "chg-ndmp:filer.company.com@/dev/sg0"
628     property        "tape-device" "0=ndmp:filer.company.com@/dev/rtape0"
629     property append "tape-device" "1=ndmp:filer.company.com@/dev/rtape1"
630     property "use-slots" "1-12"
631     property "ndmp-auth" "text"
632     property "ndmp-username" "luke"
633     property "ndmp-password" "leia"
634 </programlisting>
635
636 <para>This changer is very similar to <command>chg-robot</command>, but
637 controls a tape changer on an NDMP server instead of a local device.  The
638 <command>HOST</command> in the <command>tpchanger</command> should be the
639 hostname of the NDMP server.  The <command>PORT</command> is optional.  The
640 <command>SCSIDEV</command> should specify the SCSI device on the NDMP server
641 which controls the changer.  The format of this parameter is
642 implementation-specific.</para>
643
644 <para>The appropriate authentication properties will be automatically set on
645 any devices created by this changer.</para>
646
647 <refsect3><title>Properties</title>
648
649 <para>This changer supports all of the properties supported by
650 <command>chg-robot</command>, although the value of <command>MTX</command> is
651 ignored.  The following properties are also recognized:</para>
652
653 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
654 <variablelist>
655 <!-- ==== -->
656 <varlistentry><term>NDMP_AUTH</term><listitem>
657 Authentication method to use to connect to the NDMP server.  One of
658 "md5" (default), "text", "none" (for an empty authentication attempt) or "void" (for
659 no authentication attempt at all).
660 </listitem></varlistentry>
661 <!-- ==== -->
662 <varlistentry><term>NDMP-PASSWORD</term><listitem>
663 The password for the NDMP server.
664 </listitem></varlistentry>
665 <!-- ==== -->
666 <varlistentry><term>NDMP-USERNAME</term><listitem>
667 The username for the NDMP server.
668 </listitem></varlistentry>
669 <!-- ==== -->
670 </variablelist>
671
672 </refsect3>
673
674 </refsect2>
675
676 <refsect2><title>Unmaintained Changers</title>
677
678 <para>Amanda has many other changer scripts and programs beyond those described
679 here (see the <computeroutput>changer-src/</computeroutput> in the source
680 directory), but most of these scripts are unmaintained and undocumented, and
681 will be removed when the new changer API is fully implemented.</para>
682
683 </refsect2>
684
685 </refsect1>
686
687 <seealso>
688 <manref name="amanda.conf" vol="5"/>,
689 <manref name="amanda-devices" vol="7"/>,
690 </seealso>
691
692
693 </refentry>