1. 19 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Block device creation cleanup · 6c626518
      Iustin Pop authored
      Currently when creation LVM-based instances, we always get the
      extremely-confusing message "ERROR Can't find LV /dev/xenvg/..." which
      is actually expected. This behaviour was introduced before we had
      UUID-style LV names, since at that point it was not a unexpected to have
      such volumes laying around after a failed creation.
      
      Today, it's much more of an error to see existing volumes, and it's
      better to abort with a failure. Since bdev.LogicalVolume.Create() method
      will raise an error in case it exists, we can remove this check in
      backend before creating the device.
      
      The Create methods for DRBD and FileStorage currently don't raise
      exception, as behaviour is not very well defined here.
      
      We also change some exception types raised in bdev so that all
      exceptions raised by device creation are a subclass of GenericError.
      
      Reviewed-by: ultrotter
      6c626518
    • 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
  2. 16 Jan, 2009 3 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
      Instance: add a new all_nodes property · cfcc5c6d
      Iustin Pop authored
      Since we often need the list of all nodes of an instance, we add a new
      "all_nodes" property that returns all nodes of the instance, and we
      switch secondary_nodes to a simpler implementation based on this new
      function.
      
      Reviewed-by: ultrotter
      cfcc5c6d
    • 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
  3. 15 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Some docstring updates · 25e7b43f
      Iustin Pop authored
      This patch rewraps some comments to shorter lengths, changes
      double-quotes to single-quotes inside triple-quoted docstrings for
      better editor handling.
      
      It also fixes some epydoc errors, namely invalid crossreferences (after
      method rename), documentation for inexistent (removed) parameters, etc.
      
      Reviewed-by: ultrotter
      25e7b43f
    • Iustin Pop's avatar
      ganeti-noded: reduce log noise · 14d57a8b
      Iustin Pop authored
      The source port/addr is currently logged three times for each
      connection, and this is unnecessary. We change two log entries to debug,
      since they are useful for precise timing, and we keep only one at INFO
      level.
      
      Reviewed-by: imsnah
      14d57a8b
  4. 13 Jan, 2009 8 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
      Forward-port DrbdNetReconfig · 6b93ec9d
      Iustin Pop authored
      This is a modified forward-port of DrbdNetReconfig and their associated
      RPCs. In Ganeti 2.0, these functions will be used for two things:
        - live migration (as in 1.2)
        - and for other network reconfiguration tasks, since DRBD8.Attach()
          doesn't do them anymore
      
      Because of the Attach() changes, we can now implement the
      AttachNet/DisconnectNet functions as independent entities, and we don't
      need the cache anymore.
      
      Note these functions are copies of the latest 1.2 code, and not
      cherry-picks of the (many) patches that went into 1.2.
      
      Reviewed-by: ultrotter
      6b93ec9d
    • Iustin Pop's avatar
      backend: rename AttachOrAssemble to Assemble · f96e3c4f
      Iustin Pop authored
      Since now the Assemble function is different than Attach, we rename this
      backend function to show that the intent is to fully assemble the device
      (and it's always allowed to modify the device).
      
      Reviewed-by: ultrotter
      f96e3c4f
    • Iustin Pop's avatar
      drbd: change the semantics of Attach vs. Assemble · 2d0c8319
      Iustin Pop authored
      Currently, both the Attach and Assemble methods for DRBD8 devices will use and
      alter the device state. This is suboptimal, and it has been worked
      around in 1.2 via a special cache in the node daemon so that we don't
      need to call Attach() again in migration, for example.
      
      Since in 2.0 we have static minors, we can change these functions so
      that:
        - Attach() does not affect the device in any way, and only checks if
          the minor is already in use or not
        - Assemble() has two logic paths, one for startup from unused minor
          (the old Assemble, now renamed _FastAssemble) and one for
          re-checking/fixing an in-use minor (the old Attach, now renamed
          _SlowAttach)
      
      Basically Attach was renamed to _SlowAttach, Assemble to _FastAssemble,
      and we have a new, simple Assemble that calls one or the other based on
      the result of the new Attach.
      
      The LUReplaceDisks (with new secondary) is relying on the special
      semantics of Attach modifying the device and is broken until the end of
      the patch series.
      
      Reviewed-by: ultrotter
      2d0c8319
    • Iustin Pop's avatar
      bdev: Do not call Assemble() on children · f87548b5
      Iustin Pop authored
      The caller of dev.Assemble() (backend._RecursiveAssembleBD) is doing an
      explicit recursion over all the children of the device, with better
      error reporting. As such, we don't need this repeated assembly inside
      the base BlockDev class.
      
      Reviewed-by: ultrotter
      f87548b5
    • 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
    • Iustin Pop's avatar
      Increase resync speed to 60MB/s · 24b0d752
      Iustin Pop authored
      This is a forward-port of commit 2219 on the 1.2 branch.
      
      Reviewed-by: ultrotter
      24b0d752
  5. 12 Jan, 2009 4 commits
  6. 09 Jan, 2009 7 commits
    • Iustin Pop's avatar
      Add a new ssconf file with the ganeti version · 8a113c7a
      Iustin Pop authored
      The patch adds a new ssconf file containing the ganeti version.
      
      Reviewed-by: imsnah
      8a113c7a
    • Iustin Pop's avatar
      Work around a DRBD sync speed race condition · 7d585316
      Iustin Pop authored
      This is modified forward-port of commit 1544 on the 1.2 branch:
      
        When DRBD is doing its dance to establish a connection with its
        peer, it also sends the synchronization speed over the wire. In
        some cases setting the sync speed only after setting up both
        sides can race with DRBD connecting, hence we set it here before
        telling DRBD anything about its peer.
      
        Reviewed-by: iustinp
      
      The modification we make is that we split SetSyncSpeed in two so that we
      don't need to modify our minor temporarily, and the fact that we call
      this function from within _AssembleNet (right before enabling network),
      instead of Assemble()/Attach().
      
      Original-Author: imsnah
      7d585316
    • Iustin Pop's avatar
      burnin: use the new replace_disks constants · cfacfd6e
      Iustin Pop authored
      This patch updates burnin to the latest replace disks constant, and
      changes the constants' values to be more accurate.
      
      Reviewed-by: imsnah
      cfacfd6e
    • 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
      Silence warning on node list for offline nodes · 186ec53c
      Iustin Pop authored
      The warning in node list is meant for nodes that return wrong
      information, but for offline nodes this case is normal.
      
      Reviewed-by: imsnah
      186ec53c
    • Iustin Pop's avatar
      Rework the daemonization sequence · 7d88772a
      Iustin Pop authored
      The current fork+close fds sequence has deficiencies which are hard to
      work around:
        - logging can start logging before we fork (e.g. if we need to emit
          messages related to master checking), and thus use FDs which we
          can't track nicely
        - the queue locks the queue file, and again this fd needs to be kept
          open which is hard from the main loop (and this error is currently
          hidden by the fact that we don't log it)
      
      Given the above, it's much simpler, in case we will fork later, to close
      file descriptors right at the beginning of the program, and in Daemonize
      only close/reopen the stdin/out/err fds.
      
      In addition, we also close() the handlers we remove in SetupLogging so
      that the cleanup is more thorough.
      
      Reviewed-by: imsnah
      7d88772a
    • 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
  7. 08 Jan, 2009 4 commits
    • 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
    • Iustin Pop's avatar
      rpc: Add a method for easy check of remote results · 3247bbac
      Iustin Pop authored
      The patch adds a new method to the rpc.RpcResult class called
      "RemoteFailMsg" which is useful for the RPC calls which return a
      (status, payload) style result.
      
      Reviewed-by: imsnah
      3247bbac
    • Iustin Pop's avatar
      Add an instance_migratable rpc call · 56e7640c
      Iustin Pop authored
      This is a forward-port of commit 1194 on the 1.2 branch:
      
        This call will check whether an instance is up on its primary, and that
        it has been started with symlinks. We currently have no on-secondary
        checks, nor any hypervisor specific call.
      
        Reviewed-by: iustinp
      
      The difference from the original patch is that we don't include the
      cmdlib changes, since those will come as a copy from the 1.2 cmdlib.py,
      and not as individual patches.
      
      Original-Author: ultrotter
      56e7640c
    • Iustin Pop's avatar
      bdev: forward-port ReAttachNet/DisconnectNet · cf8df3f3
      Iustin Pop authored
      This is plain copy of the 1.2 ReAttachNet and DisconnectNet methods on
      the DRBD8 device, with the logger to logging module changes and the
      ReAttachNet method renamed to AttachNet.
      
      These methods are not used anywhere right now, but will be used for
      migration and a simpler disk-replace.
      
      The code was originally committed on the 1.2 branch as revision numbers
      1165 and 1204.
      
      Originally-Reviewed-by: imsnah, ultrotter
      cf8df3f3
  8. 07 Jan, 2009 8 commits
    • Iustin Pop's avatar
      backend: Remove symlinks by disk name · 5282084b
      Iustin Pop authored
      This is a modified forward-port of commit 1184 on the 1.2 branch:
      
        backend: Remove symlinks by disk name, not using a wildcard
      
        Reviewed-by: ultrotter
      
      The changes to the original patch are related to the docstring style and
      iv_name to index switch.
      
      Original-Author: imsnah
      5282084b
    • Iustin Pop's avatar
      Pass instance name to rpc call blockdev_close · b2e7666a
      Iustin Pop authored
      This is an extract of commit 1166 on the 1.2 branch (Add a rpc call for
      drbd network reconfiguration), but only the blockdev_close part.
      
      The patch changes the blockdev_close call to take the instance so that
      it can remove the symlinks of the instance.
      
      Originally-Reviewed-by: imsnah
      b2e7666a
    • Iustin Pop's avatar
      Fix the _RemoveBlockDevLinks() function · 03dfa658
      Iustin Pop authored
      This is a forward-port of commit 1163 on the 1.2 branch:
        This fixes the removal of the instance symlinks (probably breakage from
        the glob changes).
      
        Reviewed-by: imsnah
      03dfa658
    • Iustin Pop's avatar
      Remove instance's symlinks · 3c9c571d
      Iustin Pop authored
      This is a forward-port of commits 1150 and 1151 on the 1.2 branch:
        Add _RemoveBlockDevLinks auxiliary function, called when an instance
        fails to start and when it is shut down.
      
        Reviewed-by: iustinp
      
      and:
        Fix cut&paste error when removing symlinks
      
        It's just whitespace... isn't it? uhm... :) Anyway, fixing an error made
        when reformatting the code for the new "safer" behaviour.
      
        Reviewed-by: iustinp
      
      Original-Author: ultrotter
      3c9c571d
    • Iustin Pop's avatar
      Catch BlockDeviceError when starting instance · ec596c24
      Iustin Pop authored
      This is a forward-port of commit 1149 on the 1.2 branch:
        _GatherAndLinkBlockDevs used to raise the errors.BlockDeviceError
        exception when it failed to create a block device, and with this patch
        set it does so also when it fails to create a symlink to it.
      
        With this patch we move the call to this function into a pre-existing
        try-except block in the code, and catch the BlockDeviceError exception,
        logging a message and returning a failure state if it happens.
      
        Reviewed-by: iustinp
      
      The changes are related to the new hypervisor and logging syntax.
      
      Original-Author: ultrotter
      ec596c24
    • Iustin Pop's avatar
      Create symlinks to intances' block devices · 9332fd8a
      Iustin Pop authored
      This is a forward-port of commit 1148 on the 1.2 branch:
        Change the _GatherBlockDevs private function, called only one time by
        StartInstance, to _GatherAndLinkBlockDevs, and make it transform the
        device returned even more by calling the new _SimlinkBlockDev auxiliary
        function.
      
        This makes sure that every time an instance is started symlinks to its
        block devices are created, and the instance is started off them, rather
        than the underlying block devices.
      
        Reviewed-by: iustinp
      
      The changes we make to the patch is related to newer function signatures
      in 2.0, and to the fact that iv_name is deprecated and we use instead
      disk%d based on the disk index.
      
      Original-Author: ultrotter
      9332fd8a
    • Iustin Pop's avatar
      Simplify hypervisor block_devices structure · 069cfbf1
      Iustin Pop authored
      This is a partial forward-port of commit 1136 on the 1.2 branch:
      
        The hypervisor doesn't need to be passed the whole block device
        structure, so we'll just give it the block device name on the local
        node, and the name as seen by the instance. This will make it easier to
        manipulate it later without messing with the block devices (eg. by
        changing the system name to a symlink to the name itself).
      
        Since the HVM hypervisor changes the "virtual" name a note is added
        calling for a redesign that doesn't need this change, as different
        hypervisors and emulation types will anyway have different names for
        exported devices.
      
        Reviewed-by: iustinp
      
      The changes in this patch compared to the original are:
        - we keep passing the original disk object, not for its iv_name, but
          for it's physical_id which is needed by the file driver (this could
          be fixed maybe)
        - we don't use the iv_name anymore, since in 2.0 we already use the
          index of the device
      
      Original-Author: ultrotter
      069cfbf1
    • 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
  9. 06 Jan, 2009 1 commit
  10. 19 Dec, 2008 1 commit