1. 13 May, 2008 5 commits
    • 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
    • Iustin Pop's avatar
      CLI: retry: remove command opts/args in "gnt-X" · 4e713df6
      Iustin Pop authored
      This new version of the patch removes only the listing of the usage in
      the "gnt-X" list, but keeps the strings in since we'll want to enhance
      and use them in "gnt-X $cmd --help".
      
      Reviewed-by: ultrotter
      4e713df6
    • Iustin Pop's avatar
      Revert "CLI: remove command opts/args in "gnt-X"" · 9a033156
      Iustin Pop authored
      This reverts commit 976.
      
      Reviewed-by: ultrotter
      9a033156
    • Iustin Pop's avatar
      CLI: remove command opts/args in "gnt-X" · 57d0151e
      Iustin Pop authored
      [Forward-port of the 1.2 branch patch]
      
      This patch removes all the parameters and options from the output
      "gnt-X" (i.e. the subcommand list for command). This is done in order to
      uniformize the output, currently only some parameters are shown and they
      are not always consistent (e.g. required versus important parameters).
      
      Reviewed-by: ultrotter
      57d0151e
    • Iustin Pop's avatar
      Reduce chance of ssh failures in verify cluster · b544cfe0
      Iustin Pop authored
      The cluster verify builds a sorted list of nodes and passes that to all
      the nodes (in parallel) for ssh checks. This means that for a cluster
      with N nodes, there will be approximately N simultaneous connections to
      the first node, then to the second node, etc. This, coupled with the
      ssh daemon's “MaxStartups” parameter, can create false alarms about ssh
      connectivity.
      
      This patch randomizes the node list in the backend (therefore, each node
      should have it's own order of ssh-ing to the other nodes) and the chance
      of these alarms should be reduced.
      
      Reviewed-by: ultrotter
      b544cfe0
  2. 12 May, 2008 1 commit
    • Iustin Pop's avatar
      bdev: always log command output if it failed · 6c896e2f
      Iustin Pop authored
      Currently many error handling code paths in bdev.py log only
      result.fail_reason (i.e. exit code or signal that killed the command)
      but not its output. This makes debugging very hard.
      
      The patch changes all places where we only log fail_reason to also log
      result.output.
      
      Reviewed-by: ultrotter
      6c896e2f
  3. 10 May, 2008 1 commit
    • Iustin Pop's avatar
      DRBD: Fix another bug in diskless activation · ab6cc81c
      Iustin Pop authored
      DRBD8 requires that we pass ‘--create-device’ to the first command that
      wants to activate a new DRBD minor. We do this currently when we run the
      “drbdsetup ... disk” command which we run before the network setup.
      
      But if the LVs are missing, we skip the ‘disk’ subcommand and run only
      the ‘net’ one, so it might be that the activation fails because the
      minor we selected was never created in the first place.
      
      The patch adds the required parameter to the DRBD8._AssembleNet() call.
      Since it's a no-op for existing minors, it should not create any
      problems (tested and works both with configured and unconfigured
      minors).
      
      Reviewed-by: ultrotter
      ab6cc81c
  4. 09 May, 2008 1 commit
    • Michael Hanselmann's avatar
      Remove utils.CheckDaemonAlive and use “xm info” instead · e3e66f02
      Michael Hanselmann authored
      There are a couple of reasons for doing so:
      - /proc is not OS independent, it's only supported by Linux (there are
        emulations on other systems, but those might differ from the way
        Linux represents data).
      - Checking a daemon's state doesn't necessarily mean it's usable.
        Connecting to the socket using “xm info” is much safer.
      - Reduce code size.
      
      Reviewed-by: iustinp
      e3e66f02
  5. 08 May, 2008 3 commits
    • Guido Trotter's avatar
      Improve DRBD8.Open's docstring a bit more · f860ff4e
      Guido Trotter authored
      Reviewed-by: iustinp
      
      f860ff4e
    • Guido Trotter's avatar
      Fix comment typo in bdev.py · 7b62772e
      Guido Trotter authored
      Reviewed-by: iustinp
      
      7b62772e
    • Iustin Pop's avatar
      Fix DRBD8 diskless assembling · bf25af3b
      Iustin Pop authored
      The algorithm for attaching to existing DRBD devices is not trivial. It
      has four alternatives, and there is a bug in the last one when we have
      diskless devices.
      
      The last case (local disk info matches but remote/network configuration
      doesn't match) we disconnect from the network and reattach with the
      correct info. We do this because correct local device has higher
      priority than remote device.
      
      However, the test we use (self._MatchesLocal) can succeed in two cases:
        - we have a disk and it's the same as the one attached
        - we don't have a disk and the drbd is in diskless mode
      
      But this creates problems for the fourth case as when we already have
      one diskless DRBD, activating then next one will do:
        - _MatchesLocal? yes, because both config data and system have no
          disks (with the effect that all diskless devices are identical)
        - _MatchesRemote? no, because this disk is configured to its current
          remote peer, not to our new one
      
      The fix is trivial, although the algorithm not: we only allow overriding
      the network configuration when the disk information matches and we are
      not diskless, by adding the <"local_dev" in info'> test.
      
      Reviewed-by: ultrotter
      bf25af3b
  6. 07 May, 2008 1 commit
  7. 06 May, 2008 2 commits
  8. 05 May, 2008 4 commits
    • Iustin Pop's avatar
      Export the number of cpus to iallocator scripts · 4337cf1b
      Iustin Pop authored
      Now that we have the number of cpus available from the hypervisors, we
      can export this to the iallocator scripts.
      
      Reviewed-by: ultrotter
      4337cf1b
    • Iustin Pop's avatar
      Add node cpu count to gnt-node list · e8a4c138
      Iustin Pop authored
      This patch adds the backend and frontend changes needed for being able
      to list the cpu count.
      
      Reviewed-by: ultrotter
      e8a4c138
    • Guido Trotter's avatar
      Wrap exception in _DistributeConfig code · 9ff994da
      Guido Trotter authored
      nodelist.remove(X) could potentially raise a ValueError (even if the chance
      that the current node is not in the list are pretty scarce, and its absence
      should raise a red flag anyway). If this happens let things go on, as that's
      what the code which previously distributed the config did.
      
      Reviewed-by: iustinp
      9ff994da
    • Guido Trotter's avatar
      Simplify target generation in DistributeConfig · 41362e70
      Guido Trotter authored
      Currently we get the list of nodes, and for each one extract all its info, and
      just to exclude it if the name matches ours. Since the list of nodes is a list
      of names just use .remove() to exclude ourself from it, and use that list
      directly.
      
      Reviewed-by: iustinp
      41362e70
  9. 02 May, 2008 2 commits
    • Guido Trotter's avatar
      ssconf: update the SetKey docstring · 8498462b
      Guido Trotter authored
      SetKey is used, other than for adding new nodes, in another few cases. Update
      the docstring to reflect this, so we don't mislead people reading it.
      
      Reviewed-by: iustinp
      
      8498462b
    • Guido Trotter's avatar
      Delete hypervisor.py · 310bbdde
      Guido Trotter authored
      This completes the changes in r898 by actually getting rid of the old unused
      hypervisor.py code which was left in the code tree.
      
      Reviewed-by: iustinp
      310bbdde
  10. 30 Apr, 2008 6 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
      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
  11. 29 Apr, 2008 2 commits
    • Michael Hanselmann's avatar
      Support config version in ssconf · 742f39ac
      Michael Hanselmann authored
      Reviewed-by: iustinp
      742f39ac
    • Iustin Pop's avatar
      Disable forking in the master daemon · b74159ee
      Iustin Pop authored
      This patch adds a mechanism to disable utils.RunCmd in selected
      programs. This is needed in the master daemon unless we confirm
      threading doesn't pose any problems.
      
      This makes cluster init fail, but creating new trunk clusters is anyway
      broken at the moment.
      
      Reviewed-by: ultrotter
      b74159ee
  12. 28 Apr, 2008 6 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
    • 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
    • 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
  13. 25 Apr, 2008 5 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
  14. 24 Apr, 2008 1 commit