Skip to content
Snippets Groups Projects
  1. Jan 27, 2009
    • Iustin Pop's avatar
      Rework the multi-instance gnt commands · 479636a3
      Iustin Pop authored
      This patch changes the multi-instance gnt-* commands (gnt-instance
      start/stop, gnt-node evacuate/failover) such that the individual
      operations are submitted in parallel, ideally improving the speed of the
      execution.
      
      The patch does this by abstracting the job set functionality into a new
      class in cli.py, that takes care of the job submit, job poll and error
      handling.
      
      Reviewed-by: ultrotter
      479636a3
  2. Jan 12, 2009
  3. Dec 17, 2008
    • Michael Hanselmann's avatar
      Add job queue size limit · f87b405e
      Michael Hanselmann authored
      A job queue with too many jobs can increase memory usage and/or make
      the master daemon slow. The current limit is just an arbitrary number.
      A "soft" limit for automatic job archival is prepared.
      
      Reviewed-by: iustinp
      f87b405e
  4. Dec 11, 2008
    • Iustin Pop's avatar
      Fix epydoc format warnings · c41eea6e
      Iustin Pop authored
      This patch should fix all outstanding epydoc parsing errors; as such, we
      switch epydoc into verbose mode so that any new errors will be visible.
      
      Reviewed-by: imsnah
      c41eea6e
  5. Nov 28, 2008
  6. Nov 27, 2008
    • Iustin Pop's avatar
      Small change to job failure output · 0e050889
      Iustin Pop authored
      Currently, job failures are done by raising OpExecError(job result). For
      a one-opcode job that failed, this is very non-intuitive:
      Failure: command execution error:
      [u'Disk size change not possible, use grow-disk']
      
      This patch changes the output in two ways:
       - for a job which didn't have opcodes which succeeded, it changes it
         to:
         Failure: command execution error:
         Disk size change not possible, use grow-disk
       - for a job with partial completion, to:
         Failure: command execution error:
         partial failure (opcode 1): Cannot remove the last disk of an
         instance
      
      The actual error type is not changed. A job that doesn't have at least
      an error-ed opcode is shown as before.
      
      Reviewed-by: imsnah
      0e050889
  7. Nov 23, 2008
    • Iustin Pop's avatar
      Enable auto-unit formatting in script output · 9fbfbb7b
      Iustin Pop authored
      This patch enables by default the old 'human-readable' option, but in a
      slightly different model.
      
      The option is now called "units" and takes either:
       - 'h' for automatic formatting
       - 'm', 'g' or 't' for mebi/gibi/tebibytes
      
      If 'h' is used, we add a unit suffix, otherwise nothing is added so that
      parsing is easy.
      
      The default value of this unit is:
        - 'h' if a separator is not passed
        - 'm' if a separator is passed
      
      Reviewed-by: ultrotter
      9fbfbb7b
  8. Nov 21, 2008
    • Iustin Pop's avatar
      Make cli.py use FieldSet for matching fields · 00430f8e
      Iustin Pop authored
      This changes cli.py to FieldSet usage so that gnt-instance list will
      format nicely the disk.size/*, and the count of disks/nics.
      
      Reviewed-by: ultrotter
      00430f8e
    • Michael Hanselmann's avatar
      Reuse HTTP client pool for RPC · 4331f6cd
      Michael Hanselmann authored
      ganeti-masterd: Add initialization and shutdown of RPC pool. It needs
      to be shutdown before forking.
      
      ganeti.cli: Add decorator function to initialize and shutdown RPC pool.
      
      ganeti.rpc: Add functions to initialize and shutdown RPC pool. Throw
      exception when used without proper initialization.
      
      gnt-cluster, gnt-node: Use decorator function to initialize and shutdown
      RPC pool.
      
      Reviewed-by: iustinp
      4331f6cd
  9. Nov 18, 2008
    • Iustin Pop's avatar
      Allow querying of variable number of parameters · 71c1af58
      Iustin Pop authored
      This patch adds support for querying in gnt-instance list of:
        - disk.count
        - nic.count
        - disk.size/$N
        - nic.(ip|mac|bridge)/$N
      
      The patch also disables the exception raised when the header description
      is missing, that should be fixed in the future (together with better
      handling of variable numeric fields).
      
      Reviewed-by: imsnah
      71c1af58
  10. Oct 23, 2008
    • Iustin Pop's avatar
      Fix gnt-* command with --submit · d8353c3a
      Iustin Pop authored
      Currently we don't catch the JobSubmittedException (although the code to
      format it nicely is there). The patch adds the exception name to the
      catch list and makes --submit work.
      
      Reviewed-by: imsnah
      d8353c3a
  11. Oct 20, 2008
    • Iustin Pop's avatar
      Remove the logger.py module · 82d9caef
      Iustin Pop authored
      Since now we use only one function from the logger module
      (SetupLogging), we move it to utils.py (which is already imported by all
      users of this function), and we remove the module.
      
      Reviewed-by: imsnah
      82d9caef
    • Iustin Pop's avatar
      Convert cli.py to logging · 46fbdd04
      Iustin Pop authored
      We also add two function for printing messages, so that scripts won't
      have to import logger to get these. They are a simple extension over the
      logger ones, as they accept the call style from logging:
       ToStdout("Message: %s", msg)
      (instead of requiring formatting by the client.
      
      Reviewed-by: imsnah
      46fbdd04
  12. Oct 15, 2008
    • Iustin Pop's avatar
      Implement the job queue drain flag · 686d7433
      Iustin Pop authored
      We add a (per-node) queue drain flag that blocks new job submission.
      There is not yet an interface to add/remove the flag (will come in next
      patches).
      
      Reviewed-by: imsnah
      686d7433
  13. Oct 14, 2008
    • Iustin Pop's avatar
      Add cli function for beparams validation · a604f165
      Iustin Pop authored
      This is used to validate the parameters in both “gnt-instance add” and
      “gnt-backup import”.
      
      Reviewed-by: ultrotter
      a604f165
    • Iustin Pop's avatar
      Implement parameter removal in SplitKeyVal · fcd62d84
      Iustin Pop authored
      This patch adds paramter removal in SplitKeyVal, by prefixing a
      value-less key with "-"; this is needed in resetting parameters back to
      cluster defaults, but care must be applied now that None can come from
      the parser.
      
      Reviewed-by: imsnah
      fcd62d84
  14. Oct 13, 2008
    • Iustin Pop's avatar
      Add two new options types for CLI usage · a8469393
      Iustin Pop authored
      For the new 2.0-style command line options, we need to parse strings of
      the type:
        ident:key=val[,...]
      and
        key=val[,...]
      
      This patch adds two new option builders for these two, which return
      (ident, {key=val,}) and {key=val,} for the above two formats. It also
      handles specially constructs of type “key” (val is set to True) and
      “no_key” (val is set to False, and the ‘no_’ prefix is stripped).
      
      Reviewed-by: imsnah
      a8469393
  15. Oct 06, 2008
    • Iustin Pop's avatar
      Implement job auto-archiving · 07cd723a
      Iustin Pop authored
      This patch adds a new luxi call that implements auto-archiving of jobs
      older than a certain age (or -1 for all completed jobs), and the gnt-job
      command that makes use of this (with 'all' for -1).
      
      Reviewed-by: imsnah
      07cd723a
    • Iustin Pop's avatar
      Add a simple timespec parsing function · 2241e2b9
      Iustin Pop authored
      This function will be used for auto-archiving jobs via the command line.
      The function is pretty simple, we only support up to weeks since months
      and higher are not 'precise' entities, and dealing with them would
      require us to start using calendar functions.
      
      Reviewed-by: imsnah
      2241e2b9
    • Iustin Pop's avatar
      Fix gnt-job list with empty timestamps · e0ec0ff6
      Iustin Pop authored
      In case the job object doesn't have a timestamp (which is a separate
      issue), the listing should not break. We fix this by changing the
      FormatTimstamp function itself to return '?' in case the timestamp
      doesn't look good (note that it still can break if non-integers are
      returned, but this is unlikely).
      
      Reviewed-by: imsnah
      e0ec0ff6
  16. Oct 01, 2008
    • Iustin Pop's avatar
      Change the results from cli.PollJob · 53c04d04
      Iustin Pop authored
      Curently PollJob accepts a generic job, but will return (history
      artifact) only the first opcode result. This is wrong, as it doesn't
      allow polling of a job with multiple results.
      
      Its only caller (for now) is also changed, so no functional changes
      should happen.
      
      Reviewed-by: ultrotter, amishchenko
      53c04d04
  17. Sep 30, 2008
    • Iustin Pop's avatar
      Abstract the timestamp formatting into cli.py · 3386e7a9
      Iustin Pop authored
      Currently we format the timestamp inside the gnt-job info function. We
      will need this more times in the future, so move it to cli.py as a
      separate, exported function.
      
      Reviewed-by: imsnah
      3386e7a9
  18. Sep 10, 2008
    • Iustin Pop's avatar
      Rewrite the 'only submit job' handling in scripts · e9d741b6
      Iustin Pop authored
      The "sys.exit(0)" was not nice as you couldn't differentiate it from
      other exit codes. We change this to a specially defined exception for
      this, so that multi-opcode commands can handle this nicely.
      
      Reviewed-by: imsnah
      e9d741b6
  19. Aug 28, 2008
  20. Aug 27, 2008
    • Michael Hanselmann's avatar
      Make sure that client programs get all messages · 6c5a7090
      Michael Hanselmann authored
      This is a large patch, but I can't figure out how to split it without
      breaking stuff. The old way of getting messages by always getting the
      last one didn't bring all messages to the client if they were added
      too fast, thereby making commands like “gnt-cluster verify” less than
      useful. These changes now introduce some sort a serial number per
      log entry to keep track what message a client already received. They
      also remove the log lock per opcode to make reading log entries thread
      safe.
      
      Reviewed-by: ultrotter
      6c5a7090
  21. Aug 11, 2008
  22. Aug 07, 2008
  23. Aug 04, 2008
    • Iustin Pop's avatar
      Implement job submission for scripts · 94428652
      Iustin Pop authored
      This patch adds the infrastructure for executing a job in background,
      instead of foreground, via a new “--submit” option. The behaviour is
      that the job ID is printed and the script will immediately exit.
      
      The patch also converts gnt-node list to this model (yes, this will be a
      query in the future).
      
      Reviewed-by: imsnah
      94428652
  24. Jul 31, 2008
    • Iustin Pop's avatar
      Split cli.SubmitOpCode in two parts · 0a1e74d9
      Iustin Pop authored
      The current SubmitOpCode function is not flexible enough to be used for
      submitters that don't want to wait for the job finish.
      
      The patch splits this in two, a SendJob function and a PollJob one, and
      the old SubmitOpCode becomes a wrapper. Note that the new SendJob takes
      a list of opcodes (and not a single opcode anymore).
      
      Reviewed-by: imsnah
      0a1e74d9
  25. Jul 30, 2008
    • Iustin Pop's avatar
      Make gnt-* commands fail nicely on non-masters · b33e986b
      Iustin Pop authored
      This patch adds a check that we are on the master after failing to
      connect to the socket, and log nicely the master name.
      
      Reviewed-by: ultrotter
      b33e986b
    • Iustin Pop's avatar
      Fix pylint-detected issues · 38206f3c
      Iustin Pop authored
      This is mostly:
        - whitespace fix (space at EOL in some files, not all, broken
          indentation, etc)
        - variable names overriding others (one is a real bug in there)
        - too-long-lines
        - cleanup of most unused imports (not all)
      
      Reviewed-by: ultrotter
      38206f3c
    • Iustin Pop's avatar
      Unify SetupDaemon/SetupLogging · 59f187eb
      Iustin Pop authored
      The 'old-style' info, error, debug logs do not make much sense. This
      patch unifies the SetupLogging and SetupDaemon functions. As a result,
      all the commands logs to a 'commands.log' file.
      
      The patch also changes the log setup to keep going if there's an error
      in setting up the file logging but we're logging to stderr.
      
      Also, burnin now logs to its own file (burnin.log).
      
      Reviewed-by: ultrotter
      59f187eb
  26. Jul 14, 2008
    • Iustin Pop's avatar
      Improve cli.SubmitOpCode · e2212007
      Iustin Pop authored
      Currently, the feedback_fn argument to SubmitOpCode is no longer used.
      We still need it in burnin, so we re-enable it by making the code call
      that function with the msg argument in case feedback_fn is callable. The
      patch also modifies burnin to accept the new argument format (msg is not
      a triple instead of a string).
      
      The patch also removes the ‘proc’ argument as it's obsolete; instead we
      can accept a luxi.Client instance (noone uses this right now).
      
      Reviewed-by: ultrotter
      e2212007
    • Iustin Pop's avatar
      First version of user feedback fixes · f1048938
      Iustin Pop authored
      This patch contains a raw version for fixing feedback_fn.
      
      The new mechanism works as follows:
        - instead of a per-Processor feedback_fn, there's one for each
          ExecOpCode, so that feedback for different opcodes go via possibly
          different functions
        - each _QueuedOpCode gets a message buffer, a method for adding
          feedback and a method for retrieving (parts of) the feedback
        - the _QueuedJob object gets a new attribute that is equal to the
          index of the currently executing opcode
        - job queries get an extra parameter called 'ticker' that will return
          the latest message on the current executing opcode
        - the cli.py job completion poll will show the new status if different
          from the old one
      
      Of course, quick messages will be lost, as currently only the latest one
      is available. Also changes between opcodes are not represented at all.
      
      Reviewed-by: imsnah
      f1048938
  27. Jul 11, 2008
  28. Jul 09, 2008
  29. Jul 03, 2008
  30. Jun 21, 2008
    • Iustin Pop's avatar
      Implement handling of luxi errors in cli.py · 03a8dbdc
      Iustin Pop authored
      Currently the generic handling of ganeti errors in cli.py (GenericMain
      and FormatError) only handles the core ganeti errors, and not the client
      protocol errors (which live in a separate hierarchy).
      
      This patch adds handling of luxi errors too, and also adds another luxi
      error for the case when the master is not running. This gives us a nice:
      
        gnta1:~# gnt-node list
        Cannot communicate with the master daemon.
        Is it running and listening on '/var/run/ganeti-master.sock'?
      
      error message instead of a traceback.
      
      Reviewed-by: amishchenko
      03a8dbdc
  31. Jun 13, 2008
Loading