1. 02 Dec, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Fix wrong state of deleted networks · 6849b899
      Christos Stavrakakis authored
      Before deleting a network, the network is marked as drained to be
      excluded from automatic IP allocation. The state of the network that is
      exposed in the API is always 'SNF:DRAINED' if the drained flag is set.
      This resulted in deleted networks to appear as 'SNF:DRAINED'. This
      commit fixes this issue by clearing the 'drained' flag when deleting the
      Also, this commit sets the 'drained' flag only when deleting public
      networks that can take part in automatic IP allocation. For private
      networs setting this flag is not needed.
  2. 28 Nov, 2013 1 commit
  3. 25 Nov, 2013 2 commits
    • Christos Stavrakakis's avatar
      cyclades: Rename hotplug to hotplug_if_possible · b19c21f2
      Christos Stavrakakis authored
      Use 'hotplug_if_possible' option when adding/removing NICs from
      instances. 'hotplug' option will fail if the instance is already
      stopped. Also, pass 'hotplug' option only if it is enabled.
    • Christos Stavrakakis's avatar
      cyclades: Map reboot type to shutdown timeout · cc31fa13
      Christos Stavrakakis authored
      Fix handling of reboot type option. If 'hard' reboot type is specified
      this is mapped to zero shutdown timeout of OP_INSTANCE_REBOOT Ganeti
      job. This is only supported from Ganeti>=2.10 and snf-ganeti. In other
      versions this options will be ignored, and we will fall back to Ganeti's
      default shutdown timeout (120s).
  4. 23 Nov, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Fix removal of stale NICs in BUILD state · b6cd68a4
      Christos Stavrakakis authored
      Until now, NICs that did not exist in the Ganeti backend and were in
      BUILD state were removed after a timeout (BUILDING_NIC_TIMEOUT). This
      was dangerous, because if  an OP_INSTANCE_CONNECT job had been "stuck"
      in Ganeti, the NIC and it's IP address would be released. This commit
      fixes this by removing such NICs only if the OP_INSTANCE_CONNECT has
      been finished and the NIC does not exist in the Ganeti backend. Because,
      querying Ganeti has a time overhead, this is only done for NICs that
      have not been created too recently.
  5. 22 Nov, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Add name to Ganeti NICs · 1d546431
      Christos Stavrakakis authored
      Add 'name' attribute to newly created NICs. Currently, the name of the
      NICs will not be used to refer to NICs, as it will be in Synnefo 0.15.
      Names are added only to ease the migration to version 0.15. Also, this
      commit updates snf-dispatcher to preserve the name of the NIC, if any,
      when updating instance NICs.
      Finally, the commit updates handling of firewall tags by adding a second
      tag that contains the name of the NIC. The tags with the name of the
      NICs will be kept in Synnefo 0.15, and the old tags with the index of
      the NIC will be removed.
  6. 20 Nov, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Fix bugs relative with quotas · 87987d11
      Christos Stavrakakis authored
      * Reject previous unaccepted serials if action is 'DESTROY'. This is
        required because multiple DESTROY actions may be pending for the same
        resource (e.g. VM). The one who succeeds will be accepted, while all
        others will be rejected. This isn't optimal since it causes circular
        issuing and rejection of commissions and should be fixed in a better
      * Update dispatcher to handle commissions before updating the state of
        the VM, since if a new commission will be issued, this commission will
        depend on the state of the VM.
  7. 15 Nov, 2013 2 commits
  8. 12 Nov, 2013 1 commit
  9. 11 Nov, 2013 7 commits
  10. 09 Nov, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Do not print IP pool for IPv6 only nets · f98aef2c
      Christos Stavrakakis authored
      Do not print IP pool of Ganeti network in case the network is an IPv6
      only network. The Ganeti network has a dummy IPv5 subnet, just because
      it is needed. Only change this dummy subnet to /30 to reduce space in
      Ganeti config file.
  11. 07 Nov, 2013 2 commits
  12. 06 Nov, 2013 2 commits
  13. 04 Nov, 2013 4 commits
    • Christos Stavrakakis's avatar
      cyclades: Refactor code · a8819ad5
      Christos Stavrakakis authored
      Move code relative with allocating ips and floating IPs to 'logic.ips'
    • Christos Stavrakakis's avatar
      cyclades: Workaround for race condition in Ganeti · 84fcfa69
      Christos Stavrakakis authored
      Workaround for race where OP_INSTANCE_REMOVE starts executing on Ganeti
      before OP_INSTANCE_CREATE. If this is the case, OP_INSTANCE_REMOVE will
      not wait for locks, instead it will fail because the instance has not
      yet be created. Dispatcher will received the failed OP_INSTANCE_REMOVE
      job and will query Ganeti to see if the instance exists. However, if the
      OP_INSTANCE_CREATE has not yet started, the query will return 404, and
      dispatcher will delete the instance from DB and release its IP
      addresses. Following instance creations will fail because the IPv4
      address will be already used in Ganeti.
      This commit is a workaround for this issue until OP_INSTANCE_REMOVE
      supports the 'depends' attribute. Until then, the API will raise 409 if
      the job has not yet completed and the intance has not been added to
    • Christos Stavrakakis's avatar
      cyclades: Delete backend networks with network · 8a21b588
      Christos Stavrakakis authored
      Delete backend network when network is deleted (marked as deleted=True)
      in DB. Backend networks are useless as history and they may be recreated
      if needed. Also fix some tests.
    • Christos Stavrakakis's avatar
      cyclades: Series of fixes regarding networks & ips · eea48fa9
      Christos Stavrakakis authored
      * Do not delete the network from the DB if it has associated floating
        IPs. This should never be the case because a check is made before
        deleting the network, however this check is added for safety.
      * Do not allow deleting a network if there are still ports configured on
        on that network. Until now this check was for machines, but there may
        be ports that are not connected to any machine.
      * Delete subnet IP pools when network is deleted.
      * Get network in locked mode in network-remove cmd.
      * Log error if trying to release an IPv4 address that does not belong to
        any of the IP pools of the associated subnet.
      * Excluded deleted IPv4 addresses when reconciling IP pools.
      * Do not set the network action to destroy when removing network from
        some backend.
  14. 01 Nov, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Create ports without 'device_id' · 4b649f24
      Christos Stavrakakis authored
      Allow creation of ports that are not connected to any instance. Such
      ports will be in 'DOWN' state. To allow this, 'machine' attribute of
      NetworkInterface model has been made to allow null values. Finally, the
      'logic.ports' module has been remove, and the corresponding code has
      been merged into 'logic.servers' module.
  15. 31 Oct, 2013 1 commit
    • Christos Stavrakakis's avatar
      cyclades: Add accounting for IP Addresses · c7834da6
      Christos Stavrakakis authored
      Create IPAddressLog DB table to hold information about allocation of IP
      addresses to virtual servers. The information that is currently saved
      contains the IP address, the ID of the virtual server, the ID of the
      virtual network along with the datetime that the address has been
      allocated and released from the server.
      An entry in this table is created every time a NetworkInterface card
      that has an associated IP address is created in DB. The entry is updated
      with the 'released_at' timestamp when the NIC is destroyed in Ganeti.
      Currently, only IP addresses from public networks (network.public=True)
      are stored in this table.
      This commit also includes a DB data migration for all already allocated
      IP addresses. However, the 'allocated_at' timestamp of this entries will
      not be correct.
  16. 30 Oct, 2013 2 commits
  17. 29 Oct, 2013 1 commit
  18. 21 Oct, 2013 1 commit
  19. 18 Oct, 2013 2 commits
  20. 14 Oct, 2013 1 commit
  21. 10 Oct, 2013 2 commits
  22. 09 Oct, 2013 3 commits