Statistics
| Branch: | Tag: | Revision:

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

# Date Author Comment
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

6b8dc47c 10/30/2013 06:27 pm Christos Stavrakakis

cyclades: Common code for creating ports

Merge code for creating ports that was duplicated between
'logic.servers' and 'logic.ports' modules.

b7311f3d 10/30/2013 04:56 pm Dionysis Grigoropoulos

cyclades: Various refactors in subnets

  • Remove unused functions and imports from logic/subnets.py
  • Remove --network-id option from snf-manage subnet-modify and make
    it an argument
  • Fix --ip-version, --dhcp and --gateway options in snf-manage
    subnet-create...
b48697f0 10/30/2013 02:26 pm Christos Stavrakakis

cyclades: Fix stale references to moved function

96feddae 10/30/2013 12:56 pm Christos Stavrakakis

cyclades: Update state of NICs if VM creation fail

Set the state of NICs(ports) to ERROR if the OP_INSTANCE_CREATE job
fails.

3a6be177 10/30/2013 12:51 pm Christos Stavrakakis

cyclades: Rename Port state from BUILDING to BUILD

Neutron API defines the 'BUILD' status. This commit renames BUILDING
state of NIC to BUILD.
d5a4a8d1 10/30/2013 12:36 pm Christos Stavrakakis

cyclades: Common module for pretty-printing

Create common module for pretty-printing database objects. Currently it
contains only functions for pretty-printing networks and ports.

3b2984dc 10/30/2013 12:40 am Christos Stavrakakis

cyclades: Make tests work with multiple IP pools

Refactor tests so that they are aware that a network can have multiple
IP pools. Also, add extra check to PoolManager methods in order to check
whether a value is contained in the pool.

f82dfec6 10/29/2013 07:38 pm Christos Stavrakakis

cyclades: Various fixes to networks/subnets/pools

  • Fix IP pools of subnets to take into account the 'offset' when searching
    if a pool contains an IP address and when converting from value to index
    and from index to value.
  • Fix the way subnets are created from 'logic/networks'...
0e0a6ef9 10/29/2013 07:38 pm Christos Stavrakakis

cyclades: Fix reconciliation for network and pools

Fix reconciliation to work with multiple IP pools per network:
  • Fix reconcile-networks command to check if a reserved_ip in a Ganeti
    network is reserved in the pool that contains this IP (if any)
  • Fix reconcile-pools to reconcile each of the networks IP pools and...
99718617 10/29/2013 04:03 pm Dionysis Grigoropoulos

cyclades: Small bug fixes in logic/subnets.py

316787ab 10/29/2013 04:03 pm Dionysis Grigoropoulos

cyclades: Update docstrings, remove old functions

  • Update docstrings in api/subnets.py and logic/subnets.py
  • Remove duplicate and unused functions from logic/subnets.py
8646e606 10/29/2013 04:03 pm Dionysis Grigoropoulos

cyclades: Fix some bugs in subnets

  • Fix a bug, where a user could change the name of a subnet without
    being the owner of said subnet.
  • Fix two bugs in snf-manage subnet-create. Fix no-dhcp option and a
    potential crash if the user specified an invalid IP version type....
014df29c 10/29/2013 03:40 pm Christos Stavrakakis

cyclades: Remove stale references to vm.router

a859190b 10/29/2013 02:57 pm Christos Stavrakakis

cyclades: Fix output of network-inspect command

437e1eee 10/29/2013 02:42 pm Christos Stavrakakis

cyclades: Create network in backend if missing

Automatically create a network in a Ganeti backend if missing.
Currently, this was done only for private networks. This commit changes
this to be done for any kind of networks.

3d63d954 10/29/2013 02:22 pm Christos Stavrakakis

cyclades: Set external_router for public networks

Set 'external_router' attribute of created networks to True, if a
network is a public network.

79f4eec0 10/25/2013 03:41 pm Christos Stavrakakis

cyclades: Use existing IP when creating port

