1. 31 May, 2008 4 commits
  2. 30 May, 2008 2 commits
    • Iustin Pop's avatar
      Complete removal of md/drbd 0.7 code · abdf0113
      Iustin Pop authored
      This patch removes the last of the md and drbd 0.7 code. Cluster which
      have the old device types will be broken if they have this applied.
      
      Reviewed-by: imsnah
      abdf0113
    • Iustin Pop's avatar
      LURemoveInstance: fix op.ignore_failures usage · 5c54b832
      Iustin Pop authored
      Currently: the LURemoveInstance.Exec() method uses the ignore_failures
      attribute of the OpRemoveInstance opcode, but it doesn't check for its
      existence. The patch adds this attribute to _OP_REQP and to all the
      places where this opcode was created.
      
      This attributes is always passed by gnt-instance, but burnin didn't pass
      it so it can fail if it enters the 'fail to remove disks' branch of the
      method (which is why it was not triggered until now).
      
      Reviewed-by: ultrotter, imsnah
      5c54b832
  3. 13 May, 2008 2 commits
    • Iustin Pop's avatar
      Implement node daemon conectivity tests · 9d4bfc96
      Iustin Pop authored
      This patch adds in gnt-cluster verify checks for inter-node tcp
      communication checks on the node daemon port for both the primary and
      (if defined) secondary networks.
      
      The output looks like (4-node cluster, one with the secondary interface
      down):
      * Verifying node node1.example.com
        - ERROR: tcp communication with node 'node3.example.com': failure using the secondary interface(s)
      * Verifying node node2.example.com
        - ERROR: tcp communication with node 'node3.example.com': failure using the secondary interface(s)
      * Verifying node node3.example.com
        - ERROR: tcp communication with node 'node1.example.com': failure using the secondary interface(s)
        - ERROR: tcp communication with node 'node2.example.com': failure using the secondary interface(s)
        - ERROR: tcp communication with node 'node4.example.com': failure using the secondary interface(s)
      * Verifying node node4.example.com
        - ERROR: tcp communication with node 'node3.example.com': failure using the secondary interface(s)
      
      Reviewed-by: imsnah
      9d4bfc96
    • Michael Hanselmann's avatar
      Forward-port changes made to readd in 1.2 · 102b115b
      Michael Hanselmann authored
      qa_node.py: Fix typo in message
      cmdlib.py: Don't add readded node to node list
      ganeti-qa.py: Make sure readd isn't done for master node
      
      Reviewed-by: iustinp
      102b115b
  4. 07 May, 2008 1 commit
  5. 05 May, 2008 2 commits
  6. 30 Apr, 2008 4 commits
    • 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
      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
  7. 28 Apr, 2008 4 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
    • 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
    • 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
  8. 25 Apr, 2008 2 commits
    • 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
  9. 24 Apr, 2008 3 commits
    • 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
      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
  10. 23 Apr, 2008 4 commits
    • 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
    • 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
      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
    • Iustin Pop's avatar
      Move all iallocator functions into a class · d1c2dd75
      Iustin Pop authored
      This patch moves all the iallocator function into a separate class that
      is then somewhat easier to use. It doesn't bring any new functionality.
      
      The patch also changes the way the iallocator is called - the
      OpTestAllocator opcode is no longer needed, and all its parameters
      should be passed directly to the IAllocator constructor.
      
      Reviewed-by: ultrotter
      d1c2dd75
  11. 21 Apr, 2008 1 commit
    • Iustin Pop's avatar
      Abstract the json functions into a separate module · 8d14b30d
      Iustin Pop authored
      This simple patch adds a new module that holds the simplejson functions
      for serialization/deserialization. This reduces the amount of redundant
      code.
      
      The patch also adds some normalizations to the json output:
        - the output text will always have an EOL as last char
        - extra spaces before EOL are removed
      
      Reviewed-by: ultrotter
      8d14b30d
  12. 16 Apr, 2008 5 commits
    • Michael Hanselmann's avatar
      Add --readd option to “gnt-node add” · e7c6e02b
      Michael Hanselmann authored
      This allows us to readd a node after it failed and required a
      reinstallation or replacement.
      
      Reviewed-by: iustinp
      e7c6e02b
    • Iustin Pop's avatar
      IAllocator part 3: LUCreateInstance changes · 538475ca
      Iustin Pop authored
      This (final) patch allows the instance's nodes to be selected
      automatically based on the passed allocator algorithm.
      
      The patch changes the pnode opcode parameter from required to optional,
      now either the pnode or the iallocator must be passed.
      
      A possible improvement could be to organize all the _IAllocator
      functions into a separate class, but that can come later and the current
      version is functionally ok.
      
      Reviewed-by: ultrotter
      538475ca
    • Iustin Pop's avatar
      Reorder checks in instance create · 901a65c1
      Iustin Pop authored
      This patch reorders the checks in the instance create prereq so that all
      checks and normalisations that are not node-dependent are done before
      the node dependent checks.
      
      This is done so that, after the instance-related opcode parameters are
      checked and fixed, we can run the allocator and compute the primary (and
      any secondary) nodes, and only then proceed with node-related checks.
      
      Reviewed-by: ultrotter
      901a65c1
    • Iustin Pop's avatar
      Implement 'out' direction on allocator tests · 298fe380
      Iustin Pop authored
      This patch adds the paths for searching for instance allocators and
      makes the LUTestAllocator code run the allocator and return the results
      if the direction specified is 'out'. 'out' means that the opcode will
      return the result of the allocator run, instead of the allocator input
      file ('in').
      
      The patch unifies all names to refer to 'iallocator' instead of plain
      allocator.
      
      The patch also adds an example allocator that can be used for testing
      this new functionality.
      
      Reviewed-by: ultrotter
      298fe380
    • Iustin Pop's avatar
      Allocator framework, 1st part: allocator input generation · d61df03e
      Iustin Pop authored
      In preparation for the introduction of automatic instance allocator,
      this patch adds an allocator simulation opcode, that based on the input
      parameters, will return either the input message to the allocator
      (implemented) or the result of the allocator run (not yet implemented).
      
      This allows algorithm tests against simulated allocations and the
      current cluster state.
      
      The patch adds the following:
        - a function that generates the generic cluster information for the
          allocator
        - a function that generates the 'new instance' information
        - a function that generates the 'replace_secondary' information
      
      These three functions will be used by the allocator framework later to
      generate the actual information for the external algorithms. Currently
      we just return the json-serialized text.
      
      Reviewed-by: imsnah
      d61df03e
  13. 15 Apr, 2008 3 commits
  14. 10 Apr, 2008 3 commits
    • Guido Trotter's avatar
      Verify: make skipping checks possible · e54c4c5e
      Guido Trotter authored
      Add a general way to skip some checks at cluster-verify time and make the N+1
      memory redundancy check optional.
      
      Reviewed-by: iustinp
      
      e54c4c5e
    • Guido Trotter's avatar
      Verify: add N+1 Memory redundancy verification · 2b3b6ddd
      Guido Trotter authored
      For every node we check that we can host all the instances it's currently
      secondary for belonging to the same primary. This ensures that if a node fails
      all its instances can fit on their secondary node. The code only works when
      failover is forced to go to the secondary node, and cannot go to an arbitrary
      node in the cluster, which is the case in Ganeti 1.2.
      
      Reviewed-by: iustinp
      
      2b3b6ddd
    • Guido Trotter's avatar
      Verify: save instance config · 26b6af5e
      Guido Trotter authored
      Save the instance config after we queried it in an instance_cfg dict.  This can
      be used later by any function that wants it, without reloading it from the
      configuration module. It will be used for N+1 memory resilience checking.
      
      Reviewed-by: iustinp
      
      26b6af5e