Commit 09c57e3b authored by Kirk Webb's avatar Kirk Webb
Browse files

When an image is created successfully, a message stating this fact is printed
to the log.

More importantly, I fixed a bug in the NFS slack factor logic which resulted
in create_image waiting forever for progress to be made.
parent 39c83013
......@@ -305,7 +305,7 @@ while ($tries) {
my $starttime = time();
my $curtdiff = 0;
my $prevtdiff = 0;
my $slack = 0;
my $slack = $maxslack-1;
while ($count) {
......@@ -337,18 +337,23 @@ while ($tries) {
if ($cursize > $maximagesize) {
last;
}
if ( ($cursize == $prevsize) && (++$slack >= $maxslack) ) {
if ($count*$sleepwait % 60 == 0) {
print "Timeout in ". int($count*$sleepwait/60) ." minutes.\n";
if ($cursize == $prevsize) {
if ($slack) {$slack--;} # NFS cache slop timer
else {
if ($count*$sleepwait % 60 == 0) {
print "Timeout in ".
int($count*$sleepwait/60) .
" minutes.\n";
}
$count--;
}
$count--;
}
else {
$slack = $maxslack-1;
if ($count != $maxloops) {
print "Timeout aborted - image size increased.\n";
$count = $maxloops;
}
$slack = 0;
}
$prevsize = $cursize;
......@@ -383,6 +388,8 @@ if ($cursize > $maximagesize) {
fatal("FAILED: Maximum image size ($maximagesize bytes) exceeded ... \n");
}
print "Image creation succeeded. Final size: $cursize bytes. \n";
SENDMAIL("$user_name <$user_email>",
"Image Creation on $node Completed: $pid/$imagename",
"Image creation on $node has completed. As you requested, the\n".
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment