Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / logic @ d0545590

# Date Author Comment
bfd04b01 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Include 'index' when comparing NICs

cb7b1c23 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Clear FloatingIP when deleting NIC

Override 'delete' method of NetworkInterface model, to clear the
'machine' flag of the corresponding NIC, if any.

0d069390 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Ignore Ganeti NICs with unknown ID

Do not process Ganeti NICs that do not have a valid ID and so are
unknown to Cyclades, because processing these NICs would require to
create them in DB and then rename them in Ganeti with the corresponding
identifier....

d0545590 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Use NIC UUID in firewall tags

Use NICs UUID instead of index to generate firewall tags. Make the
'set_firewall_profile' action to take the NICs ID as argument. Also,
update the firewall settings.

443315d6 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Add 'ip_type' attribute to NIC

Extend NetworkInterface model with the 'ip_type' attribute to show
whether the IP is a floating or fixed.

Signed-off-by: Christos Stavrakakis <>

a1baa42b 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Use UUIDs to update VM NICs

Callback functions of snf-dispatcher updated the NICs of a VM by
deleting all NICs from DB, and creating the new NICs that were described
in the message. However, since NICs have UUIDs, this is no longer
required. This commit update callbacks to update the NICs based on their...

e6fbada1 10/09/2013 11:40 am Christos Stavrakakis

gtools: Make eventd send job fields

Make snf-ganeti-eventd send 'job_fields' for instance and network
opcodes, and modify the corresponding backend functions and
snf-dispatcher callbacks.

3c52a9df 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Fix getting action from Ganeti opcode

Parse the fields of the Ganeti command, to distinquish between
'CONNECT' and 'DISCONNECT' in case of 'OP_INSTANCE_SET_PARAMS'.

d7ff7f5a 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Make reconciliation timeouts constants

Remove hard-coded timeouts from code and make them constants. Also do
not perform reconciliation for recent building NICs.

cd7ed999 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Use NIC uuid when deleting NIC

7c714455 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Use Ganeti NIC UUIDs

Since Ganeti 2.8, it is supported to refer to devices (NICs and Disks)
not only by their index but also by their name or UUID. This commit
updates Synnefo to refer to devices by their name. Synnefo will set the
name of the devices which will be a UUID. We do not use Ganeti's UUIDs...

a9bb2a1a 10/09/2013 11:40 am Christos Stavrakakis

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
  • Group info is returned as list instead of string
e9d59f5e 10/09/2013 11:40 am Christos Stavrakakis

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
creation). This may result in unbalanced clusters, but `hbal` can be...

bc37fa88 10/09/2013 11:40 am Dimitris Aragiorgis

Remove deprecated network type in ganeti

Signed-off-by: Dimitris Aragiorgis <>

700b85be 10/09/2013 11:40 am Dimitris Aragiorgis

Pass network type info in tags during create

Signed-off-by: Dimitris Aragiorgis <>

89e92ee5 10/09/2013 11:40 am Dimitris Aragiorgis

Remove hotplug from InstanceCreate

Signed-off-by: Dimitris Aragiorgis <>

1d74f135 10/09/2013 11:40 am Dimitris Aragiorgis

New style format for modifying a NIC

Signed-off-by: Dimitris Aragiorgis <>

457cc553 10/09/2013 11:40 am Christos Stavrakakis

cyclades: fix typo in snf-dispatcher

98a01362 10/09/2013 11:29 am Christos Stavrakakis

cyclades: Fix bug for externally reserved IPs

Skip check if there are no externally reserved IPs in the Ganeti
backend.

fc56ae0f 10/07/2013 02:50 pm Christos Stavrakakis

cyclades: Do not release externally reserved IPs

Do not automatically release an externally reserved IP if it is released
from a Ganeti backend. The IP should be released with snf-manage
network-modify management commands.

0ccb6461 10/07/2013 02:37 pm Christos Stavrakakis

cyclades: Refactor reconciliation of pools

Move reconciliation of IP pools from 'snf-manage reconcile-networks'
to 'snf-manage reconcile-pools'. Also change the way reconciliation
works: Instead of reconciling the IP pools in DB with the IP pools in
Ganeti, the new reconciliation just checks that:...

a52cc1b4 10/07/2013 02:37 pm Christos Stavrakakis

cyclades: Refactor code for renaming a server

Created function for renaming a server.

5d1f6b84 10/07/2013 12:48 pm Christos Stavrakakis

cyclades: Fix bug in backend_allocator

The 'disk_template' attribute for flavors of external disk template
included the name of the provider. The backend allocator tried to find a
backend with an enabled 'ext_$(provider)' disk template. This commit
fixes this by searching only for 'ext' in the enabled disk templates.

73756651 10/02/2013 04:05 pm Christos Stavrakakis

cyclades: Fix bug in update_cluster callback

Decorate 'update_cluster' callback with 'handle_message_delivery' to
handle acknowledgement of messages.

26515bc1 10/02/2013 04:05 pm Christos Stavrakakis

cyclades: Remove custom ProtectedDeletedManager

Remove custom ProtectedDeletedManager. Instead use the
ForeignKey.on_delete attribute that has been introduced in Django 1.4.

5feb9900 10/01/2013 09:16 pm Christos Stavrakakis

cyclades: Add missing queue

QUEUE_CLUSTER must be included in QUEUES.

a8ae6989 10/01/2013 08:27 pm Christos Stavrakakis

cyclades: Make disk_templates work with Ganeti<2.8

'enabled_disk_templates' cluster attribute has been added in Ganeti 2.8.
If this attribute is missing, return the ipolicy disk templates.

e4011adc 10/01/2013 08:06 pm Christos Stavrakakis

cyclades: Fix typo

36d450e8 10/01/2013 05:45 pm Christos Stavrakakis

cyclades: Callback for cluster modifications

Extend snf-dispatcher callbacks with one to run every time an
OP_CLUSTER_ opcode is executed in a Ganeti backend.

  • make snf-ganeti-eventd send messages on cluster modifications. These
    messages do not contain any description about the job....
1da50fe3 10/01/2013 11:37 am Christos Stavrakakis

cyclades: Refactor backend-update-status cmd

The command has been changed to no longer take any arguments or options.
Instead, this command always updates the resources and the enabled disk
templates of all online Ganeti backends.

f15bf3d9 10/01/2013 11:37 am Christos Stavrakakis

Allocate VMs based on enabled disk-templates

Remove the ARCHIPELAGO_BACKENDS setting. Instead allocate VMs based on
the disk-templates that are enabled and allowed in ipolicy for each
backend. The command 'snf-manage backend-update-status' can be used to...

b704b537 10/01/2013 11:37 am Christos Stavrakakis

cyclades: Display disk-templates in backend-list

e5e62972 09/27/2013 12:38 pm Giorgos Korfiatis

cyclades: Return the newest vm object upon creation

The server_command decorator commits the just created object and retrieves
it back from the database. Return the latter, because the former is stale
in memory.

88fd91af 09/20/2013 03:46 pm Christos Stavrakakis

cyclades: Fix wrong quotas when creating server

Catch exception when talking to Ganeti inside 'server_command',
otherwise the pending commission will be rejected. Also, accept the
commission in case of build, because the VM will be created in DB.

5c8076b6 09/20/2013 01:45 pm Christos Stavrakakis

cyclades: Helper function for commissioning

Create 'quotas.handle_resource_commission' function for handling
commissions for VMs and Networks.

9dcfad23 09/20/2013 01:45 pm Christos Stavrakakis

cyclades: Handle errors during vm creation

Commit #f2080d1 mocked an OP_INSTANCE_REMOVE when enqueuing an
OP_INSTANCE_CREATE job to Ganeti failed. However, this may result in
releasing IPs that may get reserved in Ganeti, because we can never
really know if the job has reached Ganeti or not (e.g. timeout). For...

562bf712 09/19/2013 07:50 pm Christos Stavrakakis

cyclades: refactor server creation command

Split the server creation command in more steps in order to be
decorated with the 'server_command' function and follow the logic of all
other server commands. The main change is that the commission job is not
accepted when the VM is stored in DB, but when the OP_INSTANCE_CREATE...

8e67ea28 09/18/2013 06:22 pm Christos Stavrakakis

cyclades: Apply old commits to moved files

Code from file 'api/servers.py' has been moved to 'logic/servers.py'.
During the merge of hotfix-0.14.6 the develop, this code was lost. This
commit applies commits #f2080d1, #ea9b0fb, #32a0b85 to the new file.

