Commit 6e8fff4b authored by Mike Hibler's avatar Mike Hibler

When allocating storage, create an initial snapshot if not exclusive use.

parent 460d1cc6
......@@ -648,6 +648,21 @@ sub AllocResources($;$$) {
$self->UpdateState("unapproved");
return LEASE_ERROR_FAILED();
}
#
# XXX create an initial snapshot too. If this fails, we just warn;
# a snapshot can always be created with bscontrol later.
#
if (!$self->IsExclusiveUse()) {
my $tstamp = time();
$rv = system("$BSCONTROL snapshot lease-$idx $tstamp");
if ($rv) {
print STDERR "$self: AllocResources: ".
"WARNING: could not create initial snapshot.\n";
} else {
$self->SetAttribute("last_snapshot", $tstamp, "integer");
}
}
}
# It all worked!
......
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