Re: error whith amlabel and chg-rait
chg-rait and chg-robot do not use meta label, don't try to set it. Only chg-disk use meta-label. The barcode is the combination of all barcodes, as the inventory told you, the barcode is '{D00225,D00225}' amlabel -f --barcode '{D00225,D00225}' mirror The same is true for the slot number, you could do: amlabel -f mirror slot '{225,225}' It is not required to put the same barcode on both tape, it is generally a bad idea to do so, a barcode must be unique. Jean-Louis On 06/27/2013 07:37 AM, Dennis Benndorf wrote: Hello, I am trying to set up a mirror of too robots using chg-rait. Tapes in both robots have the same barcodes. Now I want to label them with the name of their barcodes, but the following happens: amanda@dl380-54:~$ amlabel -f --meta META225 --barcode D00225 mirror Reading label... No volume with barcode 'D00225' available amanda@dl380-54:~$ amtape mirror inventory |grep 225 slot {225,225}: label D00225 barcode {D00225,D00225} (in drive {1,1}) amanda@dl380-54:~$ amlabel -f --meta META225 --barcode D00225 mirror Reading label... No volume with barcode 'D00225' available amanda@dl380-54:~$ amlabel -f --barcode D00225 mirror Reading label... No volume with barcode 'D00225' available amanda@dl380-54:~$ amlabel -f mirror^C amanda@dl380-54:~$ man amanda.conf amanda@dl380-54:~$ amlabel -f -o meta-autolabel=META%%% --barcode D00225 mirror Reading label... No volume with barcode 'D00225' available amanda@dl380-54:~$ amlabel -f -o meta-autolabel=META%%% mirror slot 225 Reading label... Found Amanda volume 'D00225'. amlabel: Can't call method make_new_meta_label on an undefined value at /usr/local/share/perl/5.14.2/Amanda/Changer.pm line 1632. What I really want to do is to force both sites to label ( one site has a different label as you can see ) amanda@dl380-54:~$ amlabel -f -o meta-autolabel=META%%% mirror slot 457 Reading label... Error reading volume label: Inconsistent volume labels/datestamps: Got D00457/20130408180904 on tape:/dev/L700/MRO-LW-1 against D10068/20130508071050 on tape:/dev/L700/OPELHAUS-LW-1. amlabel: Can't call method make_new_meta_label on an undefined value at /usr/local/share/perl/5.14.2/Amanda/Changer.pm line 1632. -- Regards Dennis
Re: error whith amlabel and chg-rait
grep meta-autolabel /etc/amanda/mirror/amanda.conf show nothing. -- Regards Dennis Benndorf Dennis, Do you have 'meta-autolabel' set in your amanda.conf? unset it. Jean-Louis On 06/27/2013 08:33 AM, Dennis Benndorf wrote: Ok I understand but why does it tell me those messages: amanda@dl380-54:~$ amlabel -f mirror slot '{225,225}' Reading label... Found Amanda volume 'D00225'. amlabel: Can't call method make_new_meta_label on an undefined value at /usr/local/share/perl/5.14.2/Amanda/Changer.pm line 1632. amanda@dl380-54:~$ amlabel -f --barcode '{D00225,D00225}' mirror Reading label... Found Amanda volume 'D00225'. amlabel: Can't call method make_new_meta_label on an undefined value at /usr/local/share/perl/5.14.2/Amanda/Changer.pm line 1632. Regards Dennis Am Donnerstag, 27. Juni 2013, 07:58:19 schrieb Jean-Louis Martineau: chg-rait and chg-robot do not use meta label, don't try to set it. Only chg-disk use meta-label. The barcode is the combination of all barcodes, as the inventory told you, the barcode is '{D00225,D00225}' amlabel -f --barcode '{D00225,D00225}' mirror The same is true for the slot number, you could do: amlabel -f mirror slot '{225,225}' It is not required to put the same barcode on both tape, it is generally a bad idea to do so, a barcode must be unique. Jean-Louis
Re: error whith amlabel and chg-rait
Dennis, Try the attached patch. You can patch the installed Amanda/Changer/rait.pm file. Jean-Louis On 06/27/2013 08:41 AM, Dennis Benndorf wrote: grep meta-autolabel /etc/amanda/mirror/amanda.conf show nothing. -- Regards Dennis Benndorf Am Donnerstag, 27. Juni 2013, 08:39:11 schrieb Jean-Louis Martineau: Dennis, Do you have 'meta-autolabel' set in your amanda.conf? unset it. Jean-Louis On 06/27/2013 08:33 AM, Dennis Benndorf wrote: Ok I understand but why does it tell me those messages: amanda@dl380-54:~$ amlabel -f mirror slot '{225,225}' Reading label... Found Amanda volume 'D00225'. amlabel: Can't call method make_new_meta_label on an undefined value at /usr/local/share/perl/5.14.2/Amanda/Changer.pm line 1632. amanda@dl380-54:~$ amlabel -f --barcode '{D00225,D00225}' mirror Reading label... Found Amanda volume 'D00225'. amlabel: Can't call method make_new_meta_label on an undefined value at /usr/local/share/perl/5.14.2/Amanda/Changer.pm line 1632. Regards Dennis Am Donnerstag, 27. Juni 2013, 07:58:19 schrieb Jean-Louis Martineau: chg-rait and chg-robot do not use meta label, don't try to set it. Only chg-disk use meta-label. The barcode is the combination of all barcodes, as the inventory told you, the barcode is '{D00225,D00225}' amlabel -f --barcode '{D00225,D00225}' mirror The same is true for the slot number, you could do: amlabel -f mirror slot '{225,225}' It is not required to put the same barcode on both tape, it is generally a bad idea to do so, a barcode must be unique. Jean-Louis diff --git a/perl/Amanda/Changer/rait.pm b/perl/Amanda/Changer/rait.pm index e0ef276..d6ba1dd 100644 --- a/perl/Amanda/Changer/rait.pm +++ b/perl/Amanda/Changer/rait.pm @@ -268,6 +268,7 @@ sub _make_res { } my $combined_res = Amanda::Changer::rait::Reservation-new( + $self, $kid_reservations, $rait_device); $rait_device-read_label(); @@ -676,9 +677,11 @@ sub errmap (@) { sub new { my $class = shift; -my ($child_reservations, $rait_device) = @_; +my ($chg, $child_reservations, $rait_device) = @_; my $self = Amanda::Changer::Reservation::new($class); +$self-{'chg'} = $chg; + # note that $child_reservations may contain ERROR in place of a reservation $self-{'child_reservations'} = $child_reservations;
Re: error whith amlabel and chg-rait
Hi, amanda@dl380-54:~$ amlabel -f mirror slot '{225,225}' Reading label... Found Amanda volume 'D00225'. Newly-generated label '' does not match labelstr '^D0[0-9]*$' Dont know why this happend, because labelstr is set to ^D0[0-9]*$ and autolabel to $b any . but if I set it by hand it works as expected: amanda@dl380-54:~$ amlabel -f mirror D00225 slot '{225,225}' Reading label... Found Amanda volume 'D00225'. Writing label 'D00225'... Checking label... Success! amanda@dl380-54:~$ cat /etc/amanda/mirror/tapelist 0 D00225 reuse BLOCKSIZE:32 -- Big thanks, Dennis Dennis, Try the attached patch. You can patch the installed Amanda/Changer/rait.pm file. Jean-Louis
Re: error whith amlabel and chg-rait
Dennis, Try the attached patch. The barcode for the rait is '{D00225,D00225}', You must adjust the labelstr. Jean-Louis On 06/27/2013 10:30 AM, Dennis Benndorf wrote: Hi, amanda@dl380-54:~$ amlabel -f mirror slot '{225,225}' Reading label... Found Amanda volume 'D00225'. Newly-generated label '' does not match labelstr '^D0[0-9]*$' Dont know why this happend, because labelstr is set to ^D0[0-9]*$ and autolabel to $b any . but if I set it by hand it works as expected: amanda@dl380-54:~$ amlabel -f mirror D00225 slot '{225,225}' Reading label... Found Amanda volume 'D00225'. Writing label 'D00225'... Checking label... Success! amanda@dl380-54:~$ cat /etc/amanda/mirror/tapelist 0 D00225 reuse BLOCKSIZE:32 -- Big thanks, Dennis Am Donnerstag, 27. Juni 2013, 10:10:09 schrieb Jean-Louis Martineau: Dennis, Try the attached patch. You can patch the installed Amanda/Changer/rait.pm file. Jean-Louis diff --git a/perl/Amanda/Changer/rait.pm b/perl/Amanda/Changer/rait.pm index d6ba1dd..2234a2e 100644 --- a/perl/Amanda/Changer/rait.pm +++ b/perl/Amanda/Changer/rait.pm @@ -687,6 +687,8 @@ sub new { $self-{'child_reservations'} = $child_reservations; $self-{'device'} = $rait_device; +my @barcodes = errmap { . $_-{'barcode'} } @$child_reservations; +$self-{'barcode'} = collapse_braced_alternates(\@barcodes); my @slot_names; @slot_names = errmap { . $_-{'this_slot'} } @$child_reservations;