Permalink
Browse files

Default to one core when none are requested

  • Loading branch information...
1 parent 7201554 commit 077537a1b4a27d03c258da735565c4cdb4058629 @oldpatricka oldpatricka committed Mar 2, 2011
@@ -613,7 +613,7 @@ public Reservation reserveCoscheduledSpace(NodeRequest[] requests,
* than one VM is mapped to the same node, the returned node
* assignment array will include duplicates.
* @param memory megabytes needed
- * @param cores needed
+ * @param requestedCores needed
* @param duration seconds needed
* @param uuid group ID, can not be null if vmids is length > 1
* @param creatorDN the DN of the user who requested creation of the VM
@@ -622,7 +622,7 @@ public Reservation reserveCoscheduledSpace(NodeRequest[] requests,
*/
private void reserveSpace(final int[] vmids,
final int memory,
- final int cores,
+ final int requestedCores,
final int duration,
final String uuid,
final String creatorDN)
@@ -640,6 +640,16 @@ private void reserveSpace(final int[] vmids,
throw new ResourceRequestDeniedException(msg);
}
+ // When there is no core request, the default is -1,
+ // we would actually like one core.
+ int cores;
+ if (requestedCores <= 0) {
+ cores = 1;
+ }
+ else {
+ cores = requestedCores;
+ }
+
if (vmids.length > 1 && uuid == null) {
logger.error("cannot make group space request without group ID");
throw new ResourceRequestDeniedException("internal " +

0 comments on commit 077537a

Please sign in to comment.