Skip to content
Snippets Groups Projects
  1. Jun 22, 2011
    • Apollon Oikonomopoulos's avatar
      LUCreateInstance: Retrieve IPs from an IP pool · 2abc8f57
      Apollon Oikonomopoulos authored
      
      A new ip keyword is added ("pool") to signify that LUCreateInstance should get
      the instance's IP from an IP pool (rather than manually or by DNS resolution).
      
      IP and link checks are re-ordered so that a NIC's link is available at the time
      of IP address validation.
      
      Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
      2abc8f57
    • Apollon Oikonomopoulos's avatar
      Add config objects and methods for IP pools · 62a7762b
      Apollon Oikonomopoulos authored
      
      This patch introduces the following changes to lib.config and lib.objects to
      facilitate IP pool management.
      
      - Add a "networks" key to objects.cluster to hold link -> subnet relations.
        Each link is assumed to be associated with at most one IPv4 and at most one
        IPv6 subnet. Currently only IPv4 subnets are used.
      - Add a TemporaryReservationManager for IP address reservations.
      - Add config.{_UnlockedCommitIp,CommitIp,_UnlockedReleaseIp,ReleaseIp} to write
        IP pool changes to the config file.
      - Add config.{ReserveIp,GenerateIp} for use with the _temporary_ips
        TemporaryReservationManager.
      - Commit succesful reservations/releases to the IP pools in config.AddInstance
        and config.RemoveInstance
      
      Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
      62a7762b
    • Apollon Oikonomopoulos's avatar
      Add lib/ippool.py: IP pool management primitives · 9dfd5fc2
      Apollon Oikonomopoulos authored
      
      This patch introduces primitive structures for IP pool management. The core of
      the IP Pool management framework is the ippool.IPv4Network class, which encodes
      an IPv4 subnet configuration with its IP address pool. The pool functionality
      depends on python-bitarray and python-ipaddr is used for address manipulation.
      
      ippool.IPv4Network has 3 key attributes:
       - net: The IPv4 subnet definition (CIDR notation)
       - gateway: The default gateway used, if any
       - _pool: a bitarray.bitarray storing the reservation status of individual IPs
      
      The purpose of including ippool.IPv4Network in ganeti is two-fold:
       - It will allow including subnet information useful for network configuration
         (e.g. by being available during an OS provider invocation)
       - It will be used for automatic IP address allocation during instance creation
         for both, routed and bridged modes.
      
      Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
      9dfd5fc2
    • Apollon Oikonomopoulos's avatar
      KVM: configure bridged NICs at migration start · 034c116d
      Apollon Oikonomopoulos authored
      
      Commit 5d9bfd87 moved tap interface handling from KVM to Ganeti, partly to
      also solve the problem of routed interfaces getting configured too early during
      live migrations, causing network anomalies. In that direction, configuration of
      NICs of incoming instances was deferred to FinalizeMigration time.
      
      However, this causes minor issues with bridged interfaces; KVM sends out an
      ARP-like packet upon migration finish, which is lost because the tap interface
      is not yet configured. As a consequence, intermediate network equipment (i.e.
      switches) does not get notified about the topology change, until the instance
      transmits another packet after the bridge has been configured, or the switch's
      ARP cache expires.
      
      The proper solution to that is to support different phases in network
      configuration (pre/post migration), which also requires separate ifup scripts.
      Until then we fall back to configuring bridged interfaces on incoming instances
      at migration start, instead of finish.
      
      Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
      v2.4.2+grnet1
      034c116d
  2. Jun 01, 2011
  3. May 30, 2011
    • Apollon Oikonomopoulos's avatar
      Fix argument order in ReserveLV and ReserveMAC · fa6347d0
      Apollon Oikonomopoulos authored
      
      ConfigWriter.ReserveLV() and Configwriter.ReserveMAC() called
      TemporaryReservationManager.Reserve() with the ec_id and resource arguments
      swapped. As a result, two reservation attempts for the same resource type
      within the same LU would fail, even if the resources requested were different,
      e.g.:
      
        $ gnt-instance add -t sharedfile -o debootstrap+default \
             --net 0:mac=00:01:02:03:04:00 \
             --net 1:mac=00:01:02:03:04:ff \
             --disk 0:size=2g  test_instance
        Failure: prerequisites not met for this operation:
        error type: resource_not_unique, error details:
        MAC address 00:01:02:03:04:ff already in use in cluster
      
      This patch fixes the argument order in the call to Reserve().
      
      Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
      fa6347d0
  4. May 13, 2011
  5. May 12, 2011
  6. May 11, 2011
  7. May 10, 2011
  8. May 09, 2011
  9. May 06, 2011
  10. May 05, 2011
  11. May 04, 2011
  12. May 03, 2011
  13. May 02, 2011
  14. Apr 29, 2011
  15. Apr 28, 2011
  16. Apr 27, 2011
    • Iustin Pop's avatar
      Replace disks: keep the meta device in the same VG · fd09d178
      Iustin Pop authored
      
      This patch enhances the multi-VG support in replace disks, by keeping
      the meta device in the same VG, as opposed to moving it to the data
      device VG (note that we don't have a way to create the meta in a
      different VG in the first place, but at least we correctly handle a
      custom config).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      fd09d178
    • Doug Dumitru's avatar
      Fix for multiple VGs - PlainToDrbd and replace-disks · 88aa7f66
      Doug Dumitru authored
      
      Converting an instance from 'plain' to 'drbd'.  The old code would
      create the drbd volumes in the default VG and then the renames would
      fail.  This fix pulls the plain VG names from the existing volumes and
      places it into the new disk template.
      
      Running 'replace-disks' has a similar issue with the new disks going
      into the wrong VG and then the rename failing.
      
      Their might be a similar issue with 'recreate-disks', but I actually
      have no idea what recreate-disks does, so did not look into it.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      88aa7f66
    • Iustin Pop's avatar
      Fix potential data-loss in utils.WriteFile · 437c3e77
      Iustin Pop authored
      
      os.write can do incomplete writes, as long as at least some bytes have
      been written (like write(2)):
      
      >>> os.write(fd, " " * 1300)
      1300
      >>> os.write(fd, " " * 1300)
      1300
      >>> os.write(fd, " " * 1300)
      1300
      >>> os.write(fd, " " * 1300)
      980
      >>> os.write(fd, " " * 1300)
      Traceback (most recent call last):
       File "<stdin>", line 1, in ?
      OSError: [Errno 28] No space left on device
      
      Note that incomplete write that only wrote 980 bytes, before the
      exception.
      
      To workaround this, we simply iterate until all data is
      written. Unittests could be written by using a parameter instead of
      hardcoding os.write and checking for incomplete writes.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      437c3e77
    • Iustin Pop's avatar
      Improve error messages in cluster verify/OS · 2db04578
      Iustin Pop authored
      
      A few issues in the clarity of the error messages are fixed:
      
      - "ERROR: node node3: OS API version lenny-image": no preposition
        between the parameter type and the OS name, changed to "for
        lenny-image"
      
      - "API version lenny-image differs from reference node node1: 10, 5
        vs. 10, 20, 5, 15": parameters not sorted in display
      
      - "OS variants list lenny-image differs from reference node node1:
        vs. default, i386": empty sets are not clearly delimited, changed to
        add [] around the sets: "node node1: [] vs. [default, i386]"
      
      - "OS parameters lenny-image differs from reference node node1:
        vs. (u'dhcp', u'Whether to enable (yes) or disable (dhcp)')": ugly
        formatting in the OS parameters list, as we used to just "%s" the
        tuple; now it is "reference node node1: [] vs. [dhcp: Whether to
        enable (yes) or disable (dhcp)]"
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      2db04578
    • Iustin Pop's avatar
      Prevent readding of the master node · d833acc6
      Iustin Pop authored
      
      This breaks Ganeti in multiple ways. If we don't make the check in
      gnt-node itself, then bootstrap.SetupNodeDaemon will restart the
      master daemon, making the operation fail:
      
        node1# gnt-node add --readd node1
        Cannot communicate with the master daemon.
        Is it running and listening for connections?
      
      The check in cmdlib is more of a safety check, as we shouldn't reach
      it. If we do (via a bad client), then it will prevent breakage in the
      job queue/config handling.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      d833acc6
Loading