Commit 4bbf1a4f authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Refuse to extend slices that include nodes that are sched_reserved or

pre-reserved to another project.
parent 3c8a4912
...@@ -4619,6 +4619,30 @@ sub RenewSliverAux($$$) ...@@ -4619,6 +4619,30 @@ sub RenewSliverAux($$$)
# #
main::AddLogfileMetaData("renew_request", $expires); main::AddLogfileMetaData("renew_request", $expires);
#
# Check all of the nodes in the underlying experiment to see if
# any are sched-reserved or pre-reserved. If so we decline the
# extension.
#
my $slice_experiment = $slice->GetExperiment();
my @pnodes = $slice_experiment->NodeList();
foreach my $pnode (@pnodes) {
my $pnodeid = $pnode->node_id();
if (defined($pnode->reserved_pid()) &&
$pnode->reserved_pid() ne $slice_experiment->pid()) {
$slice->UnLock();
return GeniResponse->Create(GENIRESPONSE_REFUSED, undef,
"Refused cause $pnodeid is pre-reserved");
}
if (defined($pnode->NextReservation())) {
$slice->UnLock();
return GeniResponse->Create(GENIRESPONSE_REFUSED, undef,
"Refused cause $pnodeid is sched-reserved");
}
}
my $response = SetSliceExpiration($slice, my $response = SetSliceExpiration($slice,
$expires, 0, $alap, @{ $credentials }); $expires, 0, $alap, @{ $credentials });
if (GeniResponse::IsError($response)) { if (GeniResponse::IsError($response)) {
......
Supports Markdown
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