[Pkg-ganeti-devel] [ganeti] 138/165: Merge branch 'stable-2.14' into stable-2.15

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Tue Aug 11 13:53:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit 7f85040731e3a78ee7e321dda93a76be44bff071
Merge: a921281 8610c47
Author: Petr Pudlak <pudlak at google.com>
Date:   Thu Jul 9 13:15:00 2015 +0200

    Merge branch 'stable-2.14' into stable-2.15
    
    * stable-2.14
      Move _ValidateConfig to the verify.py submodule
      Fix building of shell command in export
      Add test showing a bug in location score calculation
      Bugfix for cluster location score calculation
    
    * stable-2.13
      Properly get rid of all watcher jobs
      Move stdout_of to qa_utils
      Describe --no-verify-disks option in watcher man page
      Make disk verification optional
    
    * stable-2.12
      Tell git to ignore tools/ssl-update
      Use 'exclude_daemons' option for master only
      Disable superfluous restarting of daemons
      Add tests exercising the "crashed" state handling
      Add proper handling of the "crashed" Xen state
      Handle SSL setup when downgrading
      Write SSH ports to ssconf files
      Noded: Consider certificate chain in callback
      Cluster-keys-replacement: update documentation
      Backend: Use timestamp as serial no for server cert
      UPGRADE: add note about 2.12.5
      NEWS: Mention issue 1094
      man: mention changes in renew-crypto
      Verify: warn about self-signed client certs
      Bootstrap: validate SSL setup before starting noded
      Clean up configuration of curl request
      Renew-crypto: remove superflous copying of node certs
      Renew-crypto: propagate verbose and debug option
      Noded: log the certificate and digest on noded startup
      QA: reload rapi cert after renew crypto
      Prepare-node-join: use common functions
      Renew-crypto: remove dead code
      Init: add master client certificate to configuration
      Renew-crypto: rebuild digest map of all nodes
      Noded: make "bootstrap" a constant
      node-daemon-setup: generate client certificate
      tools: Move (Re)GenerateClientCert to common
      Renew cluster and client certificates together
      Init: create the master's client cert in bootstrap
      Renew client certs using ssl_update tool
      Run functions while (some) daemons are stopped
      Back up old client.pem files
      Introduce ssl_update tool
      x509 function for creating signed certs
      Add tools/common.py from 2.13
      Consider ECDSA in SSH setup
      Update documentation of watcher and RAPI daemon
      Watcher: add option for setting RAPI IP
      When connecting to Metad fails, log the full stack trace
      Set up the Metad client with allow_non_master
      Set up the configuration client properly on non-masters
      Add the 'allow_non_master' option to the WConfd RPC client
      Add the option to disable master checks to the RPC client
      Add 'allow_non_master' to the Luxi test transport class too
      Add 'allow_non_master' to FdTransport for compatibility
      Properly document all constructor arguments of Transport
      Allow the Transport class to be used for non-master nodes
      Don't define the set of all daemons twice
    
    * stable-2.11
      Fix capitalization of TestCase
      Trigger renew-crypto on downgrade to 2.11
    
    Conflicts:
    	lib/backend.py
    	src/Ganeti/HTools/Cluster.hs
    	test/hs/shelltests/htools-hbal.test
    
    Resolutions:
    	lib/backend.py
              keep the improved 2.15 communication mechanism with Metad
    	src/Ganeti/HTools/Cluster.hs
              propagate changes from [fb0c774be7e] to .../Cluster/Moves.hs
    	test/hs/shelltests/htools-hbal.test
              keep tests from both versions
    
    Signed-off-by: Petr Pudlak <pudlak at google.com>
    Reviewed-by: Klaus Aehlig <aehlig at google.com>

 .gitignore                                         |   1 +
 Makefile.am                                        |  13 +-
 UPGRADE                                            |   8 ++
 doc/cluster-keys-replacement.rst                   |  27 +++-
 lib/backend.py                                     |  74 +++--------
 lib/bootstrap.py                                   |  44 +++++-
 lib/cli.py                                         |  64 ++++++++-
 lib/client/gnt_cluster.py                          | 124 +++++++++++++++--
 lib/cmdlib/cluster/__init__.py                     | 105 ++++-----------
 lib/cmdlib/common.py                               |   9 +-
 lib/cmdlib/node.py                                 |   4 +-
 lib/config/__init__.py                             |  55 +++++---
 lib/config/verify.py                               |  14 ++
 lib/http/__init__.py                               |   9 ++
 lib/hypervisor/hv_xen.py                           |  28 ++++
 lib/pathutils.py                                   |   4 +-
 lib/rapi/testutils.py                              |   3 +-
 lib/rpc/client.py                                  |  36 +++--
 lib/rpc/node.py                                    |   6 +-
 lib/rpc/transport.py                               |  16 ++-
 lib/server/noded.py                                |  52 ++++++--
 lib/ssconf.py                                      |  49 +++++--
 lib/ssh.py                                         |   2 +
 lib/tools/cfgupgrade.py                            |   9 +-
 lib/tools/common.py                                | 113 +++++++++++++++-
 lib/tools/node_daemon_setup.py                     |   3 +
 lib/tools/prepare_node_join.py                     |   2 +-
 lib/tools/ssh_update.py                            |   2 +-
 lib/tools/ssl_update.py                            | 148 +++++++++++++++++++++
 lib/utils/security.py                              |  52 +++++++-
 lib/utils/version.py                               |  26 ++++
 lib/utils/x509.py                                  |  64 +++++++++
 lib/watcher/__init__.py                            |  14 +-
 lib/wconfd.py                                      |   7 +-
 man/ganeti-rapi.rst                                |   9 +-
 man/ganeti-watcher.rst                             |  13 +-
 man/gnt-cluster.rst                                |  22 +--
 qa/ganeti-qa.py                                    |  23 +++-
 qa/qa_filters.py                                   |  15 +--
 qa/qa_job_utils.py                                 |  11 +-
 qa/qa_utils.py                                     |  13 ++
 src/Ganeti/Constants.hs                            |  48 +++++--
 src/Ganeti/HTools/Cluster/Moves.hs                 |   2 +-
 src/Ganeti/OpCodes.hs                              |   2 +
 src/Ganeti/OpParams.hs                             |   6 +
 src/Ganeti/Ssconf.hs                               |   1 +
 src/Ganeti/WConfd/Ssconf.hs                        |   8 ++
 test/data/htools/hbal-location-2.data              |  10 ++
 test/data/xen-xl-list-4.4-crashed-instances.txt    |   5 +
 test/hs/Test/Ganeti/OpCodes.hs                     |   4 +-
 test/hs/shelltests/htools-hbal.test                |   8 +-
 test/py/cmdlib/cluster_unittest.py                 |  86 +++---------
 test/py/ganeti.backend_unittest.py                 |  28 +---
 test/py/ganeti.hypervisor.hv_xen_unittest.py       |  30 +++++
 test/py/ganeti.ssh_unittest.py                     |   3 +
 test/py/ganeti.tools.common_unittest.py            | 135 +++++++++++++++++++
 test/py/ganeti.tools.prepare_node_join_unittest.py |  84 +++---------
 test/py/ganeti.utils.version_unittest.py           |  10 ++
 test/py/ganeti.utils.x509_unittest.py              |  36 ++++-
 tools/post-upgrade                                 |   2 +-
 tools/ssl-update                                   |  21 +++
 61 files changed, 1364 insertions(+), 458 deletions(-)

