Skip to content
Snippets Groups Projects
  1. Feb 17, 2010
  2. Feb 03, 2010
  3. Jan 27, 2010
    • Iustin Pop's avatar
      node daemon: allow working with broken queue dir · 81198f6e
      Iustin Pop authored
      
      In case the queue dir cannot be create/initialized, currently
      ganeti-noded exits. This means that a read-only filesystem or a
      permission error breaks all node daemon functionality, including
      powercycle. This is not good for the usual failure case for nodes.
      
      To workaround this, we don't require successful initialization at node
      daemon startup; if we can't init the queue dir/lock, we retry at every
      RPC call requiring a job queue lock, and if we still can't acquire the
      lock, we raise an exception (which is catched in HandleRequest and
      transformed into an RPC failure).
      
      This allows the node daemon to start in face of queue issues, and the
      master node to power-cycle it.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      81198f6e
  4. Jan 04, 2010
  5. Oct 22, 2009
  6. Oct 13, 2009
  7. Oct 09, 2009
  8. Aug 25, 2009
  9. Aug 24, 2009
  10. Aug 17, 2009
  11. Aug 10, 2009
  12. Aug 06, 2009
  13. Aug 05, 2009
  14. Aug 04, 2009
  15. Jul 29, 2009
  16. Jul 26, 2009
  17. Jul 25, 2009
    • Guido Trotter's avatar
      Collapse daemon's main function · 04ccf5e9
      Guido Trotter authored
      
      With three ganeti daemons, and one or two more coming, the daemon's main
      function started becoming too much cut&pasted code. Collapsing most of
      it in a daemon.GenericMain function. Some more code could be collapsed
      between the two http-based daemons, but since the new daemons won't be
      http-based we won't do it right now.
      
      As a bonus a functionality for overriding the network port on the
      command line for all network based nodes is added.
      
      Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
      04ccf5e9
  18. Jul 24, 2009
  19. Jul 23, 2009
  20. Jul 22, 2009
  21. Jul 08, 2009
  22. Jun 29, 2009
  23. Jun 15, 2009
    • Iustin Pop's avatar
      Simplify the RPC result framework in backend.py · c26a6bd2
      Iustin Pop authored
      
      Since now all functions fail via _Fail, the return True, … is redundant
      as all normal return paths have it, and thus the True value can be added
      in the ganeti-noded handler.
      
      This means that all functions can now forget about the special result
      type, and instead return normally, but signal all failures via _Fail().
      
      Only a few functions must be handled specially (the recursive ones).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      c26a6bd2
    • Iustin Pop's avatar
      Implement result-type restriction in ganeti-noded · 4dd42c9d
      Iustin Pop authored
      
      Since all rpc calls were converted, we can now:
        - enforce result type to (status, data)
        - convert all unhandled exceptions to (False, str(err))
      
      This makes sure that all unhandled errors are reported to rpc users.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      4dd42c9d
    • Iustin Pop's avatar
      Big rewrite of the OS-related functions · 255dcebd
      Iustin Pop authored
      
      Currently the OSes have a special, customized error handling: the OS
      object can represent either a valid OS, or an invalid OS. The associated
      function, instead of raising other exception or failing, create custom
      OS objects representing failed OSes.
      
      While this was good when no other RPC had failure handling, it's
      extremely different from how other function in backend.py expect
      failures to be signalled.
      
      This patch reworks this completely:
        - the OS object always represents valid OSes (the next patch will
          remove the valid/invalid field and associated constants)
        - the call_os_diagnose returns instead of a list of OS objects, a list
          of (name, path, status, diagnose_msg); the status is then used in
          cmdlib to determine validity and the status and diagnose_msg values
          are used in gnt-os for display
        - call_os_get returns either a valid OS or a RPC remote failure (with
          the error message)
        - the other functions in backend.py now just call backend.OSFromDisk()
          which will return either a valid OS object or raise an exception
        - the bulk of the OSFromDisk was moved to _TryOSFromDisk which returns
          status, value for the functions which don't want an exception raised
      
      The gnt-os list and diagnose commands still work after this patch.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      255dcebd
    • Iustin Pop's avatar
      Convert the jobqueue rpc to new style result · c8457ce7
      Iustin Pop authored
      
      This patch converts the job queue rpc calls to the new style result.
      It's done in a single patch as there are helper function (in both jqueue
      and backend) that are used by multiple rpcs and need synchronized
      change.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      c8457ce7
    • Iustin Pop's avatar
      Convert os_diagnose rpc to new style result · 83d92ad8
      Iustin Pop authored
      
      This also removes custom post-processing from rpc.py; since this call
      has only one user, it was simple to move it back to the caller.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      83d92ad8
    • Iustin Pop's avatar
      Convert call_version rpc to new style result · 90b54c26
      Iustin Pop authored
      
      This also cleans up its single use in cmdlib.py.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      90b54c26
    • Iustin Pop's avatar
      Conver node_leave_cluster rpc to new style result · 0623d351
      Iustin Pop authored
      
      This patch converts this rpc call to the new style result, and also
      changes in the process the meaning of the QuitGanetiException's
      arguments and the node daemon rpc call exception handler.
      
      The problem with the exception handler is that we used a two-stage one,
      and the inner used to catch all exception (including this one), so in
      the logs we always had an exception logged, instead of the normal
      'leaving cluster message'. The patch also adds logging of the
      exception's arguments, so that we have a trail in the logs about the
      shutdown mode.
      
      The exception's arguments were reversed from the normal RPC results
      style. While it makes somewhat more sense for this exception, we change
      them such that they match the rpc result format.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      0623d351
    • Iustin Pop's avatar
      Convert node_has_ip_address rpc to new style · c2fc8250
      Iustin Pop authored
      
      This should actually have a function in backend, but it's fine for now.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      c2fc8250
    • Iustin Pop's avatar
      Convert instance_list rpc to new style result · aca13712
      Iustin Pop authored
      
      Since backend.GetInstanceList() is used both as RPC endpoint and as
      internal function, it can't return (status, value). Instead it returns
      only valid instance info, and failures are denoted by exceptions; and
      the ganeti-noded function adds the (True,) status.
      
      The patch also fixes a typo.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      aca13712
    • Iustin Pop's avatar
      Convert volume_list rpc to new style result · 29d376ec
      Iustin Pop authored
      
      This is a big change, because we need to cleanup its users too.
      
      The call and thus LUVerifyDisks LU used to differentiate between failure
      at node level and failure at LV level, by returning different types in
      the RPC result. This is way too complicated for our needs.
      
      The patch changes to new style result (easy change), and then:
        - changes LUVerifyDisks.Exec() to return a tuple of 3-elements
          instead of 4-elements; we collapse the «nodes not reachable» and
          «nodes with LVM errors» in a single dict
        - changes gnt-cluster to parse 3-element results and simplifies the
          different by-error handling code
      
      Note that the status is added in ganeti-noded, and not in the function
      itself, as the function is used in other places too.
      
      This was tested with down nodes and broken VGs.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      29d376ec
Loading