1. 16 Jun, 2008 1 commit
    • Guido Trotter's avatar
      Move SetKey to WritableSimpleStore and use it · 05f86716
      Guido Trotter authored
      Before we used to be able to update SimpleStore by just calling SetKey, this
      feature is now moved to an external class, which inherits from it. In this
      patch the new WritableSimpleStore class is also put to use, in the LUs that
      need it. Rather than making each LU instantiate it, we have a new LogicalUnit
      flag REQ_WSSTORE which defaults to False, but when declared to be True asks the
      LogicalUnit to be initialized with a writeable version of the SimpleStore.
      LUMasterFailover and LURenameCluster are then changed to use it.
      InitCluster is also changed to instantiate a WritableSimpleStore, rather
      than a normal one.
      Reviewed-by: imsnah
  2. 15 Jun, 2008 3 commits
    • Guido Trotter's avatar
      Activate down instances' disks on replace-disks · 22985314
      Guido Trotter authored
      When replacing disks or evacuating nodes with instances administratively
      down ganeti fails because the instance disks are not active. This patch
      activates them, performs the replacement, and shuts them down again.
      Changing this also fixes the same issue on gnt-node evacuate.
      Reviewed-by: iustinp
    • Guido Trotter's avatar
      FailoverInstance: change AddInstance with Update · b6102dab
      Guido Trotter authored
      We're not adding a new instance, just making configuration changes to
      the one we're working on.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Fix an error message in instance add · 3e91897b
      Iustin Pop authored
      There is a mistake in the error message generated when we can't reach a
      node for checking for available disk space. Without it, the error
      message is:
      Failure: prerequisites not met for this operation:
      Cannot get current information from node '{u'gnte2.lab.k1024.org':
      {'cpu_total': 1, 'memory_free': 480, 'vg_size': 131068, 'memory_total':
      504, 'bootid': '2176dd3b-2f96-42f0-8b6e-2873ecaf5f9c', 'memory_dom0':
      134, 'vg_free': 130172}, u'gnte1.lab.k1024.org': False}'
      instead of the expected:
      Failure: prerequisites not met for this operation:
      Cannot get current information from node 'gnte2.lab.k1024.org'
      Reviewed-by: imsnah
  3. 12 Jun, 2008 4 commits
  4. 31 May, 2008 5 commits
    • Iustin Pop's avatar
      Add check for node memory in instance creation · 49ce1563
      Iustin Pop authored
      Currently the check for enough memory is done only on instance start
      command and failover command. But we also start an instance in instance
      create, therefore we need to check this instead of failing to start in
      the hypervisor phase.
      The patch adds a check for node memory in the case the creation command
      specifies that the instance should be started. It is allowed for the
      memory to be less than needed if the instance will not be started, in
      order to allow migration and other such cases.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Show cluster hypervisor for gnt-cluster info · 8a12ce45
      Iustin Pop authored
      Author: schreiberal
      Reviewed-by: iustinp
    • Iustin Pop's avatar
      Forward-port: make gnt-modify work with new HVM parameters · ec1ba002
      Iustin Pop authored
      This fixes gnt-instance modify so it actually works with the
      new HVM parameters for Ganeti 1.2
      Author: schreiberal
      Reviewed-by: iustinp
    • Iustin Pop's avatar
      Forward-port: show only parameters relevant to the instance · a8340917
      Iustin Pop authored
      This patch modifies the code for "gnt-instance info .." to only display
      instance parameters that actually apply to that instance, i.e. for PVM
      instances no HVM parameters are shown and vice versa.
      Author: schreiberal
      Reviewed-by: iustinp
    • Iustin Pop's avatar
      Forward-port: patch 2/4 extended HVM features for 1.2 · 31a853d2
      Iustin Pop authored
      This patch adds the commandline extensions and the code to store
      and display the extended HVM features.
      Author: schreiberal
      Reviewed-by: iustinp
  5. 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
    • 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
  6. 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
      * 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
    • 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
  7. 07 May, 2008 1 commit
  8. 05 May, 2008 2 commits
  9. 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
    • 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
    • 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
    • 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
  10. 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
    • 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
      Reviewed-by: ultrotter
    • 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
    • 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
  11. 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
    • 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
  12. 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
    • 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
    • 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
  13. 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
    • 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
    • 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
      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
    • 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
  14. 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
      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
  15. 16 Apr, 2008 2 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
    • 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