commit ec71d7974653bfd148ef0a97b5fd44920cc8f0da
Merge: 553363a a4687d7
Author: Hrvoje Ribicic <[email protected]>
Date:   Mon Oct 12 16:54:51 2015 +0000

    Merge branch 'stable-2.16'

    * stable-2.16
      Make CommitTemporaryIPs call out to WConfD
      Also accept just "BoringSSL"
      Accept BoringSSL as a known good ssl library
      Add a test for group independence in capacity checks
      Make hspace correctly handle --independent-groups
      Add a predicate whether a group is globally N+1 redundant
      Make global N+1 checks honor algCapacityIgnoreGroups
      Add a parameter to ignore groups in capacity checks

    * stable-2.15
      For queries, take the correct base address of an IP block
      Fix computation in network blocks

    * stable-2.14
      Add test for tags accounting in hail
      Set node tags in iallocator htools backend

    * stable-2.13
      Improve xl socat migrations

    * stable-2.12
      QA: Retrieve only the RAPI certificate
      QA: Allow usage of specific RAPI certificates and files
      QA: Reload certificates only when renew-crypto has been run
      QA: Restart Ganeti after adding the RAPI users file
      QA: Add reading the RAPI password from a file
      QA: Allow the RAPI user to be set
      QA: Do not remove nodes from cluster without destroying it
      QA: Refactor RAPI handling
      Increase default disk size of burnin to 1G
      break line with more than 80 characters
      Only search for Python-2 interpreters
      Fix faulty comments / indentation
      Handle Xen 4.3 states better

    * stable-2.11
      (no changes)

    * stable-2.10
      Add a test for parsing of admin_state in IAlloc backend
      At IAlloc backend guess state from admin state

    * stable-2.9
      Update harep's man page to notify users of its limitations

    Conflicts:
        IAlloc.hs: Take both the tags and the mem calculation change
        htools-hail.test: Merge tests

    Signed-off-by: Hrvoje Ribicic <[email protected]>

diff --cc src/Ganeti/HTools/AlgorithmParams.hs
index deee223,b93f437..8a53e69
--- a/src/Ganeti/HTools/AlgorithmParams.hs
+++ b/src/Ganeti/HTools/AlgorithmParams.hs
@@@ -41,9 -41,8 +41,10 @@@ module Ganeti.HTools.AlgorithmParam
    , fromCLIOptions
    ) where

 +import qualified Data.Set as Set
 +
  import qualified Ganeti.HTools.CLI as CLI
+ import qualified Ganeti.HTools.Types as T

  data AlgorithmOptions = AlgorithmOptions
    { algDiskMoves :: Bool            -- ^ Whether disk moves are allowed
@@@ -59,9 -54,8 +60,10 @@@
    , algMinGainLimit :: Double       -- ^ Limit below which minimal gain
is used
    , algCapacity :: Bool             -- ^ Whether to check capacity
properties,
                                      -- like global N+1 redundancy
+   , algCapacityIgnoreGroups :: [T.Gdx] -- ^ Groups to ignore in capacity
checks
    , algRestrictToNodes :: Maybe [String] -- ^ nodes to restrict
allocation to
 +  , algAllowedNodes :: Maybe (Set.Set Int) -- ^ if given, do not perform
any
 +                                    -- operations involving other nodes
    , algAcceptExisting :: Bool       -- ^ accept existing violations in
capacity
                                      -- checks
    }
@@@ -78,8 -71,8 +80,9 @@@ fromCLIOptions opts = AlgorithmOption
    , algMinGain = CLI.optMinGain opts
    , algMinGainLimit = CLI.optMinGainLim opts
    , algCapacity = CLI.optCapacity opts
+   , algCapacityIgnoreGroups = []
    , algRestrictToNodes = CLI.optRestrictToNodes opts
 +  , algAllowedNodes = Nothing
    , algAcceptExisting = CLI.optAcceptExisting opts
    }

