1. 12 Jan, 2009 1 commit
  2. 09 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Fix gnt-os for offline nodes · 94a02bb5
      Iustin Pop authored
      We shouldn't query offline nodes in gnt-os. This patch adds an utility
      function to ConfigWriter that returns the names of online nodes and uses
      it in LUDiagnoseOS to query only the good nodes.
      
      Reviewed-by: imsnah
      94a02bb5
    • Iustin Pop's avatar
      Cleanup replace-disks modes and options · 7e9366f7
      Iustin Pop authored
      In 1.2, due to the md+drbd7 legacy, we had a complex choice of replace
      modes, and the new drbd8 modes where forced into this syntax, with some
      complicated rules of transition from one mode to another (if REPLACE_ALL
      but not new node passed, switch to REPLACE_SEC, etc.).
      
      This patch cleans this situation by making a clear separation between
      the two main modes:
        - replace on current nodes (with the two sub-cases on primary and on
          secondary)
        - change to a new node (either via manually specified node or via
          iallocator)
      
      Reviewed-by: imsnah
      7e9366f7
  3. 08 Jan, 2009 1 commit
    • Iustin Pop's avatar
      Fix cluster verify/node net test for offline nodes · 82e37788
      Iustin Pop authored
      For offline nodes, we shouldn't add them to the NV_NODELIST and
      NV_NODENETTEST tests since they most likely won't succeed.
      
      The patch makes gnt-cluster verify happy again in such cases.
      
      Reviewed-by: imsnah
      82e37788
  4. 07 Jan, 2009 1 commit
    • Iustin Pop's avatar
      _AssembleInstanceDisks: fix rpcresult handling · 2b17c3c4
      Iustin Pop authored
      Commit 2117 changed _AssembleInstanceDisks to correctly parse the
      failure status of the new RpcResult structure, but it didn't fix the
      storing of only the result payload. Since RpcResult is not JSON
      serializable, LUActivateInstanceDisks is failing.
      
      Reviewed-by: ultrotter
      2b17c3c4
  5. 19 Dec, 2008 1 commit
  6. 16 Dec, 2008 1 commit
  7. 14 Dec, 2008 6 commits
  8. 09 Dec, 2008 1 commit
  9. 08 Dec, 2008 2 commits
    • Iustin Pop's avatar
      Fix _AdjustCandidatePool · ee513a66
      Iustin Pop authored
      Currently the ConfigWriter.MaintainCandidatePool returns node names, and
      _AdjustCandidatePool uses them as such, but then it passes these to
      context.ReaddNode which in turn passes them to jqueue.JobQueue.AddNode which
      uses them as objects.Node instances.
      
      Since this is currently the only usage, we change return type from
      ConfigWriter.MaintainCandidatePool to be objects and adjust the logging of
      their names, so that the auto-adjusement works.
      
      Reviewed-by: ultrotter
      ee513a66
    • Iustin Pop's avatar
      gnt-node modify: add the offline attribute · 3a5ba66a
      Iustin Pop authored
      This patch changes gnt-node modify and the associated opcode/lu to allow
      modification of the node offline attribute.
      
      Setting a node into offline mode automatically demotes it from the
      master role.
      
      Reviewed-by: ultrotter
      3a5ba66a
  10. 05 Dec, 2008 8 commits
    • Iustin Pop's avatar
      Make cluster verify understand offline nodes · 0a66c968
      Iustin Pop authored
      This patch changes cluster verify to not alert on offline nodes, but
      instead just show a note at the end with the number of such nodes.
      
      It also removes warnings in verify-disks and hooks about failures to
      make rpc calls to such nodes.
      
      Reviewed-by: ultrotter
      0a66c968
    • Iustin Pop's avatar
      cmdlib: check node stats in prereqs · 7527a8a4
      Iustin Pop authored
      This patch adds checks for offline nodes in most instance LUs so that we
      can work with offline secondaries, but not with offline primaries. Some
      cases (like grow disk, which needs both sides up) are not allowing
      offline nodes at all.
      
      Reviewed-by: ultrotter
      7527a8a4
    • Iustin Pop's avatar
      Add two utility functions to cmdlib · a5961235
      Iustin Pop authored
      These will be used for parameter checking and node status checking.
      
      Reviewed-by: ultrotter
      a5961235
    • Iustin Pop's avatar
      Add function to compute the master candidates · ec0292f1
      Iustin Pop authored
      Since some nodes can be offline, we can't just take the length of the
      node list as the maximum possible number of master candidates.
      
      The patch adds an utility function to correctly compute this value and
      replaces hardcoded computations with the use of this function. It then
      adds utility functions to automate the maintenance of the node lists.
      
      Reviewed-by: ultrotter
      ec0292f1
    • Iustin Pop's avatar
      Cleanup the config file on demotion from candidate · 56aa9fd5
      Iustin Pop authored
      This patch adds a simple rpc which makes a backup of the config file and
      then removes it. This is done so that cluster verify doesn't complain
      immediately after demoting a node.
      
      Reviewed-by: imsnah
      56aa9fd5
    • Iustin Pop's avatar
      watcher: handle offline nodes better · cbfc4681
      Iustin Pop authored
      This patch changes the LUQueryInstances to show a different state for
      offline nodes and also modifies the watcher to understand the offline
      state in its checks.
      
      Reviewed-by: ultrotter
      cbfc4681
    • Iustin Pop's avatar
      node list: add the offline field · 9ddb5e45
      Iustin Pop authored
      Reviewed-by: ultrotter
      9ddb5e45
    • Iustin Pop's avatar
      Add a new node parameter 'offline' · fc0fe88c
      Iustin Pop authored
      This patch adds a new node parameter called offline that will be used to
      mark nodes which should be touched by commands.
      
      We also add this flag at cluster init, node add, and export it to
      iallocator scripts.
      
      Reviewed-by: ultrotter
      fc0fe88c
  11. 04 Dec, 2008 1 commit
  12. 03 Dec, 2008 5 commits
    • Guido Trotter's avatar
      LUQueryExports: fix rpcresult handling · b04285f2
      Guido Trotter authored
      call_export_list is a multi node call, so we need to go through the
      results, extrapolate the good ones, and return a failure value for the
      bad ones.
      
      Reviewed-by: imsnah
      b04285f2
    • Guido Trotter's avatar
      LUAddNode: Auto-make master candidates · 0fff97e9
      Guido Trotter authored
      When a node is added, if there are not enough master candidates, we'll
      automatically promote it.
      
      Reviewed-by: imsnah
      0fff97e9
    • Guido Trotter's avatar
      LUAddNode: Check the correct result · f08ce603
      Guido Trotter authored
      This is a typo in the conversion to RpcResult
      
      Reviewed-by: imsnah
      f08ce603
    • Iustin Pop's avatar
      A few fixes related to master candidates · 3a26773f
      Iustin Pop authored
      This patch:
        - fixes cluster verify when all nodes are master candidates, but the
          candidate_pool_size is higher
        - warn when the master node is not marked as candidate
        - disable setting master node to regular node
        - don't pass the master node to context.ReaddNode since the job queue
          doesn't like getting our own node name
      
      Reviewed-by: ultrotter
      3a26773f
    • Iustin Pop's avatar
      Fix cluster rename and known_hosts · ec85e3d5
      Iustin Pop authored
      This patch rewrites and distributes ganeti's known_hosts file in case of
      a cluster rename.
      
      We also fix a problem in the node add (from where I copied the
      known_hosts file distribution).
      
      Reviewed-by: ultrotter
      ec85e3d5
  13. 02 Dec, 2008 10 commits
    • Iustin Pop's avatar
      Fix gnt-cluster verify w.r.t. rpc changes · 25361b9a
      Iustin Pop authored
      This partially reorganizes the cluster verify LU:
        - introduce constants for the node verify rpc call
        - move from additional rpc calls to a single rpc call, the
          call_node_info, which gaters all data needed
      
      Also fix a small error (self.LogWarning instead of self.Warning).
      
      Reviewed-by: imsnah
      25361b9a
    • Iustin Pop's avatar
      Fix cluster rename · 55cf7d83
      Iustin Pop authored
      With the recent configwriter/ssconf changes, cluster rename becomes
      trivial. This patch gets rids of the code and just updates the cluster
      object.
      
      Reviewed-by: imsnah
      55cf7d83
    • Iustin Pop's avatar
      Convert rpc results to a custom type · 781de953
      Iustin Pop authored
      For a long time we had the problem that both RPC-layer errors and
      results from the remote node share the same "valuespace". This is
      because we shouldn't raise an exception when only one node failed
      (and lose the results from the other nodes).
      
      This patch attempts to address this problem by returning a special
      object from RPC calls, which separates the rpc-layer status and the
      remote results into different attributes.
      
      All the users of rpc (mainly cmdlib, but also bootstrap and the
      HooksMaster in mcpu) have been converted to this new model. The code has
      changed from, e.g. for boolean return types:
      
        if not self.rpc.call_...
      
      to
      
        result = self.rpc.call_
        if result.failed or not result.data:
           ^ rpc-layer error    |
                                - result payload
      
      While this is slightly more complicated, it will allow cleaner checks in
      the future; right now the code is just a plain port, without
      optimizations.
      
      There's also a "result.Raise()" which raises an OpExecError if the
      rpc-layer had errors.
      
      One side-effect of the patch is that now all return types from the
      rpc.call_ functions are of either RpcResult (single-node) or dicts of
      (node name, RpcResult); previously, some functions were returning
      different object types based on error status.
      
      The code passes burnin (after many retries :).
      
      Reviewed-by: imsnah
      781de953
    • Guido Trotter's avatar
      Use the new utils.CheckBEParams function · d4b72030
      Guido Trotter authored
      Where we used/forgot to validate beparams we now use the new common function.
      
      Reviewed-by: imsnah
      d4b72030
    • Guido Trotter's avatar
      Handle default/none values in hv/be params · 8edcd611
      Guido Trotter authored
      When a value is set to constants.VALUE_DEFAULT we have to remove it from
      the specific instance dict, as this way it will be populated from the
      cluster before. If instead it's specified as constants.VALUE_NONE we'll
      explicitely set it to None, to override its presence with a different
      values in such defaults. However, currently, we handle None values only
      for hvparams, that have a real use case for them.
      
      Reviewed-by: imsnah
      8edcd611
    • Guido Trotter's avatar
      ImportExport: make src_node and src_path optional · b9322a9f
      Guido Trotter authored
      If src_node is not there we'll default to using the currently exported
      instance name as src_path. Also, if src_path is not absolute we'll look
      for it in EXPORT_DIR.
      
      Reviewed-by: iustinp
      b9322a9f
    • Guido Trotter's avatar
      LUCreateInstance: handle import without src_node · c0cbdc67
      Guido Trotter authored
      If we get called with no source node we'll thread src_path as an
      instance name exported in EXPORT_DIR in one of the nodes and look for
      it with the export_list rpc call.
      
      Reviewed-by: iustinp
      c0cbdc67
    • Guido Trotter's avatar
      LUCreateInstance: keep src node lock on import · 9c8971d7
      Guido Trotter authored
      Currently the node lock also guards against removing the import at the
      wrong time, so if we're importing an instance image we want to keep the
      source node locked. In the future we might want to put export locks at a
      different level than node locks.
      
      Reviewed-by: iustinp
      9c8971d7
    • Iustin Pop's avatar
      Adjust cluster-verify to check for candidate role · 112f18a5
      Iustin Pop authored
      Currently cluster verify checks all nodes for the same set of files,
      even if the nodes are not master candidates.
      
      This patch adds back checking of ssconf files for consistency and splits
      the checksum check into different error reporting messages based on
      candidate role.
      
      Reviewed-by: imsnah
      112f18a5
    • Iustin Pop's avatar
      Prevent demotion from candidate based on pool size · 3e83dd48
      Iustin Pop authored
      In gnt-cluster modify we prevent demotion from the candidate role if
      there are not enough master candidates left.
      
      Reviewed-by: imsnah
      3e83dd48