Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Elijah Grubb
emulab-devel
Commits
6e8fff4b
Commit
6e8fff4b
authored
Oct 09, 2015
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When allocating storage, create an initial snapshot if not exclusive use.
parent
460d1cc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
db/Lease.pm.in
db/Lease.pm.in
+15
-0
No files found.
db/Lease.pm.in
View file @
6e8fff4b
...
...
@@ -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!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment