Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / logic @ 7b438672

# Date Author Comment
7b438672 12/10/2013 02:32 pm Christos Stavrakakis

cyclades: Ignore messages about deleted resources

Ignore messages from Ganeti about servers and networks that have already
been marked as deleted in the Cyclades DB. Processing of these messages
may asynchronize Cyclades with Astakos quotas.

1113f89d 12/09/2013 05:53 pm Christos Stavrakakis

cyclades: Order pools by id

16a7ced5 12/09/2013 04:54 pm Christos Stavrakakis

cyclades: Remove testing try/exception statement

e21ac0fa 12/09/2013 02:13 pm Christos Stavrakakis

cyclades: Fix deadlock when releasing floating IPs

036b07b6 12/09/2013 12:55 pm Christos Stavrakakis

cyclades: Fix bug in getting a free floating IP

Fix wrong query which resulted in getting non-floating IPs.

adf766e9 12/08/2013 01:59 pm Christos Stavrakakis

cyclades: Fix division by zero bug

Ganeti reports zero available and total disk if no vg is set. This
caused a division by zero error in the default backend allocator.

40a815f8 12/08/2013 01:59 pm Christos Stavrakakis

cyclades: Fix DB locking issues causing deadlocks

Fix deadlock issues that is caused by Postgresql's locks on foreign
keys. For example, creation of a BackendNetwork row will result in a
shared lock in the 'backend_id' rows. Because updating a VM's NICs
acquired an exclusive lock on the backend that the VM lived, this...

2fa6faca 12/08/2013 01:59 pm Christos Stavrakakis

cyclades: Fix typo in log msg

dce3fc8b 12/04/2013 01:13 pm Christos Stavrakakis

cyclades: Require subnet for IP_LESS_ROUTED nets

e4def9d6 12/04/2013 01:07 pm Christos Stavrakakis

cyclades: Remove DEFAULT_ROUTING_TABLE setting

Do not have a default value from 'link' attribute of IP_LESS_ROUTED
networks. Instead if the admin does not specify a value in
network-create command, uniquely name the networks by with the
BACKEND_PREFIX_ID and network id, e.g. snf-link-42.

d193a5c8 12/04/2013 11:46 am Christos Stavrakakis

cyclades: Add --drained option to network-create

1229a55f 12/03/2013 03:21 pm Christos Stavrakakis

cyclades: Some verbla fixes to snf-manage commands

2052c40e 12/02/2013 04:52 pm Christos Stavrakakis

cyclades: Optimize server-list command

Optimize server-list command by prefetching related fields if needed.

f3c5f1df 12/02/2013 04:03 pm Stratos Psomadakis

Add support for snf-vncauthproxy >= 1.5

6176e251 12/02/2013 12:51 pm Christos Stavrakakis

cyclades: Fix wrong state of deleted networks

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....

2e19e7dc 11/29/2013 05:08 pm Christos Stavrakakis

cyclades: Fix broken unittest

1bf69a52 11/29/2013 04:10 pm Giorgos Korfiatis

cyclades: Lock objects in modifying commands

475d4a85 11/29/2013 04:00 pm Christos Stavrakakis

cyclades: Move all management commands to logic

Move all management commands from 'api/management/commands' to
'logic/management/commands'.

91884d63 11/29/2013 02:26 pm Giorgos Korfiatis

Add some missing Copyright notices

Also add 2013 in package COPYRIGHT files.

57374655 11/28/2013 01:30 pm Christos Stavrakakis

cyclades: Change logging level to error

c32c74d9 11/26/2013 03:27 pm Christos Stavrakakis

cyclades: Fix bug by wrong indentation

e74a5b4b 11/26/2013 03:20 pm Christos Stavrakakis

cyclades: Improve messages for default networks

Improve log and exception messages when failing to connect new server to
default and forced server networks.

bc4dfc43 11/26/2013 01:29 pm Christos Stavrakakis

cyclades: Include 'vlmc' and 'archipelago'

Fix image ID for both 'vlmc' and 'archipelago' ext providers.

ee995ae2 11/26/2013 01:11 pm Christos Stavrakakis

Merge branch 'master' into develop

Conflicts:
ci/schemas/one_node_wheezy/wheezy.conf
docs/admin-guide.rst
snf-cyclades-app/synnefo/api/actions.py
snf-cyclades-app/synnefo/api/servers.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/logic/callbacks.py...

