1. 21 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Change the instance status attribute to boolean · 0d68c45d
      Iustin Pop authored
      Due to historic reasons, the “should run or not” attribute of an
      instance was denoted by its “status” attribute having a string value of
      either ‘up’ or ‘down’. Checking this is in code was done via hardcoding
      of the strings.
      
      This was long done for a redo, and this patch changes this attribute to
      “admin_up” having a boolean value. The patch is in fact shorter than I
      expected, and passes burnin.
      
      The patch also fixes an error in BuildInstanceHookEnvByObject where the
      instance.os was passed as the status value.
      
      Reviewed-by: ultrotter
      0d68c45d
    • Guido Trotter's avatar
      Add calls in the intra-node migration protocol · 6906a9d8
      Guido Trotter authored
      Currently the hypervisor is expected to do all the migration from the
      source side. With this patch we also add the option of passing some
      information to the target side, and starting some operation there.
      
      As a bonus, a function to cleanup any started operation is included.
      
      Reviewed-by: iustinp
      6906a9d8
  2. 20 Jan, 2009 6 commits
    • Iustin Pop's avatar
      Convert RenameInstance to (status, data) · 96841384
      Iustin Pop authored
      This allows the rename failures to show the ouput of OS scripts.
      
      Reviewed-by: ultrotter
      96841384
    • Iustin Pop's avatar
      Fix adding of disks to an instance · 32388e6d
      Iustin Pop authored
      The ConfigWriter.AllocateDRBDMinor requires the instance name, not the
      instance object. The LUSetInstanceParms is passing wrongly the instance
      object, which can cause breakage.
      
      The patch also adds asserts to check for this mismatch in ConfigWriter.
      
      Reviewed-by: ultrotter
      32388e6d
    • Iustin Pop's avatar
      Make cluster-verify check the drbd minors space · 6d2e83d5
      Iustin Pop authored
      This patch adds support for verification of drbd minors space in cluster
      verify: minors which belong to running instances and should be online
      but are not, and minors which do not belong to any instace but are in
      use.
      
      The patch requires exposing some methods from bdev.DRBD8 and
      config.ConfigWriter which were until now private methods.
      
      Reviewed-by: ultrotter
      6d2e83d5
    • Iustin Pop's avatar
      Some small fixes in cmdlib · 1492cca7
      Iustin Pop authored
      Reviewed-by: ultrotter
      1492cca7
    • Iustin Pop's avatar
      Convert AddOSToInstance to (status, data) · 20e01edd
      Iustin Pop authored
      This allows the install and reinstall instance to return (hopefully)
      relevant log files from the OS create scripts.
      
      Reviewed-by: ultrotter
      20e01edd
    • Iustin Pop's avatar
      Convert the start instance rpc to (status, data) · dd279568
      Iustin Pop authored
      This will record the failure cause in starting up the instance in the
      job log (and thus to the user).
      
      Reviewed-by: ultrotter
      dd279568
  3. 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
      handling.
      
      Reviewed-by: imsnah
      7d81697f
    • 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
      instance.all_nodes.
      
      Reviewed-by: ultrotter
      6b12959c
    • 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
      de12473a
    • 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
      428958aa
    • 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
      dab69e97
    • 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
      796cab27
    • 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
      e6c1ff2f
  4. 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
      998c712c
    • 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
      one.
      
      Reviewed-by: imsnah
      aeb83a2b
  5. 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
      53c776b5
    • 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
      a2d59d8b
    • 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
      ea33068f
  6. 12 Jan, 2009 3 commits
  7. 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
      94a02bb5
    • 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
          secondary)
        - change to a new node (either via manually specified node or via
          iallocator)
      
      Reviewed-by: imsnah
      7e9366f7
  8. 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
      82e37788
  9. 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
      2b17c3c4
  10. 19 Dec, 2008 1 commit
  11. 16 Dec, 2008 1 commit
  12. 14 Dec, 2008 6 commits
  13. 09 Dec, 2008 1 commit
  14. 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
      ee513a66
    • 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
      3a5ba66a
  15. 05 Dec, 2008 2 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
      0a66c968
    • 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
      7527a8a4