diff --cc src/Ganeti/HTools/Cluster/Moves.hs
index 8f18019,0000000..5fca893
mode 100644,000000..100644
--- a/src/Ganeti/HTools/Cluster/Moves.hs
+++ b/src/Ganeti/HTools/Cluster/Moves.hs
@@@ -1,189 -1,0 +1,189 @@@
 +{-| Implementation of instance moves in a cluster.
 +
 +-}
 +
 +{-
 +
 +Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
 +All rights reserved.
 +
 +Redistribution and use in source and binary forms, with or without
 +modification, are permitted provided that the following conditions are
 +met:
 +
 +1. Redistributions of source code must retain the above copyright notice,
 +this list of conditions and the following disclaimer.
 +
 +2. Redistributions in binary form must reproduce the above copyright
 +notice, this list of conditions and the following disclaimer in the
 +documentation and/or other materials provided with the distribution.
 +
 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 +
 +-}
 +
 +module Ganeti.HTools.Cluster.Moves
 +  ( applyMoveEx
 +  , setInstanceLocationScore
 +  , move
 +  ) where
 +
 +import qualified Data.Set as Set
 +
 +import Ganeti.HTools.Types
 +import qualified Ganeti.HTools.Container as Container
 +import qualified Ganeti.HTools.Instance as Instance
 +import qualified Ganeti.HTools.Node as Node
 +
 +-- | Extracts the node pairs for an instance. This can fail if the
 +-- instance is single-homed. FIXME: this needs to be improved,
 +-- together with the general enhancement for handling non-DRBD moves.
 +instanceNodes :: Node.List -> Instance.Instance ->
 +                 (Ndx, Ndx, Node.Node, Node.Node)
 +instanceNodes nl inst =
 +  let old_pdx = Instance.pNode inst
 +      old_sdx = Instance.sNode inst
 +      old_p = Container.find old_pdx nl
 +      old_s = Container.find old_sdx nl
 +  in (old_pdx, old_sdx, old_p, old_s)
 +
 +-- | Sets the location score of an instance, given its primary
 +-- and secondary node.
 +setInstanceLocationScore :: Instance.Instance -- ^ the original instance
 +                         -> Node.Node -- ^ the primary node of the instance
 +                         -> Node.Node -- ^ the secondary node of the instance
 +                         -> Instance.Instance -- ^ the instance with the
 +                                              -- location score updated
 +setInstanceLocationScore t p s =
 +  t { Instance.locationScore =
 +         Set.size $ Node.locationTags p `Set.intersection` Node.locationTags s }
 +
 +-- | Applies an instance move to a given node list and instance.
 +applyMoveEx :: Bool -- ^ whether to ignore soft errors
 +               -> Node.List -> Instance.Instance
 +               -> IMove -> OpResult (Node.List, Instance.Instance, Ndx, Ndx)
 +-- Failover (f)
 +applyMoveEx force nl inst Failover =
 +  let (old_pdx, old_sdx, old_p, old_s) = instanceNodes nl inst
 +      int_p = Node.removePri old_p inst
 +      int_s = Node.removeSec old_s inst
 +      new_nl = do -- OpResult
 +        Node.checkMigration old_p old_s
 +        new_p <- Node.addPriEx (Node.offline old_p || force) int_s inst
 +        new_s <- Node.addSecExEx (Node.offline old_p) (Node.offline old_p)
 +                   int_p inst old_sdx
 +        let new_inst = Instance.setBoth inst old_sdx old_pdx
 +        return (Container.addTwo old_pdx new_s old_sdx new_p nl,
 +                new_inst, old_sdx, old_pdx)
 +  in new_nl
 +
 +-- Failover to any (fa)
 +applyMoveEx force nl inst (FailoverToAny new_pdx) = do
 +  let (old_pdx, old_sdx, old_pnode, _) = instanceNodes nl inst
 +      new_pnode = Container.find new_pdx nl
 +      force_failover = Node.offline old_pnode || force
 +  Node.checkMigration old_pnode new_pnode
 +  new_pnode' <- Node.addPriEx force_failover new_pnode inst
 +  let old_pnode' = Node.removePri old_pnode inst
 +      inst' = Instance.setPri inst new_pdx
 +      nl' = Container.addTwo old_pdx old_pnode' new_pdx new_pnode' nl
 +  return (nl', inst', new_pdx, old_sdx)
 +
 +-- Replace the primary (f:, r:np, f)
 +applyMoveEx force nl inst (ReplacePrimary new_pdx) =
 +  let (old_pdx, old_sdx, old_p, old_s) = instanceNodes nl inst
 +      tgt_n = Container.find new_pdx nl
 +      int_p = Node.removePri old_p inst
 +      int_s = Node.removeSec old_s inst
 +      new_inst = Instance.setPri (setInstanceLocationScore inst tgt_n int_s)
 +                 new_pdx
 +      force_p = Node.offline old_p || force
 +      new_nl = do -- OpResult
 +                  -- check that the current secondary can host the instance
 +                  -- during the migration
 +        Node.checkMigration old_p old_s
 +        Node.checkMigration old_s tgt_n
 +        tmp_s <- Node.addPriEx force_p int_s new_inst
 +        let tmp_s' = Node.removePri tmp_s new_inst
 +        new_p <- Node.addPriEx force_p tgt_n new_inst
 +        new_s <- Node.addSecEx force_p tmp_s' new_inst new_pdx
 +        return (Container.add new_pdx new_p $
 +                Container.addTwo old_pdx int_p old_sdx new_s nl,
 +                new_inst, new_pdx, old_sdx)
 +  in new_nl
 +
 +-- Replace the secondary (r:ns)
 +applyMoveEx force nl inst (ReplaceSecondary new_sdx) =
 +  let old_pdx = Instance.pNode inst
 +      old_sdx = Instance.sNode inst
 +      old_s = Container.find old_sdx nl
 +      tgt_n = Container.find new_sdx nl
 +      pnode = Container.find old_pdx nl
 +      pnode' = Node.removePri pnode inst
 +      int_s = Node.removeSec old_s inst
 +      force_s = Node.offline old_s || force
 +      new_inst = Instance.setSec (setInstanceLocationScore inst pnode tgt_n)
 +                 new_sdx
 +      new_nl = do
 +        new_s <- Node.addSecEx force_s tgt_n new_inst old_pdx
 +        pnode'' <- Node.addPriEx True pnode' new_inst
 +        return (Container.add old_pdx pnode'' $
 +                Container.addTwo new_sdx new_s old_sdx int_s nl,
 +                new_inst, old_pdx, new_sdx)
 +  in new_nl
 +
 +-- Replace the secondary and failover (r:np, f)
 +applyMoveEx force nl inst (ReplaceAndFailover new_pdx) =
 +  let (old_pdx, old_sdx, old_p, old_s) = instanceNodes nl inst
 +      tgt_n = Container.find new_pdx nl
 +      int_p = Node.removePri old_p inst
 +      int_s = Node.removeSec old_s inst
