Revision aa5b2f07 htools/Ganeti/HTools/Cluster.hs
b/htools/Ganeti/HTools/Cluster.hs | ||
---|---|---|
7 | 7 |
|
8 | 8 |
{- |
9 | 9 |
|
10 |
Copyright (C) 2009, 2010, 2011 Google Inc. |
|
10 |
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
|
|
11 | 11 |
|
12 | 12 |
This program is free software; you can redistribute it and/or modify |
13 | 13 |
it under the terms of the GNU General Public License as published by |
... | ... | |
454 | 454 |
allocateOnSingle nl inst new_pdx = |
455 | 455 |
let p = Container.find new_pdx nl |
456 | 456 |
new_inst = Instance.setBoth inst new_pdx Node.noSecondary |
457 |
in Node.addPri p inst >>= \new_p -> do |
|
457 |
in do |
|
458 |
Instance.instMatchesPolicy inst (Node.iPolicy p) |
|
459 |
new_p <- Node.addPri p inst |
|
458 | 460 |
let new_nl = Container.add new_pdx new_p nl |
459 | 461 |
new_score = compCV nl |
460 | 462 |
return (new_nl, new_inst, [new_p], new_score) |
... | ... | |
466 | 468 |
let tgt_p = Container.find new_pdx nl |
467 | 469 |
tgt_s = Container.find new_sdx nl |
468 | 470 |
in do |
471 |
Instance.instMatchesPolicy inst (Node.iPolicy tgt_p) |
|
469 | 472 |
new_p <- Node.addPri tgt_p inst |
470 | 473 |
new_s <- Node.addSec tgt_s inst new_pdx |
471 | 474 |
let new_inst = Instance.setBoth inst new_pdx new_sdx |
Also available in: Unified diff