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