Skip to content
Snippets Groups Projects
  1. Apr 28, 2008
    • Iustin Pop's avatar
      Move iallocator script execution to ganeti-noded · 8d528b7c
      Iustin Pop authored
      Currently the iallocator execution takes place in the master, which is a
      violation of the current architecture, and will create problems with a
      threaded master daemon.
      
      This patch moves the execution to the backend, similar to the hooks
      runner, by:
        - introducing a new class that handles the execution in the backend
          (and could be used also for listing the allocators, etc.)
        - introducing a new rpc call
        - replacing the actual execution in IAllocator.Run() with a rpc call
      
      This passes burnin with the dumb allocator
      
      Reviewed-by: imsnah
      8d528b7c
  2. Apr 10, 2008
    • Iustin Pop's avatar
      Add per-opcode results to job processing · 35049ff2
      Iustin Pop authored
      This patch changes the definition of a job and introduces per-opcode
      results.
      
      First, the result and status fields of a job are condensed into a single
      'status' attribute. Then, we introduce an opcode status and one result
      list, that allow jobs to return values.
      
      The gnt-job script is also modified to allow these new fields to be
      queried.
      
      Note that the patch changes the opcode field to op_list, and it changes
      its return value from string to a list of (serialized) opcodes.
      
      Reviewed-by: ultrotter
      35049ff2
  3. Apr 05, 2008
    • Iustin Pop's avatar
      Implement forking/master role checking in masterd · c1f2901b
      Iustin Pop authored
      This patch adds checks for the master role and daemonize support to
      ganeti-masterd.
      
      The patch modifies the startup/shutdown of the server because:
        - we want bind()/listen() to the master socket to occur before forking
          so that we can return a correct exit code and write messages to
          stderr
        - but we want thread startup to occur after fork(), otherwise python
          threading gets confused
      
      The patch also has some small cleanups:
        - remove the unix socket after closing it, so we don't need to remove
          it manually
        - instead of just telling the threads to terminate via the new_queue,
          we also join() them so that the logs show what thread clinging to
          life
        - the daemon logs to its own logfile now
        - there is command line parameter support :)
      
      Reviewed-by: imsnah
      c1f2901b
    • Manuel Franceschini's avatar
      ganeti-noded directory functions for file backend · a5d7fb43
      Manuel Franceschini authored
      Reviewed-by: ultrotter
      a5d7fb43
  4. Apr 04, 2008
    • Iustin Pop's avatar
      Add a simple gnt-job script · 7a1ecaed
      Iustin Pop authored
      This patch adds a very basic gnt-job script that allows job querying.
      This goes on top of the previous master daemon patches.
      
      Currently, because of the not-changed cmd lock, you can't query the jobs
      as long as a job is running - you have to rm the cmd lock and then you
      can query the jobs.
      
      Reviewed-by: imsnah
      7a1ecaed
    • Iustin Pop's avatar
      Move the daemonize function to utils.py · 8f765069
      Iustin Pop authored
      Currently, in ganeti-noded we have the createDaemon function. Since
      we'll need the same in other daemons, we move this function to utils.py
      
      With the move, a few changes were also done:
        - change the name to Daemonize()
        - add a parameter, logfile, as different daemons will want to log to
          different files
        - remove the try.. except.. around the fork calls, since they were
          only re-raising the OS exception with less data; unless we want to
          actually handle fork error (not just re-raising), these try blocks
          are not useful
        - change the return style at the end of the function
      
      Reviewed-by: imsnah
      8f765069
  5. Apr 01, 2008
    • Iustin Pop's avatar
      Initial tests with ganeti-masterd · ffeffa1d
      Iustin Pop authored
      This patch adds a very in-progress master daemon. This needs to be
      launched manually, does not background itself, but can be used for
      opcode execution.
      
      Also parts of this code should be moved to luxi.py.
      
      Reviewed-by: ultrotter
      ffeffa1d
  6. Mar 27, 2008
  7. Mar 19, 2008
    • Iustin Pop's avatar
      Make ganeti-noded create BDEV_CACHE_DIR automatically · 0214b0c0
      Iustin Pop authored
      Currently in order to deal with tmpfs /var/run, we create the
      BDEV_CACHE_DIR in the init script. However, that does not cover all the
      cases, and it's not a proper place to deal with it: for example, dealing
      with not initialized clusters and the master node is more complicated.
      
      Therefore, this patch does:
        - make ganeti-noded create the directory automatically
        - make ganeti-noded error out if it can't create it or it's already
          there but not a directory
        - remove the creation from the init.d script
      
      Reviewed-by: ultrotter
      0214b0c0
  8. Mar 11, 2008
    • Iustin Pop's avatar
      Modify utils.TcpPing to make source address optional · b15d625f
      Iustin Pop authored
      This patch modifies TcpPing and its callers to make the source address
      selection optional. Usually, the kernel will know better what
      source address to use, just in some cases we want to enforce a given
      source address so it makes sense to make this optional.
      
      Reviewed-by: ultrotter
      b15d625f
  9. Feb 22, 2008
    • Iustin Pop's avatar
      Break trunk by removing twisted · 81010134
      Iustin Pop authored
      This patch switches from the twisted usage for inter-node protocol to
      simple BaseHTTPServer/httplib. The patch has more deletions because we
      use no authentication, no encryption at all.
      
      As such, this is just for trunk, and only for testing. What it brings is
      the ability to use the rpc library from within multiple threads in
      parallel (or it should so).
      
      Since the changes are very few and non-intrusive, they can be reverted
      without impacting the rest of the code.
      
      This passes burnin. QA was not tested.
      
      Reviewed-by: imsnah
      81010134
  10. Feb 05, 2008
  11. Dec 12, 2007
  12. Dec 03, 2007
  13. Nov 29, 2007
  14. Nov 13, 2007
  15. Nov 05, 2007
    • Guido Trotter's avatar
      Convert os_get to use OS rather than InvalidOS · dfa96ded
      Guido Trotter authored
      In order to do this for simplicity we leave the OSFromDisk function as-is and
      we convert the eventual exception to an OS object in ganeti-noded. The
      unmangling gets simplified and so does the code for checking whether the OS is
      valid.
      
      Reviewed-By: iustinp
      
      dfa96ded
    • Guido Trotter's avatar
      Simplify diagnose mangling/unmangling functions · 4e679f11
      Guido Trotter authored
      The functions in ganeti-noded and rpc.py still deal with the fact that an
      InvalidOS error could be returned by DiagnoseOS. As this is not the case
      anymore simplify their code for the current behavior.
      
      Reviewed-By: iustinp
      
      4e679f11
  16. Nov 02, 2007
    • Iustin Pop's avatar
      Implement device to instance mapping cache · 3f78eef2
      Iustin Pop authored
      Currently, troubleshooting DRBD problems involves a manual process of going
      backwards from the DRBD device to the instance that owns it.
      
      This patch adds a weak (i.e. not guaranteed to be correct or up-to-date)
      cache of device to instance. The cache should be, in normal operation,
      having correct information as the only time when devices change paths
      are when they are started/stopped, and the code in backend.py adds cache
      updates to exactly these operations.
      
      The only drawback of this implementation is that we don't fully update
      the cache on renames of devices (we clean the old entries but we don't
      add new ones). Since the rename changes the path only for LVs (and not
      drbd and md), this is less of a problem as the target of this code is
      debugging DRBD and MD issues.
      
      The patch writes files named bdev_drbd<N> (or bdev_md<N>,
      bdev_xenvg_...) in /var/run/ganeti (more exactly, LOCALSTATEDIR/ganeti).
      The files start with 'bdev_' and continue with the path of the device
      under /dev/ (this prefix stripped), and contain the following values,
      space separated:
        - instance name
        - primary or secondary (depending on how the device is on the primary
          or secondary node)
        - instance visible name: sda or sdb or not_visible, the latter case
          when the device is not the top-level device (i.e. remote_raid1
          templates will have sd[ab] for the md, but not_visible for drbd and
          logical volumes)
      
      The cache is designed to not raise any errors, if there is an I/O error
      it will only be logged in the node daemon log file. This is in order to
      reduce the possible impact of the cache on the block device activation
      and shutdown code.
      
      Reviewed-by: imsnah
      3f78eef2
  17. Oct 29, 2007
    • Iustin Pop's avatar
      Implement block device renaming · f3e513ad
      Iustin Pop authored
      This patch add code for renaming a device; more precisely, for changing
      the unique_id of the device. This means:
        - logical volumes, rename the volume
        - drbd8, change the remote peer
      
      This is needed for the being able to replace disks for drbd8.
      
      Reviewed-by: imsnah
      f3e513ad
  18. Oct 25, 2007
    • Iustin Pop's avatar
      Modify two mirror-device related rpc calls · 153d9724
      Iustin Pop authored
      The two calls mirror_addchild and mirror_removechild take only one child
      for addition/removal. While this is enough for our md usage, for local
      disk replacement in drbd8, we need to be able to specify both the data
      and metadata device. This patch modifies these two rpc calls (and their
      backend implementation and their usage in cmdlib) to take a list of
      children to add/remove.
      
      Reviewed-by: imsnah
      153d9724
  19. Oct 17, 2007
    • Alexander Schreiber's avatar
      Patch series for reboot feature, part 1 · 007a2f3e
      Alexander Schreiber authored
      This patch series implements the reboot command for gnt-instance. It
      supports three types of reboot: soft (hypervisor reboot), hard (instance
      config rebuild and reboot) and full (full instance shutdown and startup
      again).
      
      This patch contains the backend and rpc part of the patch.
      
      
      Reviewed-by: iustinp
      
      007a2f3e
  20. Oct 15, 2007
    • Iustin Pop's avatar
      Fix node daemon log file permissions · b50f022f
      Iustin Pop authored
      The creation of the log file for the node daemon lacks the mode
      parameter, so after applying the current umask, the file got 0700
      permissions. Restrict this to the correct 0600.
      
      Reviewed-by: schreiberal
      b50f022f
  21. Oct 10, 2007
  22. Oct 04, 2007
  23. Sep 21, 2007
    • Iustin Pop's avatar
      Remove requirement that host names are FQDN · 89e1fc26
      Iustin Pop authored
      We currently require that hostnames are FQDN not short names
      (node1.example.com instead of node1). We can allow short names as long
      as:
        - we always resolve the names as returned by socket.gethostname()
        - we rely on having a working resolver
      
      These issues are not as big as may seem, as we only did gethostname() in
      a few places in order to check for the master; we already required
      working resolver all over the code for the other nodes names (and thus
      requiring the same for the current node name is normal).  The patch
      moves some resolver calls from within execution path to the checking
      path (which can abort without any problems). It is important that after
      this patch is applied, no name resolving is called from the execution
      path (LU.Exec() or other code that is called from within those methods)
      as in this case we get much better code flow.
      
      This patch also changes the functions for doing name lookups and
      encapsulates all functionality in a single class.
      
      The final change is that, by requiring working resolver at all times, we
      can change the 'return None' into an exception and thus we don't have to
      check manually each time; only some special cases will check
      (ganeti-daemon and ganeti-watcher which are not covered by the
      generalized exception handling in cli.py). The code is cleaner this way.
      
      Reviewed-by: imsnah
      89e1fc26
    • Iustin Pop's avatar
      Move a constant from ganeti-master to constants.py · 619fdc8e
      Iustin Pop authored
      The EXIT_NODESETUP_ERROR is a useful constant and ganeti-watcher could
      use it too. This patch moves it to constants.py and modifed the
      ganeti-master script to use it from there.
      
      Reviewed-by: imsnah
      619fdc8e
  24. Sep 17, 2007
  25. Aug 20, 2007
  26. Aug 14, 2007
    • Iustin Pop's avatar
      Style changes for pep-8 and python-3000 compliance. · 3ecf6786
      Iustin Pop authored
      This changes the raising of exceptions from:
        raise Exception, value
      to
        raise Exception(value)
      
      as the first form will be removed in python-3000 and the second form is
      preferred now.
      
      The changes also involve a few cases of changing from raising standard
      exceptions and use our own ones.
      
      The new version also fixes many pylint-generated warnings, especially in
      ganeti-noded where I changed many methods to @staticmethod.
      
      There is no functionality changed (barring any bugs).
      3ecf6786
  27. Aug 03, 2007
  28. Jul 26, 2007
  29. Jul 25, 2007
  30. Jul 24, 2007
  31. Jul 23, 2007
    • Iustin Pop's avatar
      Big change/cleanup in relation to the master startup: · 880478f8
      Iustin Pop authored
        - move the master node name from the ConfigWriter to SimpleStore (all
          nodes need this, and it was the only thing pulled in from the
          ConfigWriter on nodes)
        - fix mcpu.py and the testing w.r.t. this change; for testing, rename
          the fake_config.py to mocks.py and add a FakeSStore object
        - then add a ganeti-master script which can be run on any node at boot
          and which will not do anything if not master on start (on stop it
          will still try to remove the ip address)
        - also add a new cluster-wide variable (master_netdev) that determines
          on which interface we add this ip address; it's customizable at
          cluster init time
        - also remove the cluster name file which was separately handled from
          ssconf (not needed anymore)
        - remove the master init.d links from the list of config files as this
          is not our responsibility now
      
      880478f8
  32. Jul 18, 2007
Loading