1. 01 May, 2008 1 commit
  2. 30 Apr, 2008 8 commits
    • Manuel Franceschini's avatar
      Remove deprecated disk templates from doc · 808753d4
      Manuel Franceschini authored
      Since local_raid1 and remote_raid1 are deprecated they are removed
      from the docs. This patch removes some old documentation sections
      and bumps the documented version from 1.2 to 1.3.
      
      Reviewed-by: iustinp
      808753d4
    • Guido Trotter's avatar
      hooks.sgml: Add cluster-verify hooks information · 470e7e06
      Guido Trotter authored
      Reviewed-by: iustinp
      
      470e7e06
    • Guido Trotter's avatar
      Add cluster-verify hooks · d8fff41c
      Guido Trotter authored
      Only post-hooks are run on cluster verify, and then their output is sent back
      to the LU, which upon failure displays it to the user and changes the result of
      the execution to a failure.
      
      Reviewed-by: iustinp
      
      d8fff41c
    • Guido Trotter's avatar
      Add a LU Hooks notification function · 1fce5219
      Guido Trotter authored
      Previously LUs could be failed by pre-hooks, and post-hooks just had effects by
      themselves. This patch allows a LU to define the HooksCallBack function if it
      wants to know about its hooks' results and alter its results in response.
      
      The ChainOpCode execution path contains some commented out hooks code, which
      this patch modifies to run the HooksCallBack function, so this is not forgot if
      it ever gets uncommented out.
      
      Reviewed-by: iustinp
      
      1fce5219
    • Guido Trotter's avatar
      HooksMaster: Make RunPhase return the rpc output · b07a6922
      Guido Trotter authored
      Right now the hooks output is propagated from the nodes all the way up to
      HooksMaster.RunPhase, which uses it for debugging PRE hooks, but then silently
      discards them. We'll now propagate it up to the Processor.ExecOpCode function,
      where they can be handled for other purposes (or discarded again, of course).
      This patch also improves a bit the HooksMaster.RunPhase docstring.
      
      Reviewed-by: iustinp
      
      b07a6922
    • Guido Trotter's avatar
      Remove NoHooksLU.BuildHooksEnv · 10cd4a29
      Guido Trotter authored
      Since NoHooksLU defines HPATH as None, BuildHooksEnv will never be called (as
      the LogicalUnit.BuildHooksEnv docstring correctly states). Removing the
      function altogether, to avoid having dead code lying around, and to make sure
      the non-implemented one in LogicalUnit will be called if someone mistakenly
      tries to call it, so it's immediately clear that something is wrong.
      
      Reviewed-by: iustinp
      
      10cd4a29
    • Guido Trotter's avatar
      LogicalUnit.BuildHooksEnv, update docstring · 8a3fe350
      Guido Trotter authored
      The LogicalUnit.BuildHooksEnv docstring used to say that the node list should
      not include the master node. This is obviously not the case checking the
      relevant code, and double-checking with iustin he confirmed it just document
      some obsolete behaviour. This patch removes those remarks making the docstring
      shorter, easier, and, last but not least, correct! ;)
      
      Reviewed-by: iustinp
      
      8a3fe350
    • Guido Trotter's avatar
      Remove non-existing arguments from some docstrings · 7b7857ee
      Guido Trotter authored
      A fewdocstrings in the HooksRunner backend class list arguments the relevant
      functions do not take.  Clean them up.
      
      Reviewed-by: iustinp
      
      7b7857ee
  3. 29 Apr, 2008 3 commits
  4. 28 Apr, 2008 9 commits
    • Manuel Franceschini's avatar
      Raise PrereqError when exporting file-based instance · b6023d6c
      Manuel Franceschini authored
      This patch adds a check to LUExportInstance.CheckPrereq to raise an
      error when an instance with file disks is exported.
      
      Reviewed-by: ultrotter
      b6023d6c
    • Manuel Franceschini's avatar
      Add file backend storage options to ImportInstance · 93cb65c5
      Manuel Franceschini authored
      This patch adds the file storage options to gnt-backup import which
      would otherwise fail since the values of file_storage_dir and
      file_driver are accessed in LUCreateInstance.
      
      Reviewed-by: ultrotter
      93cb65c5
    • Michael Hanselmann's avatar
      Split hypervisor.py into several files · 65a6f9b7
      Michael Hanselmann authored
      Before it was a huge file with more than 700 lines. No code changes were
      made except for changing imports and class names where needed. In the
      future, we could even think about only importing the hypervisors we
      actually need. The patch finished QA scripts and distcheck successfully.
      
      Reviewed-by: iustinp
      65a6f9b7
    • Iustin Pop's avatar
      Move the 'cmd' lock from cli.py to ganeti-masterd · a4af651e
      Iustin Pop authored
      This patch removes the lock and the lock options from cli.py and moves
      them to the master.
      
      Later during development we can remove it completely, but for now it's
      good to protect any other tool that uses the lock directly.
      
      Reviewed-by: imsnah,ultrotter
      a4af651e
    • Iustin Pop's avatar
      Convert cli.SubmitOpCode to use the master · 685ee993
      Iustin Pop authored
      This patch converts the cli.py SubmitOpCode method to use the unix
      protocol and thus execute the opcodes via the master.
      
      The patch allows a partial burnin to work with the master. Currently the
      query opcodes, since they are executed via the SubmitOpCode, are
      executed inside a job too, which is suboptimal, but they work fine.
      
      The cmd lock has been removed from the master, but the cli.py still
      takes the lock. This is ok for this in-progress patch (since the master
      still has only one executor thread). This will be fixed in a future
      patch.
      
      Reviewed-by: ultrotter
      685ee993
    • Manuel Franceschini's avatar
      Add check for major/minor in _FormatBlockDevInfo · fd38ef95
      Manuel Franceschini authored
      bdev.FileStorage does not have major or minor fields, so gnt-instance
      info for file backed instances fails with a TypeError. This patch
      adds checks to prevent that and print 'N/A' instead.
      
      Reviewed-by: imsnah
      fd38ef95
    • Manuel Franceschini's avatar
      Make testSignal unittest not depend on default shell · 01fd6005
      Manuel Franceschini authored
      This patch changes the code executed when testing the signal handling
      of RunCmd. Since sh does not always point to bash (e.g. on Ubuntu,
      where it points to /bin/dash) this test might fail due to the returned
      exit code is different so the received signal is not correctly
      detected.
      
      Additionally fix the docstring of testSignal.
      
      Reviewed-by: iustinp
      01fd6005
    • 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
    • Iustin Pop's avatar
      Fix iallocator instance info · 768f0a80
      Iustin Pop authored
      The commit "IAllocator: some more info exported" broke the instance list
      generation due to a wrong index variable. This patch fixes that.
      
      Reviewed-by: ultrotter
      768f0a80
  5. 25 Apr, 2008 6 commits
    • Michael Hanselmann's avatar
      Extend utils.WriteFile · 70f4497c
      Michael Hanselmann authored
      Add parameters to not check the path for absoluteness, implement a dry
      run mode and automatically create a backup if requested. This will be
      used by the cfgupgrade utility.
      
      Reviewed-by: schreiberal
      70f4497c
    • Iustin Pop's avatar
      IAllocator: some more info exported · 6286519f
      Iustin Pop authored
      This patch adds the following information to the exported info:
        - hypervisor type (in the main dict)
        - total memory used by primary instances (in each node dict) (can be
          computed from the node+instance dicts, but it's cheap to compute
          from Ganeti) (this is not live data, just from the config)
        - total memory used by primary instances marked to be up, similar to
          the above
      
      Reviewed-by: imsnah
      6286519f
    • Iustin Pop's avatar
      IAllocator: simplify node info computation · b2662e7f
      Iustin Pop authored
      Currently we try to convert the values returned by call_node_info to
      ints, and if all succeed, we actually do the conversion. Simplify this
      by doing it in one step.
      
      The patch also adds exporting of node memory as 'reserved_memory'.
      
      Reviewed-by: imsnah
      b2662e7f
    • Iustin Pop's avatar
      patch 1/4 extended HVM features for 1.2 · ddd9bc04
      Iustin Pop authored
      This patch extends the config objects with the slots to handle
      more HVM configuration items.
      
      Author: schreiberal
      Reviewed-by: iustinp,imsnah
      ddd9bc04
    • Michael Hanselmann's avatar
      Move target creating symlinks in lib/ into Makefile.libcommon · 4febe836
      Michael Hanselmann authored
      Reviewed-by: iustinp
      4febe836
    • Iustin Pop's avatar
      Add iallocator documentation · b2d72ffe
      Iustin Pop authored
      Reviewed-by: imsnah
      b2d72ffe
  6. 24 Apr, 2008 5 commits
    • Manuel Franceschini's avatar
      backend.FinalizeExport: safely initialize some vars · 66f93869
      Manuel Franceschini authored
      This patch initializes nic_count and disk_count with 0. This prevents
      some reference errors if the snap_disks block device list is empty.
      
      Reviewed-by: ultrotter
      66f93869
    • Iustin Pop's avatar
      Style fixes for trunk · b4de68a9
      Iustin Pop authored
      This small patch fixes:
        - wrong indentation in two places
        - use of 'os' variable that hides global scope os module
      
      Reviewed-by: imsnah
      b4de68a9
    • Iustin Pop's avatar
      Implement replace secondary via the iallocator · b6e82a65
      Iustin Pop authored
      This patch implements secondary replace via the iallocator. The new
      opcode parameter 'iallocator' behaves like this: if passed, it will
      always compute and assign a new secondary, behaving in effect as if the
      secondary node has been passed. It conflicts with actually giving the
      secondary too.
      
      [Note: not tested with remote_raid1, but the code should behave the
      same, we only touch CheckPrereq and we assign a node.]
      
      The patch also adds burnin support for the replace secondary operation;
      with this in place, burnin can fully work with auto-assigned nodes.
      
      Reviewed-by: ultrotter
      b6e82a65
    • Iustin Pop's avatar
      Implement memory size option for burnin · 5e767b34
      Iustin Pop authored
      This simple patch adds memory size for the burnin instances, which helps
      testing allocator algorithm response based on the available node memory
      and instance memory size values.
      
      Reviewed-by: ultrotter
      5e767b34
    • Iustin Pop's avatar
      Fix generalized relocate mode of IAllocator · 29859cb7
      Iustin Pop authored
      The patch which generalized the IAllocator was half-true: it actually
      put the selection of the node inside the IAllocator, so callers were not
      able to specify replace primary node.
      
      This patch does:
        - split the arguments to the constructor in three sets: mode and name
          are always passed, and then we differentiate between allocation
          parameters and relocation ones
        - add a new relocate_from option to the IAllocator constructor which
          is a list of nodes we want to move the instance off
        - rename the 'nodes' argument in the request object to 'relocate_from'
          since this is clearer and is not confused with the result field also
          called 'nodes'
      
      Reviewed-by: ultrotter
      29859cb7
  7. 23 Apr, 2008 8 commits
    • Manuel Franceschini's avatar
      Fix burnin ImportExport CreateInstance opcode · 96bb2f71
      Manuel Franceschini authored
      This patch adds the two attributes file_storage_dir and file_driver
      to the CreateInstance opcode in the ImportExport method, since
      otherwise it will fail with the file storage patches.
      
      Reviewed-by: iustinp
      96bb2f71
    • Guido Trotter's avatar
      burnin: improve instance create message · 6d54548e
      Guido Trotter authored
      When the allocator or a non-mirrored template are used the message shown by
      burnin at instance creation time was wrong. Fixing it.
      
      Reviewed-by: iustinp
      
      6d54548e
    • Guido Trotter's avatar
      burnin: remove created exports · 4a7ff493
      Guido Trotter authored
      Make burnin remove exports after importing the instance back.
      
      Reviewed-by: iustinp
      
      4a7ff493
    • Guido Trotter's avatar
      Add gnt-backup remove functionality · 9ac99fda
      Guido Trotter authored
      This patch also fixes the LUExportInstance Prereq docstring.
      
      Reviewed-by: iustinp
      
      9ac99fda
    • Manuel Franceschini's avatar
      Add instance rename to burnin · 054a8696
      Manuel Franceschini authored
      This patch adds the possibility to execute instance renaming when
      doing a cluster burnin. The optional parameter --rename takes
      one 'spare' instance name.
      Given this option it renames all given instances to the spare one
      and back to their original name.
      
      Reviewed-by: iustinp
      054a8696
    • Iustin Pop's avatar
      Generalize the replace_secondary mode in iallocator · 2a139bb0
      Iustin Pop authored
      Currently the replace_secondary mode is too restrictive. This patch
      changes this to a general 'relocate' mode where the node(s) to be
      changed are specified via a new key in the request dict ('nodes') so
      that we can change any of the instance's nodes.
      
      Note that for the relocate mode, len(nodes) == required_nodes, so the
      required nodes field is redundant, but it is provided for consistency
      with the allocate mode.
      
      Reviewed-by: ultrotter
      2a139bb0
    • Iustin Pop's avatar
      Implement replace_secondary in the dumb allocator · eb0994e7
      Iustin Pop authored
      This patch allows the dumb allocator to perform the replace secondary
      request type. This is done simply by not allowing the current instances
      nodes as a valid selection, and using the existing instance data instead
      of the request (which doesn't have the instance info when doing the
      replace_secondary).
      
      Reviewed-by: ultrotter
      eb0994e7
    • Iustin Pop's avatar
      Send required_nodes field to the iallocator scripts · 27579978
      Iustin Pop authored
      This patch adds the 'required_nodes' field in the request dict for the
      iallocator.
      
      This means that the handmade-checks in the create instance can be
      simplified, and that the dumb allocator can be made simple. Therefore
      the patch also modifies it.
      
      The patch also sends the disk_space_total to the script in realocate
      mode and a small fix for showing errors (include stderr too).
      
      Reviewed-by: ultrotter
      27579978