Apr 28 2003
NBU Trick #2 - Slow Filling; More Tape?
Written by Paul Winkeler   
Monday, 28 April 2003
The corollary to NBU Trick #1, "Where Did All My Tapes Go?" is the question "How Long Does it Take to Fill a Tape?". The trick to answering this question is to make use of three tape attributes NetBackup kindly tracks for us:
  • The date on which the tape was allocated to the media server. The assumption being made that this is then also the date on which the tape was first written.
  • The date on which the tape was last written.
  • And of course the bit that tells us the tape is in fact full
The snippet of NBU empowered code you need to compute this interval then trivially becomes:
print "Volume ".$volume->id." took ".$volume->fillTime." seconds to fill\n";
Of course this is cheating and it only works because NBU's Media objects happen to have a fillTime() method. The attributes we alluded to above are in fact used in this method's implementation reproduced here:
sub fillTime {
  my $self = shift;

  return $self->full ? ($self->{LASTWRITTEN} - $self->{ALLOCATED}) : undef;
}
Do be careful because as you can see, asking for the fillTime() of a tape not yet empty, gives and undefined result!
With this bit of information in hand, it is possible to compute the average amount of time it takes to fill a tape. Group that statistic by retention level and volume pool and you should get a pretty good idea of the speed with which your tapes are consumed.
Last Updated ( Friday, 21 September 2007 )