1. 19 Jan, 2009 7 commits
    • Iustin Pop's avatar
      Fix handling of failures in create instance disks · 7d81697f
      Iustin Pop authored
      Commit 2302 only modified _CreateBlockDevOnPrimary to the new style
      result, but _CreateBlockDevOnSecondary was forgotten. After the merger
      of the two functions, _CreateBlockDevOnSecondary was taken as template
      so we checked against old-style values, thus completely breaking error
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Use instance.all_nodes instead of hand-building it · 6b12959c
      Iustin Pop authored
      This patch replaces a few obvious uses of [instance.primary_node] +
      list(instance.secondary_nodes) (or similar usage) with the new
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Split the block device creation in two parts · de12473a
      Iustin Pop authored
      Some callers of _CreateBlockDev need recursive behaviour, but not all.
      The replace secondary first creates (manually) new LVs to ensure storage
      is there, and then it creates the new DRBD. At this point, we need a
      non-recursive call so that the LVs are not needlessly re-created.
      This patch splits the single device creation into a separate function,
      so that LUReplaceDisks can use it.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Combine the two _CreateBlockDevOnXXX functions · 428958aa
      Iustin Pop authored
      Since only two boolean parameters differ between these two functions, we
      combine them as to have less code duplication. This will be needed in
      the future as we will need to split off the recursive part off.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Switch call_blockdev_create call to (status, data) · dab69e97
      Iustin Pop authored
      This allows errors to be visible at the user level instead of just node
      daemon logs.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Small change in the instance disk creation path · 796cab27
      Iustin Pop authored
      For future propagation of error messages from backend to cmdlib and to
      the job log, just having True/False return from the disk creation
      function is not enough.
      This patch converts these functions (_CreateDisks, _CreateBlockDevOnXXX)
      to raise exception on errors, and otherwise the return value is None.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Use the same root for both _data and _meta LVs · e6c1ff2f
      Iustin Pop authored
      Currently we use a different UUID for the _data and _meta volumes of a
      DRBD disk. This is confusing as it's hard to associate the two in the
      output of “lvs” or “gnt-node volumes”.
      The patch changes so that they use the same prefix.
      Reviewed-by: ultrotter
  2. 16 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Fix LUExportInstance · 998c712c
      Iustin Pop authored
      Due to deficiencies in our block device implementation, it is a must to
      call SetDiskID on disks before passing them to remote nodes. Since in
      export/import, we don't touch the disks themselves, this was not needed
      before in this function.
      However, since having instance symlinks, the correct ID is needed here
      too, and with static minors it's a "must need". This reflects into
      failed instance starts after migration and/or failover.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Fix gnt-backup export with short names · aeb83a2b
      Iustin Pop authored
      We need to pass the fully-qualified node to _CheckNodeOnline, not the short
      Reviewed-by: imsnah
  3. 13 Jan, 2009 3 commits
    • 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
    • Iustin Pop's avatar
      Port replace disk/change node to the new DRBD RPCs · a2d59d8b
      Iustin Pop authored
      In replace disks to new secondary, since Attach (and therefore
      call_blockdev_find) is not modifying the devices anymore, we need to
      switch this LU to the new call_drbd_disconnect_net and
      call_drbd_attach_net functions.
      Due to the authentication needed in 2.0, we need to be more careful with
      the activation order. In 1.2, we have the case that the new node was
      directly activated with networking information, and could connect to the
      primary while it was still connected or WFConnect to the old secondary.
      In the new scheme, we:
        - create the new drbd in StandAlone mode
        - shutdown old secondary (primary becomes WFConnection)
        - disconnect primary (and thus it goes into StandAlone)
        - connect both primary and new secondary to network using the
          call_drbd_attach_net rpc
      This should be safer, and is cleaner. This passes burnin.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Fix modification of instance memory · ea33068f
      Iustin Pop authored
      ... as found by the QA script - bug was introduced by me in commit 2117.
      Reviwed-by: imsnah
  4. 12 Jan, 2009 3 commits
  5. 09 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Fix gnt-os for offline nodes · 94a02bb5
      Iustin Pop authored
      We shouldn't query offline nodes in gnt-os. This patch adds an utility
      function to ConfigWriter that returns the names of online nodes and uses
      it in LUDiagnoseOS to query only the good nodes.
      Reviewed-by: imsnah
    • 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
  6. 08 Jan, 2009 1 commit
    • Iustin Pop's avatar
      Fix cluster verify/node net test for offline nodes · 82e37788
      Iustin Pop authored
      For offline nodes, we shouldn't add them to the NV_NODELIST and
      NV_NODENETTEST tests since they most likely won't succeed.
      The patch makes gnt-cluster verify happy again in such cases.
      Reviewed-by: imsnah
  7. 07 Jan, 2009 1 commit
    • Iustin Pop's avatar
      _AssembleInstanceDisks: fix rpcresult handling · 2b17c3c4
      Iustin Pop authored
      Commit 2117 changed _AssembleInstanceDisks to correctly parse the
      failure status of the new RpcResult structure, but it didn't fix the
      storing of only the result payload. Since RpcResult is not JSON
      serializable, LUActivateInstanceDisks is failing.
      Reviewed-by: ultrotter
  8. 19 Dec, 2008 1 commit
  9. 16 Dec, 2008 1 commit
  10. 14 Dec, 2008 6 commits
  11. 09 Dec, 2008 1 commit
  12. 08 Dec, 2008 2 commits
    • Iustin Pop's avatar
      Fix _AdjustCandidatePool · ee513a66
      Iustin Pop authored
      Currently the ConfigWriter.MaintainCandidatePool returns node names, and
      _AdjustCandidatePool uses them as such, but then it passes these to
      context.ReaddNode which in turn passes them to jqueue.JobQueue.AddNode which
      uses them as objects.Node instances.
      Since this is currently the only usage, we change return type from
      ConfigWriter.MaintainCandidatePool to be objects and adjust the logging of
      their names, so that the auto-adjusement works.
      Reviewed-by: ultrotter
    • 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
  13. 05 Dec, 2008 8 commits
    • Iustin Pop's avatar
      Make cluster verify understand offline nodes · 0a66c968
      Iustin Pop authored
      This patch changes cluster verify to not alert on offline nodes, but
      instead just show a note at the end with the number of such nodes.
      It also removes warnings in verify-disks and hooks about failures to
      make rpc calls to such nodes.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      cmdlib: check node stats in prereqs · 7527a8a4
      Iustin Pop authored
      This patch adds checks for offline nodes in most instance LUs so that we
      can work with offline secondaries, but not with offline primaries. Some
      cases (like grow disk, which needs both sides up) are not allowing
      offline nodes at all.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Add two utility functions to cmdlib · a5961235
      Iustin Pop authored
      These will be used for parameter checking and node status checking.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Add function to compute the master candidates · ec0292f1
      Iustin Pop authored
      Since some nodes can be offline, we can't just take the length of the
      node list as the maximum possible number of master candidates.
      The patch adds an utility function to correctly compute this value and
      replaces hardcoded computations with the use of this function. It then
      adds utility functions to automate the maintenance of the node lists.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Cleanup the config file on demotion from candidate · 56aa9fd5
      Iustin Pop authored
      This patch adds a simple rpc which makes a backup of the config file and
      then removes it. This is done so that cluster verify doesn't complain
      immediately after demoting a node.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      watcher: handle offline nodes better · cbfc4681
      Iustin Pop authored
      This patch changes the LUQueryInstances to show a different state for
      offline nodes and also modifies the watcher to understand the offline
      state in its checks.
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      node list: add the offline field · 9ddb5e45
      Iustin Pop authored
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Add a new node parameter 'offline' · fc0fe88c
      Iustin Pop authored
      This patch adds a new node parameter called offline that will be used to
      mark nodes which should be touched by commands.
      We also add this flag at cluster init, node add, and export it to
      iallocator scripts.
      Reviewed-by: ultrotter
  14. 04 Dec, 2008 1 commit
  15. 03 Dec, 2008 1 commit
    • Guido Trotter's avatar
      LUQueryExports: fix rpcresult handling · b04285f2
      Guido Trotter authored
      call_export_list is a multi node call, so we need to go through the
      results, extrapolate the good ones, and return a failure value for the
      bad ones.
      Reviewed-by: imsnah