Extend port creation with the option to use an existing IPAddress. This
will be used to create a port with an existing Floating IP. Also, extend
port-creata management command with the '--floating-ip' option.

6d5c0344 10/25/2013 03:03 pm Christos Stavrakakis

cyclades: Fixes to port-create command

Verbal and code-style fixes to port-create command.

54f13218 10/25/2013 02:30 pm Christos Stavrakakis

cyclades: PEP8 fix

666b9edc 10/25/2013 12:35 am Marios Kogias

cyclades: Fix snf-manage floating-ip-list

A minor fix to the snf-manage floating-ip-list command to comply
to the new models

d9c36253 10/25/2013 12:35 am Marios Kogias

cyclades: snf-manage floating-ip-attach

snf-manage floating-ip-attach <address> --machine <server_id/router_id>

5d83d2ff 10/24/2013 04:49 pm Dionysis Grigoropoulos

cyclades: Bug fixes in subnets

9eb0710b 10/24/2013 12:36 pm Dionysis Grigoropoulos

cyclades: move subnets.py from api to logic

Move api/subnets.py to logic/subnets.py, for further code refactoring

4ac628d3 10/18/2013 04:16 pm Christos Stavrakakis

cyclades: Fix network inspect management command

86961519 10/18/2013 03:44 pm Christos Stavrakakis

cyclades: Add backend code to Ports API/logic

Add backend code to create and remove ports from Ganeti backends. Also
add some imporovements and fixes to logic, API code and management
commands.

fe3b2809 10/18/2013 02:50 pm Christos Stavrakakis

cyclades: Fix bug when creating networks

0069a20c 10/16/2013 11:19 am Marios Kogias

cyclades: Add snf-manage port-remove command

f16aa9e6 10/15/2013 01:20 am Marios Kogias

cyclades: Add logic ports.py

Created a new file for ports in logic directory. This will have
the code about port manipulation in the backend. For now it is just
used for db filling.
Use the new function 'create' in the ports API.

3278725f 10/14/2013 05:56 pm Christos Stavrakakis

cyclades: Refactor backend code for new networks

  • Optimize DB queries by using prefetch related for NIC IPs.
  • Do not try to construct new NIC if it does not exist in Cyclades DB.
  • Update tests
94b7399e 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Create IPv4 pool when creating network

Create IPv4 address pool when creating the network. This is a temporary
commit to make logic network work, since subnet and pool creation must
be moved out of the network creation part.

08e6fe1b 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Add method to get ip stats to network

Extend Network model with a method to get the number of free and total
IPv4 addresses of the network. Also, add method to IPAddress model to
release its IPv4 address if any. Finally, update backend-list management...

710b1c43 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Refactor code for allocating IPs

Refactor code that was used for allocating IP addresses and creating
NetworkInterfaces. The new code is more suitable to the new DB schema
where each network may have many IPv4 subnets and each subnet may
have many IP pools. Also, the new functions are using prefetch related...

a96e84cf 10/10/2013 08:08 pm Christos Stavrakakis

cyclades: Fix code for networks logic and API

8764d304 10/10/2013 04:35 pm Christos Stavrakakis

cyclades: Make logic tests pass

Refactor Cyclades code so that it follows the new models for Networks,
Subnets and IPAddresses. This refactor is not complete. Instead is the
necessary refactor for making tests for server API calls succeed.

92d2d1ce 10/10/2013 01:56 am Christos Stavrakakis

cyclades: Make API server tests pass

Refactor Cyclades code so that it follows the new models for Networks,
Subnets and IPAddresses. This refactor is not complete. Instead is the
necessary refactor for making tests for server API calls succeed.

326c3ec8 10/09/2013 07:36 pm Christos Stavrakakis

cyclades: Replace FloatingIP with IPAddress

This commit just replaces all references to FloatingIP objects with
references to IPAddress object, in order to be able to just load the
code. But the code is left unchanged, so all tests will fail.

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.

121b8921 10/09/2013 11:40 am 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.

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