diff --cc src/Ganeti/HTools/Backend/IAlloc.hs
index 5946efe,7bd31ee..f2575f6
--- a/src/Ganeti/HTools/Backend/IAlloc.hs
+++ b/src/Ganeti/HTools/Backend/IAlloc.hs
@@@ -170,8 -178,8 +179,9 @@@ parseNode ktg n a = d
    dfree  <- lvextract 0 "free_disk"
    ctotal <- lvextract 0.0 "total_cpus"
    cnos <- lvextract 0 "reserved_cpus"
 -  let node = flip Node.setNodeTags tags $
 -             Node.create n mtotal mnode mfree dtotal dfree ctotal cnos
 +  let node_mem = obtainNodeMemory hvstate mnode
-       node = Node.create n mtotal node_mem mfree dtotal dfree ctotal cnos
++      node = flip Node.setNodeTags tags $
++             Node.create n mtotal node_mem mfree dtotal dfree ctotal cnos
               (not live || drained) sptotal spfree gidx excl_stor
    return (n, node)

diff --cc src/Ganeti/Network.hs
index f2feebf,1cb6aa1..b557369
--- a/src/Ganeti/Network.hs
+++ b/src/Ganeti/Network.hs
@@@ -54,8 -55,9 +55,9 @@@ module Ganeti.Networ
    ) where

  import Control.Monad
 -import Control.Monad.Error
 +import Control.Monad.Error.Class (MonadError)
  import Control.Monad.State
+ import Data.Bits ((.&.))
  import Data.Function (on)

  import Ganeti.BasicTypes
@@@ -172,10 -180,10 +180,10 @@@ getMap = maybe "" (BA.asString '.' 'X'

  -- | Returns an address index wrt a network.
  -- Fails if the address isn't in the network range.
 -addrIndex :: (MonadError e m, Error e) => Ip4Address -> Network -> m Int
 +addrIndex :: (MonadError e m, FromString e) => Ip4Address -> Network -> m
Int
  addrIndex addr net = do
    let n = networkNetwork net
-       i = on (-) ip4AddressToNumber addr (ip4netAddr n)
+       i = on (-) ip4AddressToNumber addr (ip4BaseAddr n)
    when ((i < 0) || (i >= ipv4NumHosts (ip4netMask n))) . failError
      $ "Address '" ++ show addr ++ "' not in the network '" ++ show net ++
"'"
    return $ fromInteger i
diff --cc test/hs/shelltests/htools-hail.test
index b34a2b8,46bfa20..61943ba
--- a/test/hs/shelltests/htools-hail.test
+++ b/test/hs/shelltests/htools-hail.test
@@@ -105,9 -105,14 +105,14 @@@ cat $TESTDATA_DIR/hail-alloc-invalid-ne
  >>>= 0

  ./test/hs/hail $T/hail-alloc-twodisks.json.fail-excl-stor
 ->>> /"success":false,.*FailSpindles: 1"/
 +>>> /"success":false,.*FailTooSmall: 1"/
  >>>= 0

+ # check that hail correctly parses admin state
+ ./test/hs/hail -v -v $TESTDATA_DIR/hail-alloc-drbd.json
+ >>>2 /runSt = StatusDown/
+ >>>=0
+
  # check that hail can use the simu backend
  ./test/hs/hail --simu p,8,8T,16g,16 $TESTDATA_DIR/hail-alloc-drbd.json
  >>> /"success":true,/
@@@ -225,7 -230,7 +230,12 @@@
  >>> /successes 2, failures 0.*"result":"node-2-2"/
  >>>= 0

 +# Memory over-commitment test
 +./test/hs/hail $TESTDATA_DIR/hail-alloc-memory-over-commitment.json
 +>>> /"success":true.*/
 +>>>= 0
++
+ # Check that hail account location tags
+ ./test/hs/hail $TESTDATA_DIR/hail-alloc-nlocation.json
+ >>> /"success":true,.*,"result":\["node3","node2"\]/
+ >>>= 0
Hrvoje Ribicic
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und
löschen Sie die E-Mail und alle Anhänge. Vielen Dank.

This e-mail is confidential. If you are not the right addressee please do
not forward it, please inform the sender, and please erase this e-mail
including any attachments. Thanks.

Reply via email to