1. 11 Feb, 2009 2 commits
  2. 10 Feb, 2009 5 commits
    • Iustin Pop's avatar
      Sort instance data in gnt-node info · ae07a1d3
      Iustin Pop authored
      The patch sorts the instance list in gnt-node info output, in order to
      make it more readable (and stable).
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Some fixes to node add and re-add · 82e12743
      Iustin Pop authored
      The patch changes the pre-checks in node-add and re-add:
        - if the node is not already in the cluster, refuse to re-add
        - when re-adding, reuse the secondary IP from the cluster
        - when re-adding, reset the offline and drained flags, so that RPC
          calls work (and we can actually upload the keys)
      The patch also adds a missing log entry in LUSetNodeParams.
      Reviewed-by: imsnah
    • Guido Trotter's avatar
      Instance parameters: force typing · a5728081
      Guido Trotter authored
      We want all the hv/be parameters to have a known type, rather than a
      random mix of empty string, boolean values, and None, so we declare the
      type of each variable and we enforce/convert it.
      - Add some new constants for enforceable value types
      - Add new constants dicts HVS_PARAMETER_TYPES and BES_PARAMETER_TYPES
        holding not only the valid parameters but also their types
      - Drop the old HVS_PARAMETERS and BES_PARAMETERS constants and calculate
        the values from the type dict
      - Convert all the default parameters to a valid type value
      - Create a new ForceDictType utils function, to check/enforce a dict's
        element value types, with relevant unit tests
      - Drop a few custom functions to check/convert the BE param types in
        utils and cli, in favor of ForceDictType
      - Double-check the parameter types using ForceDictType in both scripts
        and LogicalUnits, when possible.
      As a bonus:
      - Remove some old commented-out code in gnt-instance
      - Remove some already fixed FIXME
      - Fix a bug which prevented VALUE_DEFAULT to be applied to BE parameters
        in SetInstanceParams because the value was checked for validity before
        that transformation was made
      - Fix a bug which prevented initing a cluster and passing hvparams to
        work at all
      - ForceDictType allows an allowed_values for exceptions, which makes us
        able to do the checking even when some values must not be
        converted/typechecked (for example the 'default' string in
      Reviewed-by: iustinp
    • Iustin Pop's avatar
      Implement modification of the drained flag · c9d443ea
      Iustin Pop authored
      This patch adds LU and cli-level support for modification of the node
      drained flag. It is similar to the offline changes.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Allow query of the drained node attribute · 0b2454b9
      Iustin Pop authored
      This patch exports the drained attribute:
        - LUQueryNodes accepts now the drained field
        - RAPI exports it for node objects
        - gnt-node info shows it now (along newly-added master_candidate and
          offline flags)
        - gnt-node list can list it (but not by default)
        - to the iallocator scripts
      Reviewed-by: imsnah
  3. 09 Feb, 2009 2 commits
    • Iustin Pop's avatar
      Add a new instance query flag ‘disk_usage’ · 024e157f
      Iustin Pop authored
      This patch adds a new instance query flag called disk_usage that
      retrieves the overall space used by an instance on each of its nodes.
      This can be used when balancing the cluster or checking N+1 status.
      The flag is also exported in RAPI. Note the flag is currently broken for
      file-based instances, as it represents the amount of space in the
      cluster volume group.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Export the cpu nodes and sockets from Xen · 0105bad3
      Iustin Pop authored
      This is a hand-picked forward patch of commit 1755 on the 1.2 branch
      (hand-picked since the trees diverged too much since then):
          The patch changed the xen hypervisor to compute the number of cpu
          sockets/nodes and enables the command line and the RAPI to show this
          information (for RAPI is enabled by default in node details, for gnt-one
          one can use the new “cnodes” and “csockets” fields).
          Originally-Reviewed-by: ultrotter
      For the KVM and fake hypervisors, the patch just exports 1 for both
      nodes and sockets. This can be fixed, by looking at the
      /sys/devices/system/cpu/cpuN/topology directories, and computing the
      actual information, but that should be done in a separate patch.
      Reviewed-by: imsnah
  4. 05 Feb, 2009 1 commit
    • Iustin Pop's avatar
      Fix some issues for lockless queries · 2e7b8369
      Iustin Pop authored
      This patch converts some more jobs with only queries into cheaper luxi
      queries (no job created), and fixes some fallout from the lockless
      queries changes.
      Reviewed-by: ultrotter
  5. 04 Feb, 2009 3 commits
    • Iustin Pop's avatar
      Enable lockless node queries · bc8e4a1a
      Iustin Pop authored
      Similar to the instance list, this patch enables lockless node queris.
      “gnt-node list” accepts now the “--sync” flag which enables locking, the
      default is lockless.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      ssconf: add some more keys and some fixes · 81a49123
      Iustin Pop authored
      This patch adds the online node list and instance list to the ssconf
      keys. In order to do distribute correctly the instance list, we need to
      update the cluster serial number on instance additions and removals.
      The patch also changes the permissions on the ssconf files to be 0444:
        - no write for root, in order to signal that these file should not be
        - read for everyone since the files don't contain sensitive data
          anymore (and permissions can be controlled via the parent directory
          if needed)
      The patch also fixes a small typo on gnt-cluster.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Implement lockless query operations · ec79568d
      Iustin Pop authored
      This patch adds the framework for, and enables lockless OpQueryInstances. This
      means that instances will be shown in ERROR_up or ERROR_down state, even though
      this is not an error (but just an in-progress job).
      The framework is implemented as follows:
        - the OpQueryInstances, OpQueryNodes and OpQueryExports opcodes take
          an additional “use_locking” flag which will denote whether to lock
          or not; this patch only implements this for LUQueryInstances
        - the luxi query functions take an additional argument use_locking
          which is passed to the master daemon, and then passed to the above
        - cli.py export a new SYNC_OPT command line options which implement
          setting this flag to true
        - except for gnt-instance list, which uses this option, and for
          name-only queries (e.g. QueryNodes(fields=["names"])), all other
          callers are setting this flag to True
        - RAPI also sets the flag to True
      The patch was tested with a continuous (0.2s sleep in-between)
      gnt-instance list during a burnin, and no problems were observed.
      Reviewed-by: ultrotter
  6. 03 Feb, 2009 3 commits
    • Iustin Pop's avatar
      Allow gnt-node evacuate to use an iallocator · c4ed32cb
      Iustin Pop authored
      This is a partial implementation of fully automated node evacuation:
      we allow passing an iallocator and all instance replace-disks will be
      execute via that iallocator.
      The individual OpReplaceDisks opcodes are submitted in a single job,
      which causes them to be executed serially and thus keeps the iallocator
      runs consistent. This also changes the behaviour so that the first
      reallocation that failed will stop all the reallocations.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Add gnt-node migrate · 40ef0ed6
      Iustin Pop authored
      This is a (modified) forward-port of commit 1190 on the 1.2 branch:
        This is the same as gnt-node failover, and is also a cut&paste of its
        code (almost). It will be really really useful to quickly empty a
        healthy node. I can be persuaded to merge MigrateNode and FailoverNode
        in a common codebase, but could also forget about it and submit it if
        nobody cares.
        Reviewed-by: iustinp
      The original MigrateNode function has been converted to the 2.0 style
      (cli.JobExecutor). Also commit 2076 has been added that fixes a missing
      opcode parameter.
      Original-author: ultrotter
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      An attempt at fixing some encoding issues · 26f15862
      Iustin Pop authored
      This patch unifies the hardcoded re-encoding attempts into a single
      function in utils.py. This function is used to take either an unicode or
      str object and convert it to a ASCII-only str object which can be safely
      displayed and transmitted.
      We replace then the current manual re-encodings with this function. In
      mcpu we stop re-encoding the hooks output and instead we do it right at
      the hook generation in backend.py.
      This passes on my 'custom' lvs output with non-ASCII chars. But there
      are probably other places we will need to fix.
      Reviewed-by: ultrotter
  7. 01 Feb, 2009 1 commit
  8. 29 Jan, 2009 2 commits
    • Iustin Pop's avatar
      gnt-instance list: accept input names · 5ffaa51d
      Iustin Pop authored
      Currently gnt-instance list will refuse to take arguments, and always
      return the full list of instances. This patch allows it to pass names to
      LUQueryInstances, so that we restrict the input to a given set of
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Check that instance exists before confirm. queries · a76f0c4a
      Iustin Pop authored
      Currently we ask the user for confirmation, and only after (try to)
      remove, failover or migrate the instance. This doesn't work nicely if
      the instance doesn't exist, so we make a query for the instance before
      the prompt, which will throw an error in case it doesn't exist.
      Side-note: the way the query works today is not really nice. It would be
      better if we could query explicitly for a missing instance name, so that
      this is done cleaner (explicit check) instead of side-effect (throw
      exception). We do add code for this explicit check, except that today it
      won't be used actually.
      Reviewed-by: ultrotter
  9. 27 Jan, 2009 1 commit
    • Iustin Pop's avatar
      Rework the multi-instance gnt commands · 479636a3
      Iustin Pop authored
      This patch changes the multi-instance gnt-* commands (gnt-instance
      start/stop, gnt-node evacuate/failover) such that the individual
      operations are submitted in parallel, ideally improving the speed of the
      The patch does this by abstracting the job set functionality into a new
      class in cli.py, that takes care of the job submit, job poll and error
      Reviewed-by: ultrotter
  10. 23 Jan, 2009 4 commits
    • Iustin Pop's avatar
      Sort the instance names in batcher · 7312b33d
      Iustin Pop authored
      In case we submit multiple instances via batcher, it's nicer to have the
      sorted nicely.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Fix batcher for 2.0-style disks and nics · 9939547b
      Iustin Pop authored
      This patch fixes the gnt-instance batch-create command, and in doing so
      also slightly changes two other functions:
        - we change utils.ParseUnit so that it accepts integer values also
          (both ParseUnit(5) and ParseUnit("5") return the same value)
        - a bridge 'None' in LUCreateInstance will be converted to the default
          bridge; currently only missing bridges will be accepted to mean the
          default one
      The main changes to batcher were the change to variable number of disks
      and NICs.
      The patch also adds a batcher-instances.json example file copied from
      the 1.2 branch and properly modified.
      Reviewed-by: imsnah, killerfoxi
    • Iustin Pop's avatar
      Make iallocator work with offline nodes · 1325da74
      Iustin Pop authored
      This patch changes the iallocator framework to work with and properly
      export to plugins offline nodes. It does this by only exporting the
      static configuration data for those nodes, and not attempting to parse
      the runtime data.
      The patch also fixes bugs in iallocator related to the RpcResult
      conversion, changes the should_run to admin_up attribute name (as per
      the internals change), and adds “-I” as a short option for
      “--iallocator” in gnt-instance, gnt-backup and burnin.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      A couple of small fixes to iallocator · 8901997e
      Iustin Pop authored
      This removes some constraints:
        - only two disks supported, this is no longer true as the underlying
          functions can now compute size for a variable number of disks
        - error when the hypervisor was not being passed
        - typo error
      Reviewed-by: imsnah
  11. 20 Jan, 2009 1 commit
  12. 19 Jan, 2009 1 commit
  13. 13 Jan, 2009 1 commit
    • Iustin Pop's avatar
      Forward port the live migration from 1.2 branch · 53c776b5
      Iustin Pop authored
      This is forward port via copy (and not individual patches cherry-pick)
      of the latest code on the 1.2 branch related to the migration.
      The changes compared to 1.2 are the fact that we don't need the
      IdentifyDisks step anymore (the drbd rpc calls are independent now), and
      the rpc module improvements.
      Reviewed-by: ultrotter
  14. 12 Jan, 2009 3 commits
    • Iustin Pop's avatar
      Skip offline nodes in gnt-cluster commands · 4040a784
      Iustin Pop authored
      This patch makes gnt-cluster copyfile and command skip the offline
      Reviwed-by: ultrotter, imsnah
    • Iustin Pop's avatar
      Heavy redo of gnt-instance info output · 19708787
      Iustin Pop authored
      In 2.0, we have more parameters in drbd's logical_id, and passing the
      results over json makes them unicode which looks worse with the default
      formatting. As such, a redo of the output is needed.
      This patch:
        - adds a separate function to format the logical_id of devices
        - moves the actual indentation format out of _FormatBlockDevInfo,
          which now just generates a list of items
        - adds a function _FormatList that recursively formats the list
        - formats specially key,value tuples
      The result is that the output is nicer, and the code in
      _FormatBlockDevInfo somewhat cleaner (as it doesn't deal with spacing
      and such issues).
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Introduce a very simple LU to force config updates · afee0879
      Iustin Pop authored
      This LU can be used to force a push of the config in case it's needed,
      for example after an upgrade to update the ssconf_release_version file.
      Reviewed-by: imsnah
  15. 09 Jan, 2009 1 commit
    • Iustin Pop's avatar
      Cleanup replace-disks modes and options · 7e9366f7
      Iustin Pop authored
      In 1.2, due to the md+drbd7 legacy, we had a complex choice of replace
      modes, and the new drbd8 modes where forced into this syntax, with some
      complicated rules of transition from one mode to another (if REPLACE_ALL
      but not new node passed, switch to REPLACE_SEC, etc.).
      This patch cleans this situation by making a clear separation between
      the two main modes:
        - replace on current nodes (with the two sub-cases on primary and on
        - change to a new node (either via manually specified node or via
      Reviewed-by: imsnah
  16. 18 Dec, 2008 1 commit
    • Michael Hanselmann's avatar
      Prevent RPC timeout on auto-archiving jobs · f8ad5591
      Michael Hanselmann authored
      With a large job queue, auto-archiving jobs can take a very long time,
      causing timeouts on the luxi RPC layer. With this change, auto-
      archive returns after half of the RPC timeout has passed. The user
      will see how many jobs are left unchecked.
      Reviewed-by: ultrotter
  17. 11 Dec, 2008 1 commit
    • Iustin Pop's avatar
      Fix epydoc format warnings · c41eea6e
      Iustin Pop authored
      This patch should fix all outstanding epydoc parsing errors; as such, we
      switch epydoc into verbose mode so that any new errors will be visible.
      Reviewed-by: imsnah
  18. 08 Dec, 2008 1 commit
    • Iustin Pop's avatar
      gnt-node modify: add the offline attribute · 3a5ba66a
      Iustin Pop authored
      This patch changes gnt-node modify and the associated opcode/lu to allow
      modification of the node offline attribute.
      Setting a node into offline mode automatically demotes it from the
      master role.
      Reviewed-by: ultrotter
  19. 05 Dec, 2008 1 commit
  20. 03 Dec, 2008 2 commits
    • Guido Trotter's avatar
      gnt-cluster init, handle candidate_pool_size · ce735215
      Guido Trotter authored
      - Add a new command line option, defaulting to the constant value
      - Pass the value to bootstrap.InitCluster
      - Use it to init the new Cluster object
      Reviewed-by: imsnah
    • Guido Trotter's avatar
      Extract the ListNodes headers and use them in help · cc3bcec8
      Guido Trotter authored
      Currently we have to update both the ListNodes headers and the online
      help for the full field list. This patch uses the headers keys for the
      help, thus removing duplicating places to update, and adding hope that
      we'll have things in sync. As a downside we lose ordering of the
      non-default fields in the online help.
      Reviewed-by: imsnah
  21. 02 Dec, 2008 3 commits
    • Guido Trotter's avatar
      cluster init: don't discard the hypervisor · 8f348e36
      Guido Trotter authored
      On cluster init if the user specifies a default hypervisor (with -t)
      which is not in the default list of enabled hypervisors (currently just
      xen-pvm) without explicitely specifying the list we silently override
      the choice.
      With this patch we set the list by default to just the required one, and
      we bail out should the list be hand-specified and not contain the
      default one. This still has an issue when the user doesn't specify a
      default hypervisor but specifies a list which doesn't include xen-pvm:
      in this case though we give an error, rather than silently discarding
      Reviewed-by: imsnah
    • Guido Trotter's avatar
      SetInstanceParams: handle default/none values · 467ae11e
      Guido Trotter authored
      If the hv/be parameter lowercase value is set to "default" we'll pass
      constants.VALUE_DEFAULT, if it's set to "none" we'll pass
      Reviewed-by: imsnah
    • Guido Trotter's avatar
      Update gnt-backup online help · 021f5d6f
      Guido Trotter authored
      --src-node and --src-dir are not mandatory anymore
      Reviewed-by: iustinp