2 .\" Title: amanda-changers
3 .\" Author: Dustin J. Mitchell <dustin@zmanda.com>
4 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
6 .\" Manual: Miscellanea
7 .\" Source: Amanda 3.2.1
10 .TH "AMANDA\-CHANGERS" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
16 .\" disable justification (adjust text to left margin only)
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
22 amanda-changers \- Configuring and Using Amanda Changers
25 Amanda uses changers to arbitrate access to devices (\fBamanda-devices\fR(7)) and data volumes\&. Changers provide an abstraction of tape robots, but are used to manage non\-tape media, too\&. Amanda communicates with changers through the Changer API\&. This manpage contains a
27 overview of the API, and does not address details that are only of concern to developers\&. For that purpose, consult the Amanda source code and http://wiki\&.zmanda\&.com\&.
30 The Amanda Changer API is in transition from version 1\&.0 \- driven by shell scripts invoked for each changer operation \- to version 2\&.0, composed of perl objects that can manage parallel access to multiple devices and other complexity\&. At this point, all Amanda programs use the new Changer API directly, although 1\&.0 changer scripts are still fully supported via
33 The Changer API strives to treat all changers identically, so that Amanda\'s behavior is independent of the changer in use\&. However, some parts of Amanda operate differently depending on whether a changer can efficiently search for a volume with a given label\&. This distinction is really only apparent with tape libraries: those with barcode readers can quickly find a desired tape, while those without may fall back to an inefficient scan of each volume\&. The capability to perform quick searches is called "fast\-search", and each changer is annotated below to indicate its support\&.
34 .SH "SPECIFYING CHANGERS"
36 Changer specifications are strings like
37 chg\-disk:/my/vtapes\&. The
39 prefix serves to differentiate changers from devices (see
40 \fBamanda-devices\fR(7))\&. The next portion (disk, in this case) identifies the particular changer driver to use, and everything that follows the
42 is interpreted by the driver\&. Note that the
44 character is required, even when nothing follows it\&. This is an easy way to distinguish new changer specifications from old\&.
46 A name which does not match this pattern, but which matches an old changer script (e\&.g\&.,
47 chg\-zd\-mtx), invokes the backward\-compatibility changer driver as e\&.g\&.,
48 chg\-compat:chg\-zd\-mtx\&. If the name does not match an old changer, then it is treated as an Amanda device, and is wrapped by the single\-device changer, e\&.g\&.,
49 chg\-single:tape:/dev/rmt/0\&.
51 Changers which require additional parameters can also be described in
53 with "changer" sections\&. Such a changer defininition creates a changer "alias", in this case named
54 \fIhp\-robot\fR, which can then be named where an application expects a changer \- for example, the target of the
56 command or in a global
61 The preferred method of specifying configuration for a changer is as a "changer" section in
62 \fBamanda.conf\fR(5)\&. The
64 parameter then indicates, by name, the changer that will be used by default by most Amanda programs\&. For example:
67 define changer hp\-robot {
68 tapedev "chg\-robot:/dev/sg1"
69 property "tape\-device" "0=tape:/dev/nst0"
70 property append "tape\-device" "1=tape:/dev/nst1"
71 device\-property "BLOCK_SIZE" "512k"
77 Several changer drivers accept
78 \fIchanger properties\fR
79 which control the behavior of the changer\&. These properties must be specified in a changer definition, as in the
83 Devices, too, can take properties to control their behavior (see
84 \fBamanda-devices\fR(7))\&. Device properties can come from four places: implicit device properties (from tapetype parameters), global device properties (from global
85 \fIdevice\-property\fR
86 parameters), properties in device definitions, and properties in changer definitions\&. Properties are applied in this order, with later properties taking priority\&.
88 There are only three implicit properties:
89 \fIMAX_VOLUME_USAGE\fR
90 is set based on the tapetype
102 Global device properties always apply\&. If the changer specifies a device by alias, then device properties from the definition apply\&. If the changer is specified by an alias, then properties from that definition applied\&.
103 .SH "CHANGER DRIVERS"
105 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\&.
106 .SS "chg\-disk:VTAPEROOT (new)"
108 tpchanger "chg\-disk:/u01/vtapes"
111 This changer driver replaces the old
112 \fBchg\-disk\fR, supporting parallel access to vtapes stored in directories named
114 in the directory specified after
115 chg\-disk:\&. It does so by creating numbered "drives" so that simultaneous processes can access distinct slots\&. This changer is fast\-search capable\&.
117 The current slot can be accessed using the device name
118 file:VTAPEROOT\&. This is useful for the
121 .SS "chg\-disk (old)"
123 tapedev "file:/u01/vtapes"
124 tpchanger "chg\-disk"
125 changerfile "chg\-disk\&.conf" # optional file
128 This changer script supports sequential access to vtapes stored in directories named
130 in the directory specified by the
132 parameter\&. The configuration file parameter is:
135 LASTSLOT=number # The number of slots, default to tapecycle setting\&.
138 This changer is not fast\-search capable\&.
139 .SS "chg\-multi:DEVICE\-LIST"
141 tpchanger "chg\-multi:{/dev/nst0,/dev/nst1,/dev/nst2}"
142 changerfile "chg\-multi\-state"
145 This script simply round\-robins a number of distinct device names, as specified in the
147 setting\&. It is useful when all volumes for a configuration have different device names \-\- for example, if you have many standalone drive\&. The
149 must exist; it is used to save the state file\&.
151 The child devices are specified using the same syntax as for the RAIT device (see
152 \fBamanda-changers\fR(7))\&. The range specification can be especially useful here:
155 tpchanger "chg\-multi:s3:mycompany\-backups/tape\-{001\&.\&.100}"
158 This changer is not fast\-search capable\&.
164 This property gives the number of the first slot\&. The default value is "1"\&.
166 .SS "Special Operations"
168 A number of special operations are available for
176 subcommand will change the current slot to the first available slot, but does not erase any stored state maintained by the changer\&.
180 subcommand will eject the volume in the given drive
184 subcommand is not yet implemented\&.
188 subcommand instructs the changer to update its state database\&. Given no arguments, the changer will scan all available slots, loading each tape and reading its label\&. Especially for large libraries, this can take a long time\&. If only a few slots have changed, they can be listed on the command line:
191 amtape CONFIG update 1\-3,9
193 In this case, the changer will only scan the stated slots\&. Finally, the changer will not scan at all if it is given the tape label for the slot:
196 amtape CONFIG update 2=DailySet\-028
198 In this case, the changer updates its state to indicate that
200 is in slot 2, without trying to load the tape\&.
203 amtape CONFIG update 1\-3,9=
205 In this case, the changer marks the stated slots as an unknown state\&.
206 .SS "chg\-multi (old)"
208 tpchanger "chg\-multi"
209 changerfile "chg\-multi\-state"
212 This script simply round\-robins a number of distinct device names, as specified in its configuration file\&. It is useful when all volumes for a configuration have different device names \-\- for example, with S3 devices\&. The
214 need not exist; it is used as a prefix for filenames of state files\&.
216 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:
220 If this is 1, use an \'mt
221 offline\' command to change to the next tape, or multiple such commands for
222 skipping several tapes at a time\&.
227 This option is incompatible with
228 \'multieject\'\&. This should be 1 for changers accessed through several virtual
229 tape devices, when the changer needs the current tape to be ejected before
230 changing to another device\&.
236 changer/stacker is unable to loop back to the first tape after unloading the
237 last one, or if you don\'t want amanda to go through the tape stack looking for
238 the exact tape it wants instead of using the first acceptable one\&.
243 The configuration file should list
244 as many \'slot X\' statements as the number of slots supported by the changer or
245 the number of separate tape drives used\&.
248 This changer is not fast\-search capable\&.
251 tpchanger "chg\-manual"
252 changerfile "chg\-manual\&.conf"
255 This script simply provides distinct device names in a round\-robin fashion, as specified in its configuration file\&. It is useful when all volumes for a configuration have different device names \-\- for example, with S3 devices\&. The configuration file parameters are (as listed in the script):
258 resend_mail=900 # resend mail every __ seconds
259 timeout_mail=604800 # time out after this many seconds (default 7 days)
260 request="[type]" # How to request a new tape (default "tty_email")
261 request="tty" # Use the tty to ask the user to change tape\&.
262 # Can\'t be use by cron
263 request="email" # Send an email to ask the user to change tape\&.
264 request="tty_email" # Use the tty if it exist or send an email\&.
267 This changer is not fast\-search capable\&.
268 .SS "chg\-zd\-mtx (old)"
270 tpchanger "chg\-zd\-mtx"
271 changerdev "/dev/sg0" # used with \'mtx \-f\'
272 changerfile "chg\-zd\-mtx\&.conf"
273 tapedev "tape:/dev/nst0"
276 This script interfaces with a tape drive using the Zubkoff/Dandelion version of mtx\&. That\'s the version that takes a device specifier with the
278 option and has subcommands like
279 \fBstatus\fR\&. The configuration file parameters are (as listed in the script itself):
282 firstslot=? #### First storage slot (element)
283 lastslot=? #### Last storage slot (element)
284 cleanslot=\-1 #### Slot with cleaner tape \-\- default is "\-1"
285 #### Set negative to indicate no cleaner available
286 driveslot=0 #### Drive slot number\&. Defaults to 0
287 #### Use the \'Data Transfer Element\' you want
288 autoclean=0 #### Set to \'1\' or greater to enable
289 autocleancount=99 #### Number of access before a clean\&.
290 havereader=0 #### If you have a barcode reader, set to 1\&.
291 offline_before_unload=0 #### Does your robot require an
292 #### \'mt offline\' before mtx unload?
293 poll_drive_ready=NN #### Time (seconds) between tests to see if
294 #### the tape drive has gone ready (default: 3)\&.
295 max_drive_wait=NN #### Maximum time (seconds) to wait for the
296 #### tape drive to become ready (default: 120)\&.
297 initial_poll_delay=NN #### initial delay after load before polling for
299 slotinfofile=FILENAME #### record slot information to this file, in
300 #### the line\-based format "SLOT LABEL\en"
303 This changer is fast\-search capable if and only if
306 .SS "chg\-rait:{CHILD1,CHILD2,\&.\&.}"
308 define changer vtape {
309 tpcanger "chg\-disk:/path/to/vtape"
311 define changer robot {
312 tpchanger "chg\-robot:/dev/sg0"
313 tapedev "tape:/dev/nst0"
315 tpchanger "chg\-rait:{vtape,robot}"
318 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
319 \fBamanda-devices\fR(7))\&.
321 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 "top", "strange", and "3", then the RAIT changer will return "{top,strange,3}"\&. 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
323 child changers (and, naturally, two tape drives)\&. In this arrangement, the first slot would be named
326 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, "17" is equivalent to "{17,17,17,17}"\&.
328 Drive names are parsed in a similar fashion, for operations that take drive names (clean and eject)\&.
330 This changer is fast\-search capable only if all of its child changers are fast\-search capable\&.
336 .nr an-no-space-flag 1
343 The old chg\-rait script is no longer supported nor shipped with Amanda, although the old script will continue to function via \fBchg\-compat\fR, giving users time to upgrade their configuration\&.
348 tpchanger "chg\-null:"
351 This changer always provides the device "null:"\&. It is sometimes useful in conjunction with
353 .SS "chg\-robot:DEVICE"
355 define changer robot {
356 tpchanger "chg\-robot:/dev/sg0"
357 property "tape\-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
358 property "eject\-before\-unload" "yes"
359 property "use\-slots" "1\-5,11\-20"
364 This changer drives a robotic tape library using the operating system\'s
366 command\&. It replaces the ancient
368 script\&. The changer uses all of the information available to operate as efficiently as possible\&. Even without a barcode reader, the changer can usually load a tape immediately, without resorting to a sequential scan of many tapes\&. It is capable of sharing state across multiple Amanda configurations, avoiding conflicts and optimally tracking the contents of the library\&.
370 This changer does not accept a
374 parameter can be used to specify a filename at which it should store its state\&. Ordinarily, this state is stored in a file named after the changer device under
375 \fI$localstatedir/amanda\fR, e\&.g\&.,
376 \fB/var/amanda/chg\-robot\-dev\-sg0\fR\&. There should be a single such statefile for each distinct tape library attached to the Amanda server, even if multiple Amanda configurations reference that library\&.
378 With a barcode reader present, it is possible for
380 to track the state of the library reliably, even recognizing tapes that are removed and later re\-inserted (by remembering their barcodes)\&. Without barcodes, the changer can still remember the slot in which it last saw the tape with a particular label, although this information can become stale if the tapes are rearranged by an operator\&. In any case, the changer will never "hunt" for a tape by repeatedly loading slots and checking labels\&. If the changer\'s state is inaccurate, use the
385 This changer is fast\-search capable even without a barcode reader\&. For such libraries, it is the responsibility of the operator to
387 the changer when tapes are added to or removed from the library\&.
389 There is a shell script in the
391 directory of Amanda\'s source distribution which can help you convert a
395 configuration\&. Just give it your Amanda configuration name:
398 sh contrib/convert\-zd\-mtx\-to\-robot\&.sh $config
400 The script can be downloaded at
401 http://github\&.com/zmanda/amanda/raw/master/contrib/convert\-zd\-mtx\-to\-robot\&.sh
402 .SS "Special Operations"
404 A number of special operations are available for
412 subcommand will change the current slot to the first available slot, but does not erase any stored state maintained by the changer\&.
416 subcommand will unload the volume in the given drive, ejecting first if the changer properties dictate\&. Note that, despite the subcommand name, the changer attempts to avoid the state where a volume has been ejected from the drive but not unloaded back to a storage slot\&.
420 subcommand is not yet implemented\&.
424 subcommand instructs the changer to update its state database\&. Given no arguments, the changer will scan all available slots, loading each tape and reading its label\&. Especially for large libraries, this can take a long time\&. If only a few slots have changed, they can be listed on the command line:
427 amtape CONFIG update 1\-3,9
429 In this case, the changer will only scan the stated slots\&. Finally, the changer will not scan at all if it is given the tape label for the slot:
432 amtape CONFIG update 2=DailySet\-028
434 In this case, the changer updates its state to indicate that
436 is in slot 2, without trying to load the tape\&.
439 amtape CONFIG update 1\-3,9=
441 In this case, the changer marks the stated slots as an unknown state\&.
447 This property controls the algorithm used to select a drive in which to load a
448 tape\&. If set to the default ("lru"), the changer attempts to use the least
449 recently used drive, resulting in a round\-robin behavior\&. The "firstavail"
450 algorithm selects the first available drive, thus preferring the first drive
451 specified via the TAPE\-DEVICE property\&.
454 EJECT\-BEFORE\-UNLOAD
457 Set this boolean property to true if the library requires an
458 \fBoffline\fR operation be performed on the tape drive before it
459 can be unloaded\&. If set, then \fBmt\fR will be invoked to
460 perform this operation\&. Most libraries do not require this workaround\&.
466 This is the time between ejecting a tape and unloading the volume to a storage slot, and
467 defaults to 0 seconds\&. It is only used if EJECT\-BEFORE\-UNLOAD is true\&. See "Timing", below\&.
473 This boolean property indicates whether the changer advertises the ability to find
474 volumes without sequential scanning\&. The traditional taperscan algorithm alters its
475 behavior based on this flag, so it is sometimes necessary to adjust it, although the
476 changer will always search for a desired tape using the most efficient means
477 available\&. The default value is true\&.
483 If this boolean property is true, then chg\-robot will ignore any barcode information
484 that the library provides\&. This property is probably only useful when the library
485 returns incorrect barcodes, for example due to a malfunction in the barcode reader\&.
490 This property specifies the timing of Amanda\'s polling for the tape drive to be ready after loading a new tape\&. See "Timing", below\&.
492 The script "polls" by trying to open the tape device repeatedly until no error is encountered\&. The property specifies the time to wait before the first poll (D), the frequency at which to poll and retry on errors (P); and the time after which it should give up (U)\&. The format is
495 "D [poll P [until U]]"
497 For a simple delay with no polling, use e\&.g\&.,
500 property "load\-poll" "13s"
502 To delay and then poll, use e\&.g\&.,
505 property "load\-poll" "13s poll 5s"
507 and to add a maximum total time, use e\&.g\&.,
510 property "load\-poll" "0s poll 5s until 2m"
513 \fB"0s poll 3s until 2m"\fR\&.
519 The path to the \'mtx\' binary\&. The default value is defined at compile time\&.
525 This is the minimum time between invocations of \fBmtx status\fR
526 to determine the state of the changer library\&. The default value, 2 seconds,
527 avoids back\-to\-back status invocations but ensures that the metadata is up to
528 date\&. For operating systems or libraries where the \fBmtx
529 status\fR takes a considerable time to complete, this value should be
530 increased\&. See "Timing", below\&.
536 This property describes the correspondance of drive numbers in the library to
537 Amanda devices, in the format \fIDRIVE=DEVICE\fR\&. The property
538 can be specified multiple times to describe multiple devices\&. The device will
539 usually be a tape device name starting with \fBtape:\fR, but may
540 also refer to a device alias (see \fBamanda-devices\fR(7))\&. As
541 a shortcut, if the \fBtapedev\fR parameter is specified in the
542 changer definition, then it is assumed to be the device name for drive 0\&.
548 This specifies the minimum time between an unload operation any any subsequent
549 operation\&. The default value is 0 seconds\&. See "Timing", below\&.
555 This property, if specifies, enumerates the slots to which this changer should
556 limit itself\&. The slots are specified as a comma\-separated list of ranges,
557 e\&.g\&., "1\-5,11\-15,19,22"\&. The property can be specified more than once, and
558 the resulting sets will be combined\&. The changer will refuse to load tapes
559 not found in these slots, except for import/export purposes\&.
563 Tape libraries are fickle, and in many cases will report that an operation is complete when it is still in progress\&. Chg\-robot takes several timing\-related properties to accomodate such behavior\&.
565 A typical sequence of operations performed during a load are: get library status, eject a tape, unload the tape back to a storage slot, load a new tape, and read the label on that tape to ensure the drive is ready\&.
567 On most systems, the library status check is nearly instantaneous \-\- the changer library provides its cached state to the host without initiating any robot motion\&. In order to keep its metadata up\-to\-date, chg\-robot runs this command very frequently, but this frequency can be reduced (at the cost of potentially stale metadata) by setting the STATUS\-INTERVAL property to a larger value\&.
569 Some tape libraries do not integrate the eject operation (performed by the embedded tape drive) with the unload operation (performed by the library robot), and can actually cause physical damage by attempting to remove the tape before the ejection is complete\&. For such changers, set the EJECT\-DELAY property to allow enough time for the eject to complete\&.
571 Once a tape is unloaded, if the library needs time to "quiesce" before processing another command, add that time to the UNLOAD\-DELAY parameter\&. No other operations will be performed on the library until this delay has elapsed\&.
573 Once a tape has been loaded, chg\-robot waits until the drive is ready before allowing Amanda to use the volume, as described for LOAD\-POLL, above\&.
575 Each of the times specified in these properties may be given as integers with the optional suffix
577 for seconds (the default) or
580 .SS "chg\-ndmp:HOST[:PORT]@SCSIDEV"
582 tpchanger "chg\-ndmp:filer\&.company\&.com@/dev/sg0"
583 property "tape\-device" "0=ndmp:filer\&.company\&.com@/dev/rtape0"
584 property append "tape\-device" "1=ndmp:filer\&.company\&.com@/dev/rtape1"
585 property "use\-slots" "1\-12"
586 property "ndmp\-auth" "text"
587 property "ndmp\-username" "luke"
588 property "ndmp\-password" "leia"
591 This changer is very similar to
592 \fBchg\-robot\fR, but controls a tape changer on an NDMP server instead of a local device\&. The
596 should be the hostname of the NDMP server\&. The
600 should specify the SCSI device on the NDMP server which controls the changer\&. The format of this parameter is implementation\-specific\&.
602 The appropriate authentication properties will be automatically set on any devices created by this changer\&.
605 This changer supports all of the properties supported by
606 \fBchg\-robot\fR, although the value of
608 is ignored\&. The following properties are also recognized:
613 Authentication method to use to connect to the NDMP server\&. One of
614 "md5" (default), "text", "none" (for an empty authentication attempt) or "void" (for
615 no authentication attempt at all)\&.
621 The password for the NDMP server\&.
627 The username for the NDMP server\&.
633 If true, enables the NDMJOB library\'s verbose (packet\-level) debugging\&.
635 .SS "Unmaintained Changers"
637 Amanda has many other changer scripts and programs beyond those described here (see the
639 in the source directory), but most of these scripts are unmaintained and undocumented, and will be removed when the new changer API is fully implemented\&.
643 \fBamanda.conf\fR(5),
644 \fBamanda-devices\fR(7)
647 : http://wiki.zmanda.com/
650 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
652 Zmanda, Inc\&. (http://www\&.zmanda\&.com)