1709a768 11/25/2013 04:25 pm Dionysis Grigoropoulos

cyclades: Fix a bug in logic/subnets.py

  • Don't allow creation of subnets on a network that is initilized in a
    backend
b81e0ba5 11/25/2013 01:40 pm Christos Stavrakakis

cyclades: Rename hotplug to hotplug_if_possible

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.

0f89715b 11/25/2013 01:13 pm Dionysis Grigoropoulos

cyclades: Update some snf-manage commands

  • Update network-remove, server-remove, floating-ip-remove, port-remove
    to extend RemoveCommand class added in commit
    ec15e2ab68f90dcc7310863c9293708055fbfb7d
91430ce0 11/25/2013 01:13 pm Dionysis Grigoropoulos

cyclades: Better handling of deleted subnets

  • Fix a bug where snf-manage subnet-list printed deleted subnets too
  • Fix a query, that also returned deleted subnets
eb5f7eb0 11/25/2013 01:13 pm Dionysis Grigoropoulos

cyclades: Fix a bug in logic/subnets.py

  • Fix a potential crash if the gateway IP was the last available IP of
    the subnet
  • Create the corresponding test
74267398 11/25/2013 11:33 am Christos Stavrakakis

cyclades: Add shutdown_timeout to RAPI client

Add missing 'shutdown_timeout' option to reboot, shutdown and destroy
methods of Ganeti RAPI client. The Ganeti RAPI daemon will ignore this
options until Ganeti 2.10.

51136096 11/25/2013 11:33 am Christos Stavrakakis

cyclades: Map reboot type to shutdown timeout

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...

edbc1d5a 11/23/2013 07:59 pm Christos Stavrakakis

cyclades: Remove duplicate constants

1cb7846c 11/23/2013 07:52 pm Christos Stavrakakis

cyclades: Fix removal of stale NICs in BUILD state

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"...

b2272468 11/22/2013 02:38 pm Christos Stavrakakis

cyclades: Add name to Ganeti NICs

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,...

d9f2a9e1 11/21/2013 01:28 pm Christos Stavrakakis

cyclades: Command to export Cyclades statistics

Add new 'snf-manage stats-cyclades' management command to export basic
statistics about Cyclades, like number of servers, network and resource
utilization. The command can either export the statistics either in JSON...

bda47e03 11/21/2013 01:28 pm Christos Stavrakakis

cyclades: Export Cyclades detailed stats from API

Add '/admin/stats/detail' API endpoint to export basic statistics about
Cyclades. Access to this view is only allowed to the users that belong
to specific Astakos groups, as specified in the new setting
'ADMIN_STATS_PERMITTED_GROUPS.' Also, added the new 'user_in_groups' API...

1fdd8d69 11/20/2013 08:08 pm Christos Stavrakakis

cyclades: Fix bugs relative with quotas

  • 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...
aee560b0 11/18/2013 02:57 pm Christos Stavrakakis

cyclades: Do not retry all Ganeti failed creations

Make snf-dispatcher retry only the OP_INSTANCE_CREATE jobs that failed
due to opportunistic locking. Such jobs include the 'ECODE_TEMP_NORES'
error code in the opcode result. This commit makes snf-ganeti-eventd...

73517357 11/18/2013 12:48 pm Christos Stavrakakis

gtools: Fix Ganeti allocation parameters

When retrying a failed job, remove 'pnode' and 'snode' fields if they
were implicitly set by Ganeti iallocator. Ganeti will fail if both
iallocator and node are specified in the job.

7b4a61dc 11/18/2013 12:46 pm Christos Stavrakakis

gtools: Fix Ganeti allocation parameters

When retrying a failed job, remove 'pnode' and 'snode' fields if they
were implicitly set by Ganeti iallocator. Ganeti will fail if both
iallocator and node are specified in the job.

368d879e 11/15/2013 01:38 pm Giorgos Korfiatis

cyclades: Generalize issue_and_accept_commission

Use issue_and_accept_commission for any action where one needs to
automatically accept the commission after issuing and committing.

16b959ce 11/15/2013 01:33 pm Giorgos Korfiatis

cyclades: Issue commission based on action

Make issue_commission() the single point where provisions are computed
and the appropriate astakosclient call is issued.

fb540e3a 11/15/2013 01:32 pm Giorgos Korfiatis

