1. 22 Jun, 2010 1 commit
  2. 21 Apr, 2010 1 commit
  3. 23 Mar, 2010 1 commit
  4. 22 Mar, 2010 1 commit
  5. 15 Mar, 2010 1 commit
  6. 08 Mar, 2010 2 commits
    • Iustin Pop's avatar
      Add strict name validation for the LVM backend · 6136f8f0
      Iustin Pop authored
      
      
      Currently we don't enforce name validation for the LVM backend, on the
      idea that LVM itself will reject invalid names and we catch those
      errors.
      
      However, recent LVM documents the accepted VG/LV name space, so it's
      easy to add this in the LVM backend code.
      
      In addition, the patch changes some hardcoded /dev/ constructions with
      utils.PathJoin().
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      6136f8f0
    • Iustin Pop's avatar
      Implement disabling of file-based storage · cb7c0198
      Iustin Pop authored
      
      
      Rationale: the file-based storage backend can add/remove files under a
      certain directory. However, the master node is also controlling the
      setting of the file-based root directory, so basically it means we can't
      prevent arbitrary modifications by the master of the node's filesystem.
      
      In order to mitigate this for setups where the file-based storage is not
      used, we introduce a new setting at ./configure time, that controls the
      enable/disable of file-based storage. Since this is not modifiable by
      the master (over RPC), it is now possible in this case to prevent
      unintended modifications of the node's filesystem from the master.
      
      The new setting is used in bdev.py to not expose the file-based storage
      at all, and in cmdlib.py to prevent attempts at creation of such
      instances.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      cb7c0198
  7. 15 Feb, 2010 1 commit
  8. 25 Jan, 2010 2 commits
    • Iustin Pop's avatar
      Add a crude disable for DRBD barriers · 89b70f39
      Iustin Pop authored
      
      
      Ideally we want to/will have per-device DRBD controls of disk/metadata
      flushes. In the meantime, we want at least a disable of the barrier
      functionality for cases where one has battery-backed caches.
      
      Background: DRBD has four mechanism of handling ordered disk-writes.
      From the drbdsetup man-page, these are: barrier, flush, drain and none.
      DRBD prior to 8.2 only has drain and none. This patch makes all 8.x
      versions of DRBD disable all methods, and revert to none, in case one
      fully trusts batteries (either UPS for the whole system or battery for
      NVRAM).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      89b70f39
    • Iustin Pop's avatar
      Ensure all int/float conversions are handled right · 691744c4
      Iustin Pop authored
      
      
      int()/float() can raise either ValueError (in case of int("a")), or
      TypeError (in case of int(None)). We had many bugs over time due to
      this, and a recent one was just diagnosed, so we go over the codebase
      and replace all 'except ValueError' with 'except (TypeError,
      ValueError)' that protect such conversions (there were no 'except
      TypeError' cases that needed a ValueError added).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      691744c4
  9. 04 Jan, 2010 3 commits
  10. 28 Dec, 2009 1 commit
  11. 01 Dec, 2009 1 commit
  12. 03 Nov, 2009 4 commits
  13. 03 Sep, 2009 1 commit
  14. 21 Aug, 2009 1 commit
  15. 06 Aug, 2009 1 commit
  16. 05 Aug, 2009 1 commit
  17. 04 Aug, 2009 2 commits
  18. 16 Jul, 2009 1 commit
    • Iustin Pop's avatar
      Use full-stripe size in LVM growth · 38256320
      Iustin Pop authored
      
      
      LVM has issues when growing stripped volumes, so it's best to specify
      the growth in exact multiples of the full stripe size (as precise as
      possible). For this we need to do a couple of changes:
        - in LVM Attach(), we query additionally the VG extent size and the LV
          stripe count; since this makes lvs return a (possibly) multi-line
          output, we now split it into lines and only take the last one
        - in LVM Grow(), we round up the increase in multiples of the full
          stripe size
      
      The patch also sets the correct target size in DRBD growth.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarOlivier Tharan <olive@google.com>
      38256320
  19. 07 Jul, 2009 1 commit
  20. 01 Jul, 2009 1 commit
  21. 08 Jun, 2009 2 commits
    • Iustin Pop's avatar
      Enable stripped LVs · fecbe9d5
      Iustin Pop authored
      
      
      This patch enables stripped LVs, falling back to non-stripped if the
      stripped creation fails. If the configure-time lvm-stripecount is 1,
      this patch becomes a noop (with an insignificant python-level overhead,
      but no extra lvm calls).
      
      The effect of this patch is that new instances will get stripped LVs
      from the start, whereas old instances will have their LVs stripped as
      soon as replace-disks is run for them.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      fecbe9d5
    • Iustin Pop's avatar
      Add more constants for DRBD and change sync tests · 3c003d9d
      Iustin Pop authored
      
      
      This patch adds constants for the connection status, peer roles and disk
      status, and it changes the rules for when the disk is considered as
      “resyncing” - previously it was only for syncsource/synctarget, but
      there are many other transient statuses which could be misinterpreted as
      ‘degraded’ (because they where not considered as resyncing, but the disk
      is not consistent in these statuses).
      
      Furthermore, cmdlib.py:WaitForSync determines if a device is syncing or
      not based on sync_percent being not none. Not all DRBD resync statuses
      offer a percent done, so if we are syncing but don't have a sync
      percent, we'll report a zero sync percent (and no time estimate).
      
      The patch also removes a few unused variables (is_sync_target,
      peer_sync_target, is_resync) whose value doesn't make sense anymore with
      the new sync rules.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      3c003d9d
  22. 03 Jun, 2009 1 commit
    • Iustin Pop's avatar
      Assemble DRBD using the known size · f069addf
      Iustin Pop authored
      
      
      This patch changes DRBD disk attachment to force the wanted size, as opposed to
      letting the device auto-discover its size.
      
      This should make the disks more resilient with regard to small differences in
      size (e.g. due to LVM rounding). This still works with regard to disk
      growth, but the instances needs to be fully restarted (including disks)
      in that case.
      
      This passes a full burning without problems, but it's still a tricky
      change - if the config.data is not synced with the reality, we might
      tell DRBD a wrong size. At least this will fail outright (and not
      introduce silent errors), as DRBD (per a quick check at the sources)
      tracks the size in the meta-dev and also does not allow shrinking
      consistent devices.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      f069addf
  23. 28 May, 2009 1 commit
    • Iustin Pop's avatar
      Change the bdev init signatures · 464f8daf
      Iustin Pop authored
      
      
      This patch changes all the bdev.BlockDev constructors to take an
      additional ‘size’ parameter, all the backend functions that call those
      functions to pass it and also changes backend.BlocdevCreate() to not use
      the size passed via the rpc call but instead directly disk.size (this is
      the only way it's called).
      
      Note that this patch doesn't do anything with this parameter, just
      stores it on the blockdev objects.
      
      With the patch, we actually have a more uniform init sequence (before
      create had the parameter, but the other functions not).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      464f8daf
  24. 05 May, 2009 2 commits
    • Iustin Pop's avatar
      Fix compatibility with DRBD 8.3 · 01e2ce3a
      Iustin Pop authored
      
      
      DRBD 8.3 changes two more things compared to 8.2:
        - /proc/drbd format changed in multiple ways; the part we're
          interested is the ‘st:’ to ‘ro:‘ change (in the changelog named as
          “Renamed 'state' to 'role'”
        - “drbdsetup /dev/drbdN show” changed the ‘device’ stanza from:
            device "/dev/drbd0";
          to:
            device                  minor 0;
      
      This patch fixes these both and adds data files and unittests for DRBD
      8.3.1.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      01e2ce3a
    • Karsten Keil's avatar
      Fix compatibility with DRBD 8.2 · 34e71fea
      Karsten Keil authored
      
      
      This patch adds (and suppresses) the extra ipv4/ipv6 words before the
      actual address that newer DRBD versions add.
      
      [iustin@google.com: slightly changed the patch to conform to style
      guide, and changed the commit message]
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      34e71fea
  25. 16 Feb, 2009 1 commit
    • Iustin Pop's avatar
      Convert IOErrors for /proc/drbd into our errors · f6eaed12
      Iustin Pop authored
      If /proc/drbd can't be opened, this raises an IOError, but all the
      error-handling behaviour in backend treats only BlockDeviceErrors. This
      creates a plain failure in cluster verify and in other RPC calls.
      
      This patch simply converts EnvironmentErrors into BlockDeviceErrors, and
      also changes the RPC result for NV_DRBDLIST and its handling to be able
      to show the error. The other RPC calls work by default now, due the
      existing error handling.
      
      Reviewed-by: ultrotter
      f6eaed12
  26. 11 Feb, 2009 1 commit
    • Guido Trotter's avatar
      FileStorage: abort creating over an existing file · aed77cea
      Guido Trotter authored
      In FileStorage there is a TODO:
       decide whether we should check for existing files and
       abort or not
      After Ganeti ate my instance data I decided. Let's abort.
      In general there is no reason we should overwrite existing files, and
      doing it can be very harmful for preexisting files on the host.
      
      Reviewed-by: iustinp
      aed77cea
  27. 10 Feb, 2009 4 commits
    • Iustin Pop's avatar
      Some error message cleanups · 33bc6f01
      Iustin Pop authored
      Reviewed-by: imsnah
      33bc6f01
    • Iustin Pop's avatar
      Cleanup of DRBD8._CheckMetaSize · 9c793cfb
      Iustin Pop authored
      This patch converts the _CheckMetaSize method to raise exceptions
      instead of logging and returning False. This fits now in the new rpc
      return types, so it's a cheap change.
      
      Reviewed-by: ultrotter
      9c793cfb
    • Iustin Pop's avatar
      Change the disk assembly to raise exceptions · 1063abd1
      Iustin Pop authored
      This big patch converts the bdev Assemble() methods and the supporting
      functions to raise exceptions instead of returning False. This is a big
      patch, since the assembly functions touch other functions: add children,
      creation, etc. However, the patch does not add much new code, rather it
      reworks existing code.
      
      One of the biggest changes is in the rework of the DRBD8._SlowAssemble()
      method (one of the most complicated/ugly ones). Hopefully the new
      version is a little bit more readable.
      
      Reviewed-by: ultrotter
      1063abd1
    • Iustin Pop's avatar
      Change BlockDev.Remove() failure result · 0c6c04ec
      Iustin Pop authored
      Currently, the Remove() methods of block devices return True/False.
      This doesn't permit any error detail reporting.
      
      This patch changes the return type to None for success, and raises
      BlockDeviceError in case of failure. This permits the details to be
      passed up the stack.
      
      The patch also simplifies a little the Remove method of file-based
      devices (no stat first, just try unlink).
      
      Reviewed-by: ultrotter
      0c6c04ec