1. 15 Oct, 2007 5 commits
  2. 12 Oct, 2007 8 commits
    • Michael Hanselmann's avatar
      Small wording changes and fix checks. · d7e49c13
      Michael Hanselmann authored
      Reviewed-by: iustinp
      
      d7e49c13
    • Iustin Pop's avatar
      Remove some hardcoded names/paths from backend.py · 7900ed01
      Iustin Pop authored
      This patch does the following:
        - add constants.GANETI_RUNAS = "root", which is used to compute
          the homedir (and thus the .ssh directory) instead of hardcoding
          "/root/.ssh" in backend.AddNode and backend.LeaveCluster
        - add constants.SSH_CONFIG_DIR (currently hardcoded to /etc/ssh) that
          is used in backend instead of hardcoding it (preparation for
          selecting that at ./configure time)
        - some more internal cleanup in backend.AddNode
      
      Reviewed-by: imsnah
      7900ed01
    • Michael Hanselmann's avatar
      Test “gnt-node evacuate” and “gnt-node failover” in QA. · 4b62db14
      Michael Hanselmann authored
      Reviewed-by: schreiberal
      
      4b62db14
    • Iustin Pop's avatar
      Add a generic write file function · 087b34fe
      Iustin Pop authored
      Currently there are a few version of "write a file safely" in the code.
      This patch adds a generic function that should be able to replace all
      the other versions.
      
      The "take attributes from the target file" option, while useful, is not
      implemented by this patch.
      
      Reviewed-by: imsnah,ultrotter
      087b34fe
    • Iustin Pop's avatar
      Do not walk the whole DATA_DIR on node leave · 71eca7c3
      Iustin Pop authored
      Since we remove only files from DATA_DIR and not from subdirectories,
      let's not walk the entire tree, a simple listdir suffices. Also switch
      to utils.RemoveFile from simple os.unlink.
      
      Reviewed-by: imsnah
      71eca7c3
    • Iustin Pop's avatar
      Enhance GetHomeDir to accept either names or UIDs · 257f4c0a
      Iustin Pop authored
      Currently GetHomeDir accepts UIDs only. Enhance it to accept either a
      user name or a user id, to allow for nicer usage.
      
      Reviewed-by: imsnah
      257f4c0a
    • Guido Trotter's avatar
      Reorder gnt-os simplify _GetAllOS and call it _DiagnoseByOS · fbdb07b9
      Guido Trotter authored
      Put some order in gnt-os putting helper functions above and command functions
      below. Also add a new _DiagnoseOSName() function and use it to make _GetAllOS
      simplier to understand. Change its name to _DiagnoseByOS which makes more clear
      what it does.
      
      
      
      Reviewed-by: iustinp
      
      fbdb07b9
    • Guido Trotter's avatar
      Fix ListOS which was broken · 216fe2f3
      Guido Trotter authored
      To do this we abstract the creation of the all_os dictionary, which was
      produced in DiagnoseOS and use it both for listing and diagnosing.
      
      
      Reviewed-by: iustinp
      
      216fe2f3
  3. 11 Oct, 2007 10 commits
    • Iustin Pop's avatar
      Some small improvements to the hooks environment · 0e137c28
      Iustin Pop authored
      For the configuration update hook, it's useful to have a consistent name
      for the target of the operation. As such, the LU code is modified to
      include an GANETI_OP_TARGET that points either to the cluster (name),
      node name or instance name depending on the opcode.
      
      Also, the NoHooksLU is modified such that its build env method returns
      an empty (but conformant) result. This should improve things in case by
      mistake this class' BuildHooksEnv is called.
      
      Reviewed-by: imsnah
      0e137c28
    • Iustin Pop's avatar
      Implement post-configuration-update hook · 6a4aa7c1
      Iustin Pop authored
      This patch adds a special hook: the post-configuration update hook. This
      hook has only a post phase that runs after a top-level LU that modified
      the configuration.
      
      Since the hook is a post-phase one, no error checking is done on the
      results. The hook runs only on the master.
      
      Reviewed-by: imsnah
      6a4aa7c1
    • Iustin Pop's avatar
      Split the hooks env building in two parts · 4167825b
      Iustin Pop authored
      This patch moves some of the environment processing from _BuildEnv to a
      new _RunWrapper command which does the stringification and adds the
      sstore variables.
      
      The reasoning is that the sstore can be fresher than before the
      execution (e.g.  in case of cluster init).
      
      In order to support thise, we also need to modify cmdlib.LUInitCluster:
        - memorize the sstore and cfgw newly created in the Exec function
        - no need to build the custom environment in the BuildHooks
      4167825b
    • Iustin Pop's avatar
      Move hook execution decision to HooksMaster · 9a395a76
      Iustin Pop authored
      Currently, the HooksMaster creation and execution decision is in the
      Processor class. This is not optimal, so we change to always create a
      hooks master and instead make the decision inside that class, by
      creating empty node lists for both pre and post if the lu doesn't
      support hooks. This way, hooks decisions are moved to HooksMaster (where
      they belong).
      
      Reviewed-by: imsnah
      9a395a76
    • Iustin Pop's avatar
      Remove cfg and sstore parameters to HooksMaster · f97a6b10
      Iustin Pop authored
      The HooksMaster class doesn't use the cfg parameter, and it's better to
      use it from the LU anyway (if needed). Let's remove it.
      
      Also, the sstore of the LU can be fresher than the sstore we got at init
      time, so use that instead and remove our own.
      
      Reviewed-by: imsnah
      f97a6b10
    • Iustin Pop's avatar
      Enable the ConfigWriter to keep track of updates · 14e15659
      Iustin Pop authored
      This allows external callers to determine if the configuration has been
      changed.
      
      Reviewed-by: imsnah
      14e15659
    • Oleksiy Mishchenko's avatar
      Docstring correction · f5abe9bd
      Oleksiy Mishchenko authored
      Reviewed-by: iustinp
      
      f5abe9bd
    • Alexander Schreiber's avatar
      Infrastructure for detailed instance restarts, part one · 7e1394dc
      Alexander Schreiber authored
      The beginning of the infrastructure for detailed instance restarts. Does
      not affect behaviour if code yet.
      
      Reviewed-by: iustinp
      
      7e1394dc
    • Michael Hanselmann's avatar
      Use the kernel's ability to generate UUIDs. · 59072e7e
      Michael Hanselmann authored
      This removes the dependency on either the uuid module or e2fsprogs' uuidgen.
      
      Reviewed-by: iustinp
      
      59072e7e
    • Iustin Pop's avatar
      Add small function to read the homedir of a user · 2f8b60b3
      Iustin Pop authored
      This can be used to replace hardcoded "/root/" paths.
      
      Reviewed-by: imsnah
      2f8b60b3
  4. 10 Oct, 2007 10 commits
    • Alexander Schreiber's avatar
      Remove fping as a dependency for Ganeti. · 16abfbc2
      Alexander Schreiber authored
      This patch completely  gets rid of fping
       - replace all fping invocations with TcpPing calls
       - update documentation accordingly.
       - associated cleanups (use constant for localhost IP, use more sensible
         defaults for TcpPing and _use_ those)
      
      Reviewed-by: iustinp
      
      16abfbc2
    • Michael Hanselmann's avatar
      Colours and warnings. · 23269c5b
      Michael Hanselmann authored
      - Implement colours in qa_utils.
      - Print warning for cron script.
      
      Reviewed-by: iustinp
      
      23269c5b
    • Iustin Pop's avatar
      Some small fixes to utils.GenerateTable · 01ca31ae
      Iustin Pop authored
      This adds:
        - fix the case when a dumb caller didn't stringify its values
        - explicitly raise a ProgrammerError in case a field is missing from
          the headers dictionary
      
      Reviewed-by: imsnah
      01ca31ae
    • Iustin Pop's avatar
      Fix AskUser to not die on extra input · 3023170f
      Iustin Pop authored
      Currently, AskUser dies with -ESPIPE if the user gives more than one
      character plus newline. This is because the python library, while
      returning only two chars from the readline(2) call, will cache the rest
      of the input, and when we do a write, it will try to seek back to just
      after the last returned char. This fails on /dev/tty, so an exception is
      raised. However, then opening the file descriptor in O_APPEND mode,
      python will not issue such seeks, thereby fixing this problem.
      
      The other alternative, opening in unbuffered mode, is not as good, since
      then python will issue one-byte reads at a time, but the tty will read
      the entire line, so at the next readline call, whatever remained in the
      descriptor buffer is returned from the kernel to python, and the user
      doesn't get a chance to enter something at all.
      
      Reviewed-by: imsnah
      3023170f
    • Michael Hanselmann's avatar
      Exit ganeti-watcher cleanly when there's no configuration. · 781b2b2b
      Michael Hanselmann authored
      Reviewed-by: iustinp
      
      781b2b2b
    • Iustin Pop's avatar
      Implement gnt-node evacuate · a5bc662a
      Iustin Pop authored
      This patch adds a new 'evacuate' subcommand to gnt-node. The command
      will do a replace disks for all instances having that node as secondary
      with the new target being the new node given.
      
      The syntax is:
        gnt-node evacuate src_node target_node
      
      The command by itself doesn't do any resource checks, and instead relies
      on the LUFailoverInstance code to do that.
      
      Reviewed-by: imsnah
      a5bc662a
    • Michael Hanselmann's avatar
      Make Xen DomU kernel and initrd configurable at build time. · f00b46bc
      Michael Hanselmann authored
      Reviewed-by: iustinp
      
      f00b46bc
    • Michael Hanselmann's avatar
      Add preliminary developer notes. · 832aef24
      Michael Hanselmann authored
      Reviewed-by: iustinp
      
      832aef24
    • Iustin Pop's avatar
      Remove the shebang from modules · 2f31098c
      Iustin Pop authored
      Since modules are not directly executables, remove the shebang from
      them. This helps with lintian warnings.
      
      Also make the autogenerated _autoconf.py contain two comment lines at
      the beginning, like the other modules.
      
      Reviewed-by: ultrotter
      2f31098c
    • Michael Hanselmann's avatar
      Detect node restarts and reactivate disks. · 5a3103e9
      Michael Hanselmann authored
      - Change format of watcher state file to JSON.
      - Move log path for watcher script to constants.py.
      
      Reviewed-by: iustinp
      
      5a3103e9
  5. 09 Oct, 2007 7 commits