Skip to content
Snippets Groups Projects
  1. Sep 29, 2008
    • Iustin Pop's avatar
      Nicely sort the job list · 3b87986e
      Iustin Pop authored
      Unless we decide to change the job identifiers to integer, we should at
      least sort the list returned by _GetJobIDsUnlocked.
      
      Reviewed-by: imsnah
      3b87986e
  2. Sep 28, 2008
    • Iustin Pop's avatar
      Move the pseudo-secret generation to utils.py · 33081d90
      Iustin Pop authored
      The bootstrap code needs a pseudo-secret and this is currently generated
      inside the InitGanetiServerSetup function. Since more users will need
      this, move it to utils.py
      
      Reviewed-by: ultrotter
      33081d90
    • Iustin Pop's avatar
      Fix a bug related to static minors · d48663e4
      Iustin Pop authored
      When the node does not yet have any minors allocated, the first minor
      (0) will not be entered in the ConfigWriter._temporary_drbds structure.
      This does not happen for our current usage, since we always ask for two
      minors (so the next call will not match this case), but it will be
      triggered if we only ask for one minor, and then ask again before adding
      the instance to the config file.
      
      Reviewed-by: ultrotter
      d48663e4
  3. Sep 27, 2008
    • Iustin Pop's avatar
      Add checks for tcp/udp port collisions · 48ce9fd9
      Iustin Pop authored
      In case the config file is manually modified, or in case of bugs, the
      tcp/udp ports could be reused, which will create various problems
      (instances not able to start, or drbd disks not able to communicate).
      
      This patch extends the ConfigWriter.VerifyConfig() method (which is used
      in cluster verify) to check for duplicates between:
        - the ports used for DRBD disks
        - the ports used for network console
        - the ports marked as free in the config file
      
      Also, if the cluster parameter ‘highest_used_port’ is actually lower
      than the computed highest used port, this is also flagged as an error.
      
      The output from gnt-cluster verify will show (output manually wrapped):
      
      node1 # gnt-cluster verify
      * Verifying global settings
        - ERROR: tcp/udp port 11006 has duplicates: instance3.example.com/network port,
      instance2.example.com/drbd disk sda
        - ERROR: tcp/udp port 11017 has duplicates: instance3.example.com/drbd disk sda,
      instance3.example.com/drbd disk sdb, cluster/port marked as free
        - ERROR: Highest used port mismatch, saved 11010, computed 11017
      * Gathering data (2 nodes)
      ...
      
      Reviewed-by: ultrotter
      48ce9fd9
    • Iustin Pop's avatar
      Update the cluster serial_no on certain operations · b9f72b4e
      Iustin Pop authored
      This patch adds update of the cluster serial number for:
        - add/remove node (as the cluster's node list is changed)
        - add/remove/rename instance (as the cluster's instance list is changed)
        - change the volume group name
      
      The rule for updating this attribute is when cluster-wide properties are
      changed, but not individual node/instance ones.
      
      There are other remaining cases to handle, pending on the ssconf
      changes.
      
      Reviewed-by: ultrotter
      b9f72b4e
    • Iustin Pop's avatar
      Allow listing of the serial_no via gnt-* list · 38d7239a
      Iustin Pop authored
      This patch adds listing of the serial_no attribute in gnt-instance and
      gnt-node list, and updates to the manpages to reflect the change.
      
      Reviewed-by: ultrotter
      38d7239a
    • Iustin Pop's avatar
      Initialize and update the serial_no on objects · b989e85d
      Iustin Pop authored
      This patch add initialization of the serial_no on instance and nodes,
      and update of the field whenever an object is updated in the generic
      case, via ConfigWriter.Update(obj) and in the specific case of
      instances' state being modified manually.
      
      Reviewed-by: ultrotter
      b989e85d
    • Iustin Pop's avatar
      Switch the global serial_no to the top object · 9d38c6e1
      Iustin Pop authored
      Currently the serial_no that is incremented every time the configuration
      file is written is located on the 'cluster' object in the configuration
      structure. However, this is wrong as the cluster serial_no should be
      incremented only when the cluster state is changed (for whatever
      definition of “changed” we will use), not simply because the
      configuration file is written.
      
      This patch changes so that the ConfigWriter._BumpSerialNo affects the
      top-level ConfigData object.
      
      Reviewed-by: ultrotter
      9d38c6e1
    • Iustin Pop's avatar
      Add serial_no attributes to objects · be1fa613
      Iustin Pop authored
      This patch adds the ‘serial_no’ attribute to the other top-level objects
      (the configuration object itself, the nodes and the instances).
      
      Reviewed-by: ultrotter
      be1fa613
    • Iustin Pop's avatar
      Replace a cfg.AddInstance with UpdateInstance · 97abc79f
      Iustin Pop authored
      This seems to be the last (deprecated) use of AddInstance in order to
      update an instance.
      
      The patch also removes a whitespace-at-eol case.
      
      Reviewed-by: ultrotter
      97abc79f
  4. Sep 25, 2008
    • René Nussbaumer's avatar
      Fix iallocator name · 1ce4bbe3
      René Nussbaumer authored
      port forward of patch from revision 1690 with following message:
      
      Patch on revision 1686 used the wrong field: ial.name, which is the instance
      name and not the iallocator name. self.op.iallocator is the right field.
      
      Sorry for this inconvenience.
      
      Reviewed-by: imsnah
      1ce4bbe3
    • René Nussbaumer's avatar
      Fix a broken format string · 207a6c74
      René Nussbaumer authored
      This patch fixes a broken format string. It's expecting 3 parameters, but only
      gets 2. This change will add the missing parameter. This is a forward-port
      of the fix in Ganeti 1.2
      
      Reviewed-by: imsnah
      207a6c74
  5. Sep 24, 2008
    • Iustin Pop's avatar
      Switch config.py to logging · 74a48621
      Iustin Pop authored
      A couple of more modules are using the obsolete logger functions, config
      being one of them.
      
      Reviewed-by: imsnah
      74a48621
  6. Sep 23, 2008
    • Iustin Pop's avatar
      Switch to static minors for DRBD · a1578d63
      Iustin Pop authored
      With some todos remaining, this patch switches the DRBD devices to use
      the passed minors, and the cmdlib code (add instance and replace disks)
      to request and assign minors to the DRBD disks.
      
      Todos:
        - look at the disk RPC calls to see which can be optimized away, since
          we now know the minor beforehand
        - remove the _FindUnusedMinor usage from the few places it's still
          used (not for actual disks, but for temporary use in meta devs) and
          eventually replace with _CheckMinorUnused or such
      
      Of course, this and/or the previous two patches break existing clusters.
      Again.
      
      Reviewed-by: imsnah
      a1578d63
    • Iustin Pop's avatar
      Implement config support for drbd static minors · a81c53c9
      Iustin Pop authored
      This patch adds support for allocating static minors.
      
      Like for the LVM uuids, we add a new cache for the temporarily allocated
      requests, and the users of the new methods must manually clear the
      cache. If this doesn't happen, at worst we lose some minors.
      
      Todos remaining:
        - implement duplicate check at configuration load, and at instance
          add/instance update
        - investigate automatically cleaning the cache on instance add/update
          if the minors/instance/node pairs match
      
      Reviewed-by: imsnah
      a81c53c9
    • Iustin Pop's avatar
      Fix disk replace secondary with static minors · 468b46f9
      Iustin Pop authored
      The code in 'updating instance configuration' section of the replace
      disks with change secondary node was setting a wrong new logical_id for
      the drbd devices (only set the new node, not the new minor). The patch
      fixes this by remembering the new logical_id that we use for activating
      the drbd and reusing it (instead of recomputing).
      
      Since the minors are not needed to be allocated before the LVs are
      created, we also move the minor allocation step (currently as None)
      after this step.
      
      Reviewed-by: imsnah
      468b46f9
  7. Sep 22, 2008
    • Iustin Pop's avatar
      Extend DRBD disks with minors attribute · ffa1c0dc
      Iustin Pop authored
      This patch converts the DRBD disks to contain also a minor (per each
      node) attribute. This minor is not yet used and is always initialized
      with None, so the patch does not have any real-world impact - except for
      automatically upgrading config files (it adds the minors as None, None).
      
      Reviewed-by: imsnah
      ffa1c0dc
  8. Sep 18, 2008
  9. Sep 17, 2008
  10. Sep 11, 2008
    • Guido Trotter's avatar
      GetAllInstancesInfo, change internal iterator name · 64d3bd52
      Guido Trotter authored
      GetAllInstancesInfo used "node" as an iterator name. Change it to
      instance to make it less confusing.
      
      Reviewed-by: iustinp
      64d3bd52
    • Guido Trotter's avatar
      Parallelize Tag operations · 8646adce
      Guido Trotter authored
      For now we lock the instance/node for adding/deleting tags from it, but
      we could probably in the future do without, with more support from the
      config for atomic operations.
      
      Reviewed-by: iustinp
      8646adce
    • Guido Trotter's avatar
      Parallelize LUSetClusterParams (and add a FIXME) · c53279cf
      Guido Trotter authored
      Reviewed-by: imsnah
      c53279cf
    • Guido Trotter's avatar
      Parallelize LURemoveExport · 3656b3af
      Guido Trotter authored
      Reviewed-by: imsnah
      3656b3af
    • Guido Trotter's avatar
      Parallelize LURemoveInstance · cf472233
      Guido Trotter authored
      Using the new add/remove infrastructure this becomes pretty easy! :)
      
      Reviewed-by: imsnah
      cf472233
    • Guido Trotter's avatar
      Parallelize LUCreateInstance · 7baf741d
      Guido Trotter authored
      Finally, instance create on different node, without iallocator, can run
      in parallel. Iallocator usage still needs all nodes to be locked,
      unfortunately. As a bonus most checks which could have been moved to
      ExpandNames, before any locking is done.
      
      Reviewed-by: imsnah
      7baf741d
    • Guido Trotter's avatar
      Implement adding/removal of locks by declaration · ca2a79e1
      Guido Trotter authored
      With this patch LUs can declare locks to be added when they start and/or
      removed after they finish. For now locks can only be added in the
      acquired state, and removed if owned, and added locks default to be
      removed again, unless some action is taken.
      
      Reviewed-by: imsnah
      ca2a79e1
    • Guido Trotter's avatar
      LockSet: forbid add() on a partially owned set · d2aff862
      Guido Trotter authored
      This patch bans add() on a half-acquired set. This behavior was
      previously possible, but created a deadlock if someone tried to acquire
      the set-lock in the meantime, and thus is now forbidden. The
      testAddRemove unit test is fixed for this new behavior, and includes a
      few more lines of testing and a new testConcurrentSetLockAdd function
      tests its behavior in the concurrent case.
      
      Reviewed-by: imsnah
      d2aff862
    • Guido Trotter's avatar
      Fix typo in a locking.py comment · ab62526c
      Guido Trotter authored
      Reviewed-by: imsnah
      ab62526c
    • Guido Trotter's avatar
      Use is_owned to determine whether to unlock · 80ee04a4
      Guido Trotter authored
      Now that is_owned is public we don't need to play games at the end of an
      LU. If we're still owning anything we just release it.
      
      Reviewed-by: imsnah
      80ee04a4
    • Guido Trotter's avatar
      Add GanetiLockManager.is_owned function · d4f4b3e7
      Guido Trotter authored
      This is a public version of the private function we already had.
      We don't just change the previous version because it had lots of users
      in the library itself and in the testing code.
      
      Reviewed-by: imsnah
      d4f4b3e7
    • Guido Trotter's avatar
      Fix LockSet._names() to work with the set-lock · d4803c24
      Guido Trotter authored
      If the set-lock is acquired, currently, the _names function will fail on
      a double acquire of a non-recursive lock. This patch fixes the behavior,
      and some lines of code added to the testAcquireSetLock test check that
      this and other functioins behave properly.
      
      Reviewed-by: imsnah
      d4803c24
  11. Sep 10, 2008
    • Michael Hanselmann's avatar
      jqueue: Add common RPC error handling function · e74798c1
      Michael Hanselmann authored
      We didn't decide yet what exactly it should do with failed nodes.
      
      Reviewed-by: ultrotter
      e74798c1
    • Iustin Pop's avatar
      Remove locking of instances in certain queries · 57a2fb91
      Iustin Pop authored
      This patch is similar to the node patch (rev 1650). We disable locking
      of instance (and nodes) if we only query static information.
      
      Reviewed-by: ultrotter
      57a2fb91
    • Iustin Pop's avatar
      Add an atomic ConfigWrite.GetAllInstanceInfo() · 0b2de758
      Iustin Pop authored
      In order to be able to query instance without locking them, we need the
      same atomic query of multiple instances as for nodes.
      
      Reviewed-by: ultrotter
      0b2de758
    • Iustin Pop's avatar
      Add ConfigWriter._UnlockedGetInstanceList/Info() · 94bbfece
      Iustin Pop authored
      This patch splits the GetInstanceInfo and GetInstanceList methods into
      two parts, one locked one _Unlocked similar to the way nodes are
      queried.
      
      Reviewed-by: ultrotter
      94bbfece
    • Iustin Pop's avatar
      Rewrite the 'only submit job' handling in scripts · e9d741b6
      Iustin Pop authored
      The "sys.exit(0)" was not nice as you couldn't differentiate it from
      other exit codes. We change this to a specially defined exception for
      this, so that multi-opcode commands can handle this nicely.
      
      Reviewed-by: imsnah
      e9d741b6
    • Iustin Pop's avatar
      Optimize the OpQueryNodes for names only · c8d8b4c8
      Iustin Pop authored
      Currently, OpQueryNodes is locking all nodes (in shared mode), which
      will also block the special case of querying only for the node names
      (this is needed for gnt-cluster command, for example). There is no
      logical requirement to not give the administrator enough power if she/he
      knows what to do, so it would be logical that querying the node names
      works without a lock.
      
      The patch changes the LUQuerytNodes.ExpandNodes to only request locking
      when the selected fields contain dynamic attributes, and a small change
      in the Exec() method to use the new, atomic query method from
      ConfigWriter.
      
      Reviewed-by: ultrotter
      c8d8b4c8
    • Iustin Pop's avatar
      Add a way to export all node information at once · d65e5776
      Iustin Pop authored
      The patch adds a new function to export all node information at once
      (i.e. atomically with respect to the configuration lock).
      
      Reviewed-by: ultrotter
      d65e5776
  12. Sep 09, 2008
    • Michael Hanselmann's avatar
      Never remove job queue lock in node daemon · 1bc59f76
      Michael Hanselmann authored
      Otherwise, corruption could occur in some corner cases. E.g. when
      LeaveNode is running in a child and is in the process of removing
      queue files, the main process gets killed, started again and gets
      a request to update the queue. This is rather extreme corner case,
      but we should opt for safety.
      
      Reviewed-by: iustinp
      1bc59f76
Loading