view release on metacpan or search on metacpan
the headers always print the name first, and we were assuming that the
id argument was the volume name, when it can also be the volume ID.
The parsing is less strict now, and works for both a volume name od a
numeric ID.
=head1 Changes in 1.6
=head1 Enhancements
=head1 AFS::Object::VolumeHeader: new attribute 'attached'
When a volume's status is "offline", there is really more than one
status the volume can be in. A volume might be unattached, and
offline, or it might be attached, but adminitratively offline. For
example, "vos offline" put a vlume in the latter state, and if for
some reason there are two volumes with the same ID on the same
fileserver, they will both be attached (if possible), but only the
first one encountered will be brought online.
Changing the value of status would been a non-backwards compatible
change, and caused some subtle problems for some applications. Rather
than introduce such a change, I have chosen to represent this state
with an additional attribute "attached", which is just a Boolean,
indicating whether or not the volume is attached.
=head1 Bugs
=head1 Changes in 1.5
=head1 Enhancements
=head2 Principal names, as user supplied arguments, are lowercased
As a convenience, when PTS names are passed to methods like
Likewise, when offline, one of:
offline
Off-line
These values have all been normalized to: online, offline
=head2 AFS::Command::VOS->examine parses busy and offline messages
When a volume is busy or can not be attached, "vos examine" will be
unable to display the volume headers. Instead, a one line message is
printed, such as one of the following:
**** Volume 123456789 is busy ****
**** Could not attach volume 123456789 ****
The examine method now parses these, and the AFS::Object::VolumeHeader
object will have only the 'id' and 'status' attributes. Previously,
those lines were incorrectly parsed and the 'name' attribute set to
'****', which is pretty obviously wrong.
=head1 Changes in 1.3
Changes.html view on Meta::CPAN
</UL>
<LI><A HREF="#Bugs">Bugs</A>
<UL>
<LI><A HREF="#vos_examine_by_numeric_ID_did_no">vos examine by numeric ID did not parse Volume Headers</A>
</UL>
<LI><A HREF="#Changes_in_1_6">Changes in 1.6</A>
<LI><A HREF="#Enhancements">Enhancements</A>
<LI><A HREF="#AFS_Object_VolumeHeader_new_a">AFS::Object::VolumeHeader: new attribute 'attached'</A>
<LI><A HREF="#Bugs">Bugs</A>
<LI><A HREF="#Changes_in_1_5">Changes in 1.5</A>
<LI><A HREF="#Enhancements">Enhancements</A>
<UL>
<LI><A HREF="#Principal_names_as_user_supplie">Principal names, as user supplied arguments, are lowercased</A>
<LI><A HREF="#AFS_Command_VOS_restore_argum">AFS::Command::VOS->restore arguments added</A>
</UL>
<LI><A HREF="#Bugs">Bugs</A>
Changes.html view on Meta::CPAN
<H1><A NAME="Changes_in_1_6">Changes in 1.6
</A></H1>
<P>
<HR>
<H1><A NAME="Enhancements">Enhancements
</A></H1>
<P>
<HR>
<H1><A NAME="AFS_Object_VolumeHeader_new_a">AFS::Object::VolumeHeader: new attribute 'attached'
</A></H1>
When a volume's status is ``offline'', there is really more than one status
the volume can be in. A volume might be unattached, and offline, or it
might be attached, but adminitratively offline. For example, ``vos
offline'' put a vlume in the latter state, and if for some reason there are
two volumes with the same ID on the same fileserver, they will both be
attached (if possible), but only the first one encountered will be brought
online.
<P>
Changing the value of status would been a non-backwards compatible change,
and caused some subtle problems for some applications. Rather than
introduce such a change, I have chosen to represent this state with an
additional attribute ``attached'', which is just a Boolean, indicating
whether or not the volume is attached.
<P>
<P>
<HR>
<H1><A NAME="Bugs">Bugs
</A></H1>
<P>
Changes.html view on Meta::CPAN
These values have all been normalized to: online, offline
<P>
<P>
<HR>
<H2><A NAME="AFS_Command_VOS_examine_parse">AFS::Command::VOS->examine parses busy and offline messages
</A></H2>
When a volume is busy or can not be attached, ``vos examine'' will be
unable to display the volume headers. Instead, a one line message is
printed, such as one of the following:
<P>
<PRE> **** Volume 123456789 is busy ****
**** Could not attach volume 123456789 ****
</PRE>
<P>
The examine method now parses these, and the AFS::Object::VolumeHeader
object will have only the 'id' and 'status' attributes. Previously, those
lines were incorrectly parsed and the 'name' attribute set to '****', which
is pretty obviously wrong.
lib/AFS/Command.pod view on Meta::CPAN
The subclasses for encapsulating the bosserver data are:
AFS::Object::BosServer
AFS::Object::Instance
Note that none of these classes are specifically documented, since the
structure of the classes is subject to change. The API for accessin
the results of any given AFS command (eg. vos listvol) is considered
reasonably stable, but the encapsulation may change radically.
Don't get too attached to these class names, because they will likely
be rearranged in a future release.
=cut
lib/AFS/Command/BOS.pod view on Meta::CPAN
=head2 salvage
The bos help string is:
bos salvage: salvage partition or volumes
Usage: bos salvage -server <machine name> [-partition <salvage partition>]
[-volume <salvage volume number or volume name>]
[-file <salvage log output file>] [-all] [-showlog]
[-parallel <# of max parallel partition salvaging>]
[-tmpdir <directory to place tmp files>]
[-orphans <ignore | remove | attach>] [-debug] [-nowrite]
[-force] [-oktozap] [-rootfiles] [-salvagedirs] [-blockreads]
[-ListResidencies] [-SalvageRemote] [-SalvageArchival]
[-IgnoreCheck] [-ForceOnLine] [-UseRootDirACL]
[-TraceBadLinkCounts] [-DontAskFS] [-LogLevel <(MR-AFS) log level>]
[-rxdebug] [-cell <cell name>] [-noauth] [-localauth]
Where: -all salvage whole server
-showlog display salvage log
-debug (MR-AFS) Run in Debugging mode
-nowrite (MR-AFS) Run readonly/test mode
-force (MR-AFS) Force full salvaging
-oktozap (MR-AFS) Give permission to destroy bogus file residencies/volumes - debugging flag
-rootfiles (MR-AFS) Show files owned by root - debugging flag
-salvagedirs (MR-AFS) Force rebuild/salvage of all directories
-blockreads (MR-AFS) Read smaller blocks to handle IO/bad blocks
-ListResidencies (MR-AFS) Just list affected file residencies - debugging flag
-SalvageRemote (MR-AFS) Salvage storage systems that are not directly attached
-SalvageArchival (MR-AFS) Salvage HSM storage systems
-IgnoreCheck (MR-AFS) Don't perform VLDB safety check when deleting unreferenced files.
Only a good idea in single server cell.
-ForceOnLine (MR-AFS) Force the volume to come online, even if it hasn't salvaged cleanly.
-UseRootDirACL (MR-AFS) Use the root directory ACL for lost+found directory if it is created.
-TraceBadLinkCounts (MR-AFS) Print out lines about volume reference count changes.
-DontAskFS (MR-AFS) Don't ask fileserver to take volume offline. THIS IS VERY DANGEROUS.
-rxdebug (MR-AFS) Write out rx debug information.
The corresponding method invocation looks like:
lib/AFS/Command/VOS.pm view on Meta::CPAN
#
if ( /^\*{4}/ ) {
my $header = AFS::Object::VolumeHeader->new();
if ( /Volume (\d+) is busy/ ) {
$header->_setAttribute
(
id => $1,
status => 'busy',
attached => 1,
);
} elsif ( /Could not attach volume (\d+)/ ) {
$header->_setAttribute
(
id => $1,
status => 'offline',
attached => 0,
);
}
$result->_addVolumeHeader($header);
next;
} elsif ( /^(\S+)\s+(\d+)\s+(RW|RO|BK)\s+(\d+)\s+K/ ) {
my $header = AFS::Object::VolumeHeader->new();
lib/AFS/Command/VOS.pm view on Meta::CPAN
$header->_setAttribute( rwrite => $2 ) if $3 eq 'RW';
$header->_setAttribute( ronly => $2 ) if $3 eq 'RO';
$header->_setAttribute( backup => $2 ) if $3 eq 'BK';
my $status = $5;
$status = 'offline' if $status eq 'Off-line';
$status = 'online' if $status eq 'On-line';
$header->_setAttribute
(
status => $status,
attached => 1,
);
} elsif ( /^(\S+)\s+(\d+)\s+(RW|RO|BK)\s+(\d+)\s+K\s+used\s+(\d+)\s+files\s+([\w-]+)/ ) {
$header->_setAttribute
(
name => $1,
id => $2,
type => $3,
size => $4,
lib/AFS/Command/VOS.pm view on Meta::CPAN
$header->_setAttribute( rwrite => $2 ) if $3 eq 'RW';
$header->_setAttribute( ronly => $2 ) if $3 eq 'RO';
$header->_setAttribute( backup => $2 ) if $3 eq 'BK';
my $status = $6;
$status = 'offline' if $status eq 'Off-line';
$status = 'online' if $status eq 'On-line';
$header->_setAttribute
(
status => $status,
attached => 1,
);
} else {
$self->_Carp("Unable to parse volume header: '$_'");
}
#
# We are interested in the next 6 lines as they are also
lib/AFS/Command/VOS.pm view on Meta::CPAN
busy => $3,
);
last; # Done with this partition
}
if ( /Volume (\d+) is busy/ ) {
my $volume = AFS::Object::VolumeHeader->new
(
id => $1,
status => 'busy',
attached => 1,
);
$partition->_addVolumeHeader($volume);
next;
} elsif ( /Could not attach volume (\d+)/ ) {
my $volume = AFS::Object::VolumeHeader->new
(
id => $1,
status => 'offline',
attached => 0,
);
$partition->_addVolumeHeader($volume);
next;
}
#
# We have to handle multiple formats here. For
# now, just parse the "fast" and normal output.
# Extended is not yet supported.
#
lib/AFS/Command/VOS.pm view on Meta::CPAN
($name,$id,$type,$size,$status) = @array[0..3,5];
$status = 'offline' if $status eq 'Off-line';
$status = 'online' if $status eq 'On-line';
$volume->_setAttribute
(
id => $id,
name => $name,
type => $type,
size => $size,
status => $status,
attached => 1,
);
} elsif ( @array == 1 ) {
$volume->_setAttribute
(
id => $_,
status => 'online',
attached => 1,
);
} else {
$self->_Carp("Unable to parse header summary line:\n" . $_);
$errors++;
next;
}
#
# If the output is long, then we have some more
# interesting information to parse. See vos/examine.pl
lib/AFS/Command/VOS.pm view on Meta::CPAN
next unless $transaction;
if ( /transaction:\s+(\d+)/ ) {
$transaction->_setAttribute( transaction => $1 );
}
if ( /created:\s+(.*)$/ ) {
$transaction->_setAttribute( created => $1 );
}
if ( /attachFlags:\s+(.*)$/ ) {
$transaction->_setAttribute( attachFlags => $1 );
}
if ( /volume:\s+(\d+)/ ) {
$transaction->_setAttribute( volume => $1 );
}
if ( /partition:\s+(\S+)/ ) {
$transaction->_setAttribute( partition => $1 );
}
lib/AFS/Command/VOS.pod view on Meta::CPAN
The attributes available in this object depend on the method
arguments, as well as the state of the volume (less information can be
obtained when a volume is busy, for example).
The following attributes should always be present.
Attributes Values
---------- ------
id Numeric Volume ID
status online | offline | busy
attached Boolean
The 'attached' attribute is a Boolean that indicates whether or not
the volume is attached by the volserver. A volume which can not be
brought online due to volume header problems will be offline, and
unattached (attached == 0), but a volume can be offline for other
reasons, (eg. vos offline, or more than one volume with the same ID on
the same server), and still be attached (attached == 1).
The following attributes are present only if the volume's status is
'online':
Attributes Values
---------- ------
name Volume Name
type "RO" | "RW" | "BK"
size Numeric size in KB
server Fileserver hostname
lib/AFS/Command/VOS.pod view on Meta::CPAN
Attributes Values
---------- ------
partition Fileserver /vice partition name
When used to encapsulate 'vos listpart' output, this object has no
relevant methods. Note, however, that this version of the API reuses
this object to represent other partition-related data (see 'vos
listvol' method documentation, for example), but they are not relevant
in this usage of the object. This multiple personality of the objects
may be changed in a future release, so don't get too attached to the
specific class names.
See the AFS::Object documentation for a discussion of the
planned evolution of the API.
=back
=head2 listvldb
=over
lib/AFS/Command/VOS.pod view on Meta::CPAN
getVolumeHeader( name => $name )
B<AFS::Object::VolumeHeader>
The following attributes should always be present.
Attributes Values
---------- ------
id Numeric Volume ID
status online | offline | busy
attached Boolean
The 'attached' attribute is a Boolean that indicates whether or not
the volume is attached by the volserver. A volume which can not be
brought online due to volume header problems will be offline, and
unattached (attached == 0), but a volume can be offline for other
reasons, (eg. vos offline, or more than one volume with the same ID on
the same server), and still be attached (attached == 1).
If the 'fast' argument was specified, then none of the other
attributes will be present.
The following attributes are present only if the volume's status is
'online':
Attributes Values
---------- ------
name Volume Name
lib/AFS/Command/VOS.pod view on Meta::CPAN
getTransactionByVolume($volume) a single AFS::Object::Transaction object for the volume $volume
B<AFS::Object::Transaction>
This object has several attributes:
Attributes Values
---------- ------
transaction Numeric transaction ID
created Creation date (in ctime format)
attachFlags String (exact meaning unclear)
volume Numeric volume ID
partition Vice partition on whcih the volume resides
procedure What is being done to the volume
packetRead Numeric value
lastReceiveTime Time value (utime format)
packetSend Numeric value
lastSendTime Time value (utime format)
NOTE: These attributes just come from a straight parsing of output like this:
--------------------------------------
transaction: 170423 created: Wed Oct 8 15:59:12 2003
attachFlags: offline
volume: 536963097 partition: /vicepf procedure: Restore
packetRead: 222 lastReceiveTime: 1065643165 packetSend: 1 lastSendTime: 1065643165
--------------------------------------
To understand the meaning of these various fields (which to the
author's knowledge are not documented anywhere), see the OpenAFS
source code. Some of these values are obvious, or intuitive, but
others are not.
=back
t/00vos_basic.t view on Meta::CPAN
if ( $header->status() eq $method ) {
print "ok $TestCounter\n";
} else {
print "not ok $TestCounter\n";
warn("Volume '$volname' on server '$servers[0]', " .
"partition '$partitions[0]', in cell '$cell' was not $method");
}
$TestCounter++;
if ( $header->attached() ) {
print "ok $TestCounter\n";
} else {
print "not ok $TestCounter\n";
warn("Volume '$volname' on server '$servers[0]', " .
"partition '$partitions[0]', in cell '$cell' does not appear to be attached");
}
$TestCounter++;
}
} else {
for ( my $index = 0 ; $index <= 7 ; $index++ ) {
print "ok $TestCounter\n";
$TestCounter++;