Fix ReplaceSecondary moves for offline nodes
authorIustin Pop <iustin@google.com>
Thu, 26 Aug 2010 11:55:47 +0000 (13:55 +0200)
committerIustin Pop <iustin@google.com>
Thu, 2 Sep 2010 12:43:16 +0000 (14:43 +0200)
commit74e89a1432ee618dc13d64f8f4b1a52fb11dab71
tree25a1bcc795c477d3d1df5dea9340764ed2b560ff
parent49d977db9a8d11d957d627ee381d91401af4e1e8
Fix ReplaceSecondary moves for offline nodes

The addition of a new secondary on a node is doing two memory tests:
- in strict mode, reject if we get into N+1 failure
- reject if the new instance memory is greater than the free memory (not
  available memory) on the node

The last check is designed to ensure that, irrespective of the other
secondary instances on this node, we are able to failover/migrate the
newly-added instance.

However, we should allow this, if the instances comes from an offline
node, which doesn't offer anything (not even disk replication).
Therefore this patch makes this check conditional on the strict mode.
Ganeti/HTools/Node.hs