Skip to content
Snippets Groups Projects
  1. Jan 04, 2010
  2. Oct 22, 2009
  3. Oct 13, 2009
  4. Oct 09, 2009
  5. Aug 25, 2009
  6. Aug 24, 2009
  7. Aug 17, 2009
  8. Aug 10, 2009
  9. Aug 06, 2009
  10. Aug 05, 2009
  11. Aug 04, 2009
  12. Jul 29, 2009
  13. Jul 26, 2009
  14. 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
  15. Jul 24, 2009
  16. Jul 23, 2009
  17. Jul 22, 2009
  18. Jul 08, 2009
  19. Jun 29, 2009
  20. 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
    • Iustin Pop's avatar
      Convert export_info rpc to new style result · 3eccac06
      Iustin Pop authored
      
      This also removes some code from ganeti-noded and rpc.py, which should
      not do such processing of data (and be simply glue code). (Or
      alternatively they could, if we had better infrastructure).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      3eccac06
  21. Jun 09, 2009
    • Iustin Pop's avatar
      rpc: Add a simple failure reporting framework · 2cc6781a
      Iustin Pop authored
      
      This patch adds a simple failure reporting tool, similar to bdev's
      _ThrowError. In backend, we move towards the new-style RPC results (of
      type (status, payload)) and thus functions which use this style can very
      easily log and return the error message using this new function.
      
      The exception is declared here and not in errors.py since it's local to
      the node-daemon/backend combination.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      2cc6781a
  22. May 27, 2009
    • Iustin Pop's avatar
      Add a node powercycle command · f5118ade
      Iustin Pop authored
      
      This (somewhat big) patch adds support for remotely rebooting the nodes
      via whatever support the hypervisor has for such a concept.
      
      For KVM/fake (and containers in the future) this just uses sysrq plus a
      ‘reboot’ call if the sysrq method failed. For Xen, it first tries the
      above, and then Xen-hypervisor reboot (we first try sysrq since that
      just requires opening a file handle, whereas xen reboot means launching
      an external utility).
      
      The user interface is:
      
          # gnt-node powercycle node5
          Are you sure you want to hard powercycle node node5?
          y/[n]/?: y
          Reboot scheduled in 5 seconds
      
      The node reboots hopefully after sending the reply. In case the clock is
      broken, “time.sleep(5)” might take ages (but then I suspect SSL
      negotiation wouldn't work).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      f5118ade
  23. May 06, 2009
  24. May 05, 2009
Loading