cyclades: Resolve undecided serial in force mode

Reject a serial with pending=True only when we need to force a new
commission on a given resource.

Also improve handling of serial state: make sure pending is set to False
when we decide whether to accept or reject a serial. Mark a serial to...

64bca363 11/15/2013 01:32 pm Giorgos Korfiatis

cyclades: Pass action params in server_command

Commission to be issued depends on extra parameters for some actions,
e.g., on the flavor when resizing a vm.

6e73f499 11/14/2013 12:14 pm Christos Stavrakakis

cyclades: Allow deletion of ports from public nets

Move check about deleting a port from a public network. This check is
only enforced in the API, but is allowed in logic layer, e.g. snf-manage
commands.

3a09d155 11/13/2013 11:28 am Christos Stavrakakis

Merge branch 'hotfix-0.14.10' into develop

Conflicts:
Changelog
snf-cyclades-app/synnefo/api/servers.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/logic/callbacks.py
snf-cyclades-app/synnefo/logic/management/commands/reconcile-networks.py...

c9e99213 11/13/2013 11:06 am Christos Stavrakakis

cyclades: Update disk_templates if empty

Make backend_allocator to refresh the available disk templates of a
backend if there are empty.

32b1ed4a 11/13/2013 09:44 am Christos Stavrakakis

cyclades: Check drained only if not destroying

Check drained flag only if network actions is not destroy. When network
is being destroyed the network is automatically marked as drained to
exclude it from IP allocations.

af1832fe 11/13/2013 09:18 am Christos Stavrakakis

cyclades: Check for all finalized states

c12627c7 11/12/2013 02:31 pm Christos Stavrakakis

cyclades: Handle snf-ganeti bug

Create IPv6 only networks as /29 because snf-ganeti can not create /30
networks.

a1dae38d 11/12/2013 01:34 pm Christos Stavrakakis

Merge branch 'feature-cyclades-networks' into develop

Conflicts:
snf-cyclades-app/synnefo/api/management/commands/server-inspect.py
snf-cyclades-app/synnefo/app_settings/urls.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/logic/backend_allocator.py...

ddffd973 11/12/2013 01:06 pm Christos Stavrakakis

cyclades: Fix some broking tests

44bd008a 11/11/2013 04:43 pm Dionysis Grigoropoulos

cyclades: Fix a bug in network and subnet create

  • Fix a bug if the user specified no allocation pools
  • Fix a wrong error message in logic/subnets.py
0d1f9117 11/11/2013 04:00 pm Dionysis Grigoropoulos

cyclades: Add a new function in logic/subnets.py

  • Add a function in logic/subnets.py that parses allocation pools
  • Add a new option in snf-manage network-create for allocation pools
  • Update subnet-create to use the new function
727fb2f9 11/11/2013 03:29 pm Christos Stavrakakis

cyclades: Retry failed instance creation

Handle special case where an OP_INSTANCE_CREATE job which uses the
opportunistic locking feature fails. This failure is probably due to the
fact that all nodes may be already locked. In this case, make
snf-dispatcher retry the failed job with opportunistic locking turned...

dee2e82c 11/11/2013 03:29 pm Christos Stavrakakis

cyclades: Fix compatibility issues with networks

From version 2.7, Ganeti returns the network's UUID field in nics
'networks' attribute. Instead use 'networks.names' attribute to get
the network name.

66932293 11/11/2013 03:29 pm Christos Stavrakakis

cyclades: fix typo in snf-dispatcher

0dd40027 11/11/2013 03:29 pm Christos Stavrakakis

cyclades: Fix case where 'dfree' is None

If Ganeti has not enabled 'plain' or 'drbd' disk template, then it
reports 'dfree' as None. Fix this corner case by treating None as 0.

2796f26a 11/11/2013 03:29 pm Christos Stavrakakis

cyclades: Small fixes to network reconciliation

  • Pass missing argument to function
  • Fix corner case where there are no externally reserved IPs.
4b052f94 11/11/2013 03:29 pm Dimitris Aragiorgis

cyclades: New style format for modifying a NIC

Signed-off-by: Dimitris Aragiorgis <>

9c7c6a57 11/11/2013 03:29 pm Dimitris Aragiorgis

cyclades: Remove hotplug from InstanceCreate

Signed-off-by: Dimitris Aragiorgis <>