ed2064f8 09/18/2013 05:17 pm Christos Stavrakakis

Merge branch 'hotfix-0.14.6' into develop

Conflicts:
Changelog
docs/admin-guide.rst
snf-cyclades-app/synnefo/api/management/commands/network-remove.py
snf-cyclades-app/synnefo/api/servers.py
snf-cyclades-app/synnefo/api/tests/servers.py
snf-cyclades-app/synnefo/logic/backend.py...

b4135a1b 09/17/2013 10:46 am Christos Stavrakakis

cyclades: Make GanetiRapiClient work with gevent

GanetiRapiClient uses PyCurl, a Python interface to libcurl, and
performs blocking requests, so does not work well with gevent. This
commit makes GanetiRapiClient to use 'Requests' HTTP library that is
greenlet-safe.

25891abc 09/13/2013 04:37 pm Christos Stavrakakis

cyclades: Simplify code

Simplify code by removing unnecessary temp variable.

db3037f1 09/12/2013 06:29 pm Giorgos Korfiatis

cyclades: Do not release resources if already deleted

Ensure that a commission to release vm resources is issued only once.
If a vm is marked `deleted', then resources must have already been
released.

32a0b855 09/12/2013 06:29 pm Giorgos Korfiatis

cyclades: Do not save stale objects after a commit

Call to issue_and_accept_commission saves the resource object (eg a vm)
and commits the transaction. This has the side-effect that the resource
object becomes stale: its lock is released and another thread may acquire...

4111c53e 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: fix typos

90858bda 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: Update NICs even if job failed

Make snf-ganeti-eventd send the NICs of the instance not only on
success, but also if the job has failed or has been canceled. Also,
update snf-dispatcher to handle those messages. This step is required to
clear BUILDING NICs that fail.

c9fefba3 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: Store action to the VM

1464a17b 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: Fix bug in reconciliation

VMs at building error that do not exist in Ganeti must not be reported
as stale. The VM is stale only if the user has asked to destroy the VM,
and so the action is DESTROY.

2a2b01e5 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: Create NIC before send job to Ganeti

Create NICs in building state before enqueuing corresponding jobs to
Ganeti. This has already been done when creating the instance, but not
when connecting it to other networks.

198d91c3 09/06/2013 12:22 pm Christos Stavrakakis

cyclades: Fix bug in snf-dispatcher logic

This commit reverts commits #07602322 and #30514662 which introduced a
bug in dispatcher's logic. These commit fixed the issue that, in a case
the Cyclades DB is unsynced with Ganeti, a resource that does not exist...

bbae3e45 08/28/2013 01:55 pm Christos Stavrakakis

cyclades: Fix bug in handling of reboot type.

'type' attribute of reboot OS API call was directly mapped to the
'reboot_type' option of Ganeti reboot job. However these two are
semantically different. The 'SOFT' and 'HARD' reboot types of OS API are
mapped to 'shutdown_timeout' option of Ganeti jobs. However, setting...

6488097c 08/27/2013 11:25 am Christos Stavrakakis

cyclades: Do not pass 'hotplug' if disabled

Fix passing of hotplug argument to GanetiRAPIClient, in case the
GANETI_USE_HOTPLUG is unset. If the Ganeti version does not support
hotplug, passing hotplug=False, will make the jobs fail at Ganeti opcode
validation. This commit fixes this by passing the argument, only when...

9599e997 08/20/2013 03:41 pm Christos Stavrakakis

cyclades: Add check for net action with no hotplug

In case hotplug is disabled, via GANETI_USE_HOTPLUG setting, network
actions should be allowed only on STOPPED vms. This commit adds this
check and a unittest for this case. Also it makes some other checks...

231b0fb6 08/20/2013 08:40 am Christos Stavrakakis

cyclades: Fix check for firewall profile

27435d42 08/19/2013 11:25 am Christos Stavrakakis

cyclades: Remove firewall tag when removing NIC

Remove firewall tag from ganeti instance when disconnecting them from
networks. Until now, this was not needed because a vm could not be
disconnected from public networks. Since floating IPs, a vm may be
dynamically be connected and disconnected to public networks, and so a...

728e8923 08/07/2013 11:17 am Christos Stavrakakis

cyclades: Fix bug in servers tests

Import settings from django.conf instead of synnefo.

0c09b1c0 08/07/2013 11:08 am Christos Stavrakakis

cyclades: Import settings from django.conf

841c26cc 08/07/2013 11:08 am Georgios D. Tsoukalas

cyclades: init dispatcher with DJANGO_SETINGS_MODULE

160c81a1 08/06/2013 04:01 pm Christos Stavrakakis

cyclades: Fix typo

ce55f724 08/06/2013 03:58 pm Christos Stavrakakis

cyclades: Fix typo

d311e54f 08/06/2013 09:56 am Christos Stavrakakis

cyclades: Fix condition for network netmask size

108ef251 08/06/2013 08:40 am Christos Stavrakakis

cyclades: Check that IPv6 network netmask is /64

Check that IPv6 network netmask is /64, because this is imposed by the
'mac2eui64' utility that generates EUI-64 addresses from 48-bit MAC
addresses.

Refs #4201

a4658bbe 08/06/2013 08:40 am Christos Stavrakakis

cyclades: Move code for validating network values

Move code for network parameters validation from 'api' module to 'logic'.

d758784b 08/05/2013 02:39 pm Christos Stavrakakis

Fix stale import statements

Commit 7cfc0ce moved code from webproject to snf_django. This commit
fixes some stale imports that skipped renaming.

7cfc0cef 08/05/2013 12:45 pm Christos Stavrakakis

snf-django: Move ListCommand to snf-django

snf-webproject contained the generic ListCommand, and because of this it
had a dependency from snf-django-lib. This commit moves this command from
snf-webproject to snf-django-lib and removes this dependency. Also,...

9122ffab 07/25/2013 04:42 pm Christos Stavrakakis

cyclades: Add 'name' to all commissions.

Make all quotaholder commissions to have a name. Since, Cyclades does
not store the association of a commission with a resource, we include
the resource in the commission name.

671db71c 07/25/2013 01:31 pm Christos Stavrakakis

cyclades: Add network to multiple backends

Update snf-manage network-create command to take a list of comma
seperated backend IDs to create the network to.

cbf1a3f3 07/24/2013 09:15 pm Christos Stavrakakis

cyclades: Add check for link during network create

Add a check when creating IP_LESS_ROUTED networks, that the connectivity
link is not already used by another network.

b47f167a 07/24/2013 09:15 pm Christos Stavrakakis

cyclades: Fixes in network management commands

Merge code from logic/networks.py and network management commands.

b2791a77 07/24/2013 09:15 pm Christos Stavrakakis

cyclades: Set firewall profile per NIC

Set firewall profile per NIC, because since Floating IPs an instance can
have more than one NICs in a public network. Extend the API call to take
the NIC index as argument, and modify the Ganeti instance tags to be
formated with the NIC index.

70a0afab 07/24/2013 09:15 pm Christos Stavrakakis

cyclades-rapi: Add bulk option to GetJobs

63f9eb8e 07/24/2013 09:15 pm Christos Stavrakakis

cyclades: Reconciliation for pending vm tasks

Extend reconciliation mechanism, to detect instances with stale pending
tasks, by looking if the corresponding job, 'vm.task_job_id', is still
running in the Ganeti backend.

Also refactor code that performed reconciliation for buildign vms, to...

12cb6933 07/22/2013 04:53 pm Christos Stavrakakis

cyclades: Minor improvements in manage commands

6e9255ab 07/22/2013 04:53 pm Christos Stavrakakis

cyclades: Fix import of renamed settings

48f5b1bc 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: No commission for public networks

Do not issue commission for public networks, since they do not have an
owner.

8f2aa316 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Consider IPv6 only networks in allocator

Backend allocator excludes backends that do not have a free IPv4
address. Since, from now on, not all instances are connected to a public
network, this check is only needed when 'SNF:ANY_PUBIC' network is used.

b88c1549 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Implement NetworkReconciler class

Refactory network reconciliation. Implement NetworkReconciler class to
hold all reconciliation functions.

89b2b908 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Move NetworkReconciler to reconciliation

Move NetworkReconciler class from network-create command to
reconciliation module.

be4d8469 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Add tests for network reconciliation

8d325d4b 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Simple code refactoring

5aeb4e93 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Support IPv6 only networks

Make Cyclades support IPv6 only networks. Such networks will have
the 'subnet' attribute set to None, in the same way that IPv4 only
networks have the 'subnet6' attribute set to None.

Because currently Ganeti does not support IPv6 only networks, we create the...

5962d9a6 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Add tests for IPv6 only networks

Add tests to check creation and usage of IPv6 only networks. Tests also
cover creation of other type of networks.

c75ab92e 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Refactor code relative to networks

Move code checks from network-create management command to
logic/networks.py.

Also create common decorator for management commands to convert api
faults to command errors.

0208770b 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Refactor logic tests

Create tests module to hold all tests for logic.

890f3d4c 07/12/2013 01:22 pm Christos Stavrakakis

Merge branch 'hotfix-0.14.2' into develop

Conflicts:
Changelog
snf-astakos-app/astakos/im/messages.py
snf-astakos-app/astakos/im/views/target/__init__.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/logic/management/commands/reconcile-servers.py...

5d3e597a 07/09/2013 04:43 pm Christos Stavrakakis

cyclades: Fix reconciliation of building vms

When reconciling a building vm, you first have to reconciliation it's
creation and then it's operstate. Otherwise it is possible to end up
having wrong quotas.

07602322 07/08/2013 03:05 pm Christos Stavrakakis

cyclades: Fix corner case in snf-dispatcher

Same as commit 0514662, but for servers.

6193628f 07/08/2013 12:04 pm Christos Stavrakakis

cyclades: Fix typo bug in management command

527c7a7b 07/05/2013 04:52 pm Christos Stavrakakis

cyclades: Fix type error

Create network may return a list of job IDs.

f05a25af 07/05/2013 04:52 pm Christos Stavrakakis

cyclades: Fix wrong unit of ram

75dc539e 07/05/2013 04:13 pm Christos Stavrakakis

cyclades: Parallel server reconciliation

Major refactor to reconcile-servers management command to make it work
in parallel for each backend. Also, removed all --detect options, and
detect all incosistencies by default.

595bc9b0 07/05/2013 04:13 pm Christos Stavrakakis

cyclades: Add tests for server reconciliation

05146623 07/04/2013 11:24 am Christos Stavrakakis

cyclades: Fix corner case in snf-dispatcher

Delete network from DB when job fails but the action of network is
DESTROY. This case appears when someone tries to remove a network that
has been deleted from Ganeti backend, but not yet from DB.

8e440b3a 07/03/2013 06:32 pm Christos Stavrakakis

cyclades: Fix typo in reconciliation

9766a80e 07/03/2013 03:55 pm Christos Stavrakakis

reconciliation: Strip Ganeti IP addresses

Strip spaces from Ganeti IP addresses, since they are not automatically
ignored in newer versions of ipaddr.

82d23461 07/03/2013 02:43 pm Christos Stavrakakis

reconciliation: Get servers from DB ater ganeti

Change server reconciliation, to get the instances from DB after getting
instances from Ganeti, to decrease the possibility for races.

736b9244 07/02/2013 04:00 pm Christos Stavrakakis

cyclades: Fix exception message

Fix exception message when trying to connect an instance to a non-active
public network.

952b2a48 07/02/2013 03:00 pm Christos Stavrakakis

cyclades: Wrap diagnostic creation in transaction

Fix bug in snf-dispatcher causing wrong updates of VMs from ganeti.
Creation if instance diagnostics must run inside a transaction, because
otherwise, the lock of the vm (select_for_update) is released too early....

9446e7e5 07/02/2013 01:24 pm Christos Stavrakakis

cyclades: Rename "public" to "SNF:ANY_PUBLIC"

Rename reserved work for automatically choosing a public network from
"public" to "SNF:ANY_PUBLIC". Also add the setting description to conf
files.

660b9f3b 07/02/2013 12:32 pm Christos Stavrakakis

cyclades: Remove PUBLIC_USE_POOL setting

Remove PUBLIC_USE_POOL setting, since in order to use floating IPs, the
cyclades must be responsible for managing all IP pools.

0c50c760 07/02/2013 12:32 pm Christos Stavrakakis

cyclades: Check if a NIC is a floating IP.

Extend NetworkInterface model with a property showing if the IPv4
address of the NIC is a floating IP or not. Also, simplify some
relevant code.