-       new_inst = Instance.setBoth (setInstanceLocationScore inst int_s tgt_n)
++      new_inst = Instance.setBoth (setInstanceLocationScore inst tgt_n int_p)
 +                 new_pdx old_pdx
 +      force_s = Node.offline old_s || force
 +      new_nl = do -- OpResult
 +        Node.checkMigration old_p tgt_n
 +        new_p <- Node.addPriEx force tgt_n new_inst
 +        new_s <- Node.addSecEx force_s int_p new_inst new_pdx
 +        return (Container.add new_pdx new_p $
 +                Container.addTwo old_pdx new_s old_sdx int_s nl,
 +                new_inst, new_pdx, old_pdx)
 +  in new_nl
 +
 +-- Failver and replace the secondary (f, r:ns)
 +applyMoveEx force nl inst (FailoverAndReplace new_sdx) =
 +  let (old_pdx, old_sdx, old_p, old_s) = instanceNodes nl inst
 +      tgt_n = Container.find new_sdx nl
 +      int_p = Node.removePri old_p inst
 +      int_s = Node.removeSec old_s inst
 +      force_p = Node.offline old_p || force
 +      new_inst = Instance.setBoth (setInstanceLocationScore inst int_s tgt_n)
 +                 old_sdx new_sdx
 +      new_nl = do -- OpResult
 +        Node.checkMigration old_p old_s
 +        new_p <- Node.addPriEx force_p int_s new_inst
 +        new_s <- Node.addSecEx force_p tgt_n new_inst old_sdx
 +        return (Container.add new_sdx new_s $
 +                Container.addTwo old_sdx new_p old_pdx int_p nl,
 +                new_inst, old_sdx, new_sdx)
 +  in new_nl
 +
 +-- | Apply a move to an instance, ignoring soft errors. This is a
 +-- variant of `applyMoveEx True` suitable for folding.
 +move :: (Node.List, Instance.List)
 +        -> (Idx, IMove)
 +        -> OpResult (Node.List, Instance.List)
 +move (nl, il) (idx, mv) = do
 +  let inst = Container.find idx il
 +  (nl', inst', _, _) <- applyMoveEx True nl inst mv
 +  return (nl', Container.add idx inst' il)