d9b5b020 11/11/2013 03:29 pm Dimitris Aragiorgis

cyclades: Pass network type info as network tag

Signed-off-by: Dimitris Aragiorgis <>

3f68fa52 11/11/2013 03:28 pm Dimitris Aragiorgis

cyclades: Remove deprecated network type in ganeti

Signed-off-by: Dimitris Aragiorgis <>

b36d45e6 11/11/2013 03:28 pm Christos Stavrakakis

cyclades: Use opportunistic locking

Use opportunistic locking, introduced in Ganeti 2.7, to allow parallel creation
of VMs in the Ganeti backend. When this option is set, Ganeti iallocator
will allocate the VM only to nodes that not locked (e.g. by other VM...

2b4becab 11/11/2013 03:28 pm Christos Stavrakakis

gtools: Fix compatibility issues with ganeti-2.7

  • SimpleConfigReader has been removed. Use SimpleStore
  • QUEUE_DIR has been moven from ganeti.constants to ganeti.pathutils
  • _QueuedJob.Restore takes 2 more arguments
  • cyclades: Group info is returned as list instead of string
94ea30c8 11/11/2013 03:26 pm Christos Stavrakakis

cyclades: Fix bug in network reconciliation

Skip reconciliation for a network that does not exist in the DB, if
reconciliation is running without the '--fix' option.

80a548e3 11/11/2013 12:59 pm Christos Stavrakakis

Merge branch 'master' into develop

Conflicts:
Changelog
astakosclient/astakosclient/keypath.py
ci/utils.py
docs/admin-guide.rst
snf-astakos-app/astakos/im/cookie.py
snf-astakos-app/astakos/im/functions.py
snf-astakos-app/astakos/im/quotas.py
snf-astakos-app/astakos/im/views/projects.py...

f23fbacf 11/11/2013 11:26 am Christos Stavrakakis

cyclades: Simplify code to 'logic.subnets' module

bac6ed1e 11/09/2013 07:48 pm Christos Stavrakakis

cyclades: Do not print IP pool for IPv6 only nets

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...

8f335041 11/08/2013 05:19 pm Christos Stavrakakis

cyclades: Handle 'drained' flag of networks

  • Export 'SNF:DRAINED' status for drained networks.
  • Do not allow creation of new ports in drained networks.
  • Do not allow allocation of new IPs in drained networks.
ec4e0acc 11/08/2013 04:49 pm Christos Stavrakakis

cyclades: Fix corner case in reconciliation

If at the end of reconciliation the state of the network is not ACTIVE,
try to recompute the state of the network based on the state of the
networks in each backend. This step is mostly needed in case that the
network does not exist in any backend.

84a0469b 11/07/2013 09:32 pm Christos Stavrakakis

cyclades: Fix reconciliation of floating IP pools

Remove special handling of floating IP pools in reconciliation
mechanism since floating IP pools are treated the same way with other
networks.

a2bd0802 11/07/2013 04:31 pm Christos Stavrakakis

cyclades: Pass 'nfdhcp' tag to IPv6 networks

Pass 'nfdhcp' tag even if network is IPv6 only.

68129b44 11/07/2013 04:28 pm Christos Stavrakakis

cyclades: Optimize *-list commands

Use prefetch_related and select-related to importive the DB queries that
are generated by *-list snf-manage commands.

d2036274 11/07/2013 04:28 pm Christos Stavrakakis

cyclades: Code refactoring to backend module

  • Create function 'ensure_network_is_active' to check if a network
    exists in backend and create it if not.
  • Create function 'create_job_dependencies' to transaform a list of job
    IDs to the 'depends' attribute as expected by Ganeti....
6b5cdb0f 11/07/2013 04:28 pm Christos Stavrakakis

cyclades: Fix init of networks in backend-add

Fix which networks are going to be initialized in the new backend and
how the are printed in the output!

7b5263e4 11/06/2013 09:51 pm Christos Stavrakakis

cyclades: Fix network-create management command

Fix when network is created in the Ganeti backends. The network must be
created in the Ganeti backends only after IPv4 or/and IPv6 subnet has
been created. This commit moves the code that created the network in the...

3549cb2f 11/06/2013 06:58 pm Dionysis Grigoropoulos

cyclades: Fix bugs in subnets and ports

  • Return subnets from public networks, in GET subnets
  • Fix a bug in list ports, where only attached ports to servers were
    listed
bfb3f9c2 11/06/2013 05:50 pm Christos Stavrakakis

cyclades: Create IPv6 Addresses from dispatcher

When ports are created from the API they do not have an IPv6 address.
The IPv6 address is only available after the MAC address of the
NIC is known which is only available after the message from the
Ganeti backend has been received. However, dispatcher did not created...

3785b737 11/06/2013 02:56 pm Dionysis Grigoropoulos

cyclades: Merge subnet-create with network-create

  • Merge snf-manage subnet-create into snf-manage network-create
8d5795b4 11/06/2013 02:00 pm Christos Stavrakakis

Cyclades: Rename 'Can not' to 'Cannot' to all msgs

ee688a71 11/06/2013 01:28 pm Christos Stavrakakis

cyclades: Do not allow any action on 'ERROR' vms

Do not allow any action, other than 'DESTROY' in servers that are in
'ERROR' state. If the server is in 'ERROR' state then the corresponding
Ganeti instance may not exist, so all actions will fail.

3aecadc8 11/05/2013 11:07 am Christos Stavrakakis

cyclades: Fix default/forced server networking

Fix the default behaviour for networking of servers that are being
created. There are two settings controlling this behaviour:

  • CYCLADES_DEFAULT_SERVER_NETWORKS: This setting contains list of
    networks to connect a newly created server to, if the user has not...
3c96580c 11/04/2013 04:29 pm Christos Stavrakakis

cyclades: Add missing 'ips' module

0292883e 11/04/2013 03:52 pm Christos Stavrakakis

cyclades: Refactor code

Move code relative with allocating ips and floating IPs to 'logic.ips'
module.

01f5f8d9 11/04/2013 03:20 pm Christos Stavrakakis

cyclades: Workaround for race condition in Ganeti

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...

3f18f035 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Forbid new ports no deleting network

Do not allow creation of new ports and reservation of floating IPs on
network that are being deleted. Currently the state of the network
changes only when the network gets deleted from all backends. So we
check if a network is being deleted by checking if the action of the...

d2c3c533 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Create server in public net with FIP

Remove 'floating_ips' extension attribute to POST /servers API call.
Instead use the 'fixed_ip' attribute of 'networks' attribute to specify
the IPv4 address of a floating IP. So in order to create a server
connected to a private network and a public network, the 'networks'...

c82f57ad 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Series of fixes regarding networks & ips

  • 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...
e8234183 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Delete backend networks with network

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.

e4758367 11/04/2013 11:12 am Dionysis Grigoropoulos

cyclades: Add snf-manage subnet-inspect

  • Add snf-manage subnet-inspect
  • Update return_end and return_start function in IPPool
09b76b7e 11/02/2013 02:39 pm Christos Stavrakakis

cyclades: Fix permissions when looking up ports

Look up of ports should check the port userid and not the network
userid.

99988465 11/02/2013 01:43 pm Christos Stavrakakis

cyclades: Create server with existing ports

Extend POST /servers API call to support creation of servers that will
be using existing ports. Networking of the instance is defined via the
'networks' attribute which can contain either network UUIDs or port
UUIDs. In case of network UUIDs, the user can also request for a...

ae2da8a2 11/02/2013 01:08 pm Christos Stavrakakis

cyclades: Fix double double creation of IP log

The port creation command called 'associate_port_with_machine' function
in order to associate the port with the machine and create an
IPAddressLog entry. However, this is already done by the connect
function which sends the job in the Ganeti backend. This resulted in...

4cbd934b 11/01/2013 04:17 pm Christos Stavrakakis

cyclades: Reconcile pools only for IPv4+dhcp subs

Perform IP pools reconciliation only for networks with an IPv4 subnet
that has enabled the dhcp option.

fae6e5f0 11/01/2013 04:17 pm Christos Stavrakakis

cyclades: Create ports without 'device_id'

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...

6731a6ac 11/01/2013 04:10 pm Christos Stavrakakis

cyclades: Fix bug in floating-ip-list

ff863a80 11/01/2013 12:45 am Christos Stavrakakis

cyclades: Add accounting for IP Addresses

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...

5055b4c7 11/01/2013 12:03 am Marios Kogias

cyclades: PEP8 Fix

51a681ac 10/31/2013 04:40 pm Marios Kogias

cyclades: Fix bug in port-create

Check if floating-ip belongs to the given network