diff --cc test/hs/shelltests/htools-hbal.test
index e3baf37,dbbb0d4..65f3d19
--- a/test/hs/shelltests/htools-hbal.test
+++ b/test/hs/shelltests/htools-hbal.test
@@@ -30,20 -29,10 +29,27 @@@
  >>>/Solution length=[1-9]/
  >>>= 0
  
 +./test/hs/hbal -t $TESTDATA_DIR/shared-n1-failure.data --ignore-dynu
 +>>>/Cluster is already well balanced/
 +>>>= 0
 +
 +./test/hs/hbal -t $TESTDATA_DIR/shared-n1-failure.data --ignore-dynu -pname,pcnt -O nodeA
 +>>>2/Final cluster status:
 + Name  pcnt
 + nodeA    0
 + nodeB    4
 + nodeC    2
 + nodeD    4/
 +>>>= 0
 +
 +./test/hs/hbal -t $TESTDATA_DIR/shared-n1-failure.data --ignore-dynu -O nodeC
 +>>>/No solution found/
 +>>>= 0
 +
+ ./test/hs/hbal --print-nodes=name,pcnt -t $TESTDATA_DIR/hbal-location-2.data
+ >>>2/Final cluster status:
+  Name    pcnt
+  node-01    1
+  node-02    0
+  node-03    1/
+ >>>= 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list