Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / db @ ab6d1a2f

# Date Author Comment
b3a43976 10/11/2013 02:40 pm Christos Stavrakakis

cyclades: Optimize DB queries of /servers API

Use 'prefetch_related' attribute of Django queryset to prefetch the
NetworkInterface and IPaddress objects that are related with a
VirtualMachine object. Also, modify functions that operate on server
NICs and IPs, to to use only the prefetched objects, which means that...

8c7c9813 10/10/2013 04:59 pm Christos Stavrakakis

cyclades: Fix DB tests

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.

593851e0 10/10/2013 12:40 pm Build Bot

cyclades: Add /ports api call

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.

b4695420 10/09/2013 08:00 pm Christos Stavrakakis

cyclades: Make IPPool manager work for subnets

Temporary commit to make IPPool manager work. This will work only if
there is only one allocation pool for each subnet.

74d936dc 10/09/2013 07:59 pm Christos Stavrakakis

cyclades: Change 'null' attribute of Subnet models

2f1b4cbc 10/09/2013 07:38 pm Christos Stavrakakis

cyclades: Add missing migration file

cddc2b2f 10/09/2013 07:36 pm Dionysis Grigoropoulos

cyclades: Use a constant for name length of models

Use a constant for declaring the max length of the name of a
model

0247388f 10/09/2013 07:34 pm Christos Stavrakakis

cyclades: Update models_factory

Update models factory to match the new models.

Signed-off-by: Marios Kogias <>
Signed-off-by: Dionysis Grigoropoulos <>

06ffd11f 10/09/2013 07:33 pm Christos Stavrakakis

cyclades: Remove unused fields and model from DB

Remove unused 'ipv4' and 'ipv6' attributes from NetworkInterface model
and totally remove FloatingIP model. This information has been moved
in commit 972a428 to IPAddress model.

d484f6df 10/09/2013 07:33 pm Christos Stavrakakis

cyclades: Data migration from NIC to IPAddress

Migrate db data from NetworkInterface model to IPAddress model.

bdd0f1a6 10/09/2013 07:33 pm Christos Stavrakakis

cyclades: Major refactor on NIC model

Major refactor on db models concerning NetworkInterface models. A new
table, namely 'IPAddress' has been created to represent an IPAddress
(IPv4 or IPv6). Each IPAddress is related with a network and the subnet
from which it has been allocated. Also it contains 'floating_ip' attribute...

7b72b50d 10/09/2013 07:31 pm Christos Stavrakakis

cyclades: Remove unused fields from Network model

Remove unused fields from Network: subnet, subnet6, gateway, gateway6,
dhcp and pool. The following attributes have been moved to Subnet model
in commit 779c887. Also extend model with the 'external_router'...

4e3a6674 10/09/2013 07:31 pm Christos Stavrakakis

cyclades: Add new Subnet model

Add Subnet model containing Layer-3 characteristics for networks. Also,
extend IPPoolTable object to hold a reference to the Subnet that the
pool belongs to.

Signed-off-by: Dionysis Grigoropoulos <>

d8989b47 10/09/2013 07:31 pm Christos Stavrakakis

cyclades: Add DB data migration for subnets

Migrate attributes from old Network model to new Subnet model.

258d1f78 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Do not delete FIPs if VM is deleted

Remove on delete CASCADE for floating IPs if the VirtualMachine is
deleted.

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.

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

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

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

cyclades: Make (network, ipv4) unique for each NIC

Add a unique constraint to NetworkInterface model. This constraint
asserts that the same IPv4 address from the same network will no be
assigned to more than one NICs.

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

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

cyclades: Fix str representation for pool objects

7da2d1bd 10/03/2013 02:45 pm Christos Stavrakakis

cyclades: Add missing migration for commit 3bb0b11

3bb0b117 10/02/2013 04:27 pm Christos Stavrakakis

cyclades: Add 'on_delete' to all ForeignKeys

Add 'on_delete' argument to all ForeignKeys. The value of this
argument depends on the type of each relation.

2c21381e 10/02/2013 04:05 pm Christos Stavrakakis

cyclades: Remove custom ForUpdateManager

Remove custom manager that implemented select_for_update(), since this
is already implemented in Django 1.4.

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.

c3362463 10/01/2013 07:44 pm Christos Stavrakakis

cyclades: Fix bug in custom field

Rename get_db_prep_value to get_prep_value. In django 1.4 the second one
is just a wrapper for the first one.

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

cyclades: Extend Backend model with disk_templates

Extend 'Backend' models with 'disk_template' attribute, that contains
the list of disk templates that are available in each backend.

54975d37 10/01/2013 11:31 am Christos Stavrakakis

cyclades: Add SeparatedValuesList field

Add custom field for storing a list of values in DB. The values
are stored as a TextField separated by a delimiter.

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

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

051e47f8 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: Make index field of NIC optional

Change 'index' field of NIC model to be optional, because the index of
building NICs is unknown. Also, change all API responses to return only
the active NICs.

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

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

cyclades: Import settings from django.conf

0989632e 07/25/2013 04:42 pm Christos Stavrakakis

cyclades: More verbose models representation

Make unicode method of VirtualMachine, Network and FloatingIP models more
verbose.

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

cyclades: Remove wrong model attribute

410d2877 07/22/2013 05:58 pm Christos Stavrakakis

cyclades: Add migration file for IPv6 networks

0129231a 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Fix exception message

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

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

b2d0830b 07/10/2013 10:55 am Christos Stavrakakis

cyclades: pep8 fixes

46e8886e 07/08/2013 12:02 pm Christos Stavrakakis

cyclades: Add disk template to flavors fixture

259459b0 07/02/2013 04:01 pm Christos Stavrakakis

cyclades: Add migration file

Add migration file for floating IPs and VM task state.

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.

9115d567 07/02/2013 12:31 pm Christos Stavrakakis

Distinquish between networks and Floating IP pools

Extend Network model with the 'floating_ip_pool' boolean field, to
indicate whether a Network can be a floating IP pool or not. Networks
that are floating IP pools must exist in all Backends, and so
'snf-manage backend-add' should try to add them....

ece5581b 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Separate logic for networks from API

Remove code handling networks from network API views to logic.networks

bc343480 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Make NIC representation more verbose

a3d99af0 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Reserve a specific floating IP

Add extra optional 'address' attribute, in POST /os-floating-ips/
request, to allow a user to reserve a specific floating IP. This request
will fail if the user tries to allocate an IP address that is used by
anothers user VM (it will succeed if they address is already used by...

c2876228 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Add FloatingIP model

Add Floating IP model to represent a floating IP that has been reserved
by a user. Each FloatingIP has an owner(UUID), an IPv4 address, the
network(pool) that has reserved from and the date is was reserved. Also,
it may be related to a VirtualMachine, if there is some VM that uses...

9ba6bb95 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Extend /servers with floating IP actions

Extend '/servers/action' API endpoint, to support 'addFloatingIP'
and 'removeFloatingIP' actions.

1cfd5d4d 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Remove custom init method from VM model

41a7fae7 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Major refactor to api and logic apps

Major refactor to cyclades api and logic apps that removes most code
from the api views and moves it to logic app, so that the same logic
code can be used by different apps (e.g. EC2 API). Code is moved into...

1af851fd 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Implement resize action API call

Implement resize API call, which is a POST at
/servers/<server_id>/action' with body: {"resize": {"flavorRef": <flavor_id>}}

The resize can only be performed if the disk size and disk template of
the new flavor are the same with the old one, and if the VM is in...

df36a125 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Make flavor representation more verbose

c802789d 06/13/2013 06:40 pm Christos Stavrakakis

cyclades: Remove obsolete settings

Remove obsolete GANETI_DISK_TEMPLATES and DEFAULT_GANETI_DISK_TEMPLATE
settings.

d4325f42 06/11/2013 04:38 pm Christos Stavrakakis

Fix compatibility issues with factory_boy

Update models_factory to use factory.DjangoModelFactory instead of
factory.Factory.

6dafedf6 05/31/2013 05:12 pm Christos Stavrakakis

cyclades: Add 'drained' flag to Network

Extend Network model with the 'drained' attribute, to indicate whether a
network should be used in public IP allocation when creating servers.
This option is only useful for public networks.

4c9ac139 05/21/2013 02:09 pm Christos Stavrakakis

cyclades: Add --hypervisor option to backend cmds

Add '--hypervisor' option to 'backend-add' and 'backend-modify'
management commands.

Refs #3772

bd87213f 05/21/2013 02:07 pm Christos Stavrakakis

cyclades: Sypport backends with Xen hypervisor

Support Ganeti backends with Xen hypervisor:
  • Extend 'Backend' model with the 'hypervisor' attribute, which
    currently can be 'kvm' or 'xen'. Use 'kvm' as default value to
    easy database migration. Also add the corresponding schema migration....
e4ce2d35 05/15/2013 06:35 pm Christos Stavrakakis

cyclades: fix db migration

Migration 0066 should not run on a fresh installation.

3dbd9457 05/15/2013 05:05 pm Christos Stavrakakis

cyclades: Make cyclades work with pycrypto==2.6

In PyCrypto 2.6, it is mandatory to use an IV of 16 bytes when using AES
encryption. This commit updates 'aes_encrypt' module to use a random IV.
Also, a data migration is required to re-encrypt the old passwords, as...

99af08a4 05/13/2013 12:38 pm Christos Stavrakakis

cyclades: Implement lazy networks

Implement "lazy networks", which are not created to all Ganeti backends
upon creation, but only when an instance that resides in a Ganeti is
connected to that network.

Update 'create_network' to create the Network object in DB without...

97fffe10 04/30/2013 05:05 pm Christos Stavrakakis

Refactor QuotaHolder serial model

  • Merge 'accepted' and 'rejected' field to 'accept' field.
  • Add 'resolved' field, indicating whether this commission has been
    accepted/rejected to Quotaholder
  • Remove custom save() method. Handle 'pending' field manually....
05d401cf 04/08/2013 11:06 am Christos Stavrakakis

Remove VM/Network DeletedError and BuildingError

Handle these errors explicitly in the code instead of the "api_method"
decorator.

bd40abfa 04/08/2013 11:06 am Christos Stavrakakis

Move cloud faults to 'snf_django.lib.api.faults'

Gather all faults from all synnefo projects into common
'snf_django.lib.api.faults'.

d552dddd 04/02/2013 01:49 pm Christos Stavrakakis

Simple tests for synnefo.quotas

ef54eee4 03/22/2013 02:19 pm Christos Stavrakakis

Fix NIC's default state

Use "ACTIVE" as NIC's default state, to avoid addding a data migration.

939d71dd 03/21/2013 05:05 pm Christos Stavrakakis

Create public NIC when creating VM

Until now, a server's public NetworkInterface was not created in the DB
until the arrival of the message from Ganeti hooks. However, the IPv4
address of the NIC is reserved before sending the OP_INSTANCE_CREATE
job to Ganeti....

e18c1749 03/08/2013 04:22 pm Christos Stavrakakis

Bypass commissioning for orphan networks

Cyclades public networks do not have an owner, and since can not use
the commissioning system. Also, make snf-dispatcher instead of failing
for networks without userid to just a log a warning. This does not apply for...

bb8fb9af 02/15/2013 05:14 pm Christos Stavrakakis

Fix BridgePoolTable testcase

dbecf586 02/14/2013 01:38 pm Christos Stavrakakis

Fix whitespace, Licence

1c11bace 02/14/2013 01:25 pm Christos Stavrakakis

Re-implement select_for_update

Previous implementation of 'select_for_update' method was based on an
attribute of the 'ForUpdateManager'. However, the model manager is shared
between all threads, which lead to race conditions. This commit
reimplements 'select_for_update', by making it return a custom QuerySet...

3bdfc1be 02/14/2013 10:50 am Christos Stavrakakis

Fix bug in PoolTable

Catch correct exception

00f67cf6 02/12/2013 05:03 pm Kostas Papadimitriou

Remove unused module

68b952f9 02/01/2013 04:52 pm Christos Stavrakakis

pep8 fixes

b65a3b04 02/01/2013 03:26 pm Christos Stavrakakis

Add disk_template to Flavor name

3f77e63d 01/07/2013 12:22 pm Christos Stavrakakis

Merge branch 'master' into devel-0.13

Conflicts:
snf-cyclades-app/synnefo/db/models.py
snf-cyclades-app/synnefo/logic/management/commands/backend-modify.py

0816cd46 01/04/2013 11:38 am Christos Stavrakakis

Fix bug about networks and offline backends

Ignore offline backends when computing the state of the network, since
no notification will be received from them. Also, create no
BackendNetwork for an offline backend. This will be created by
reconcilliation, when the backend gets online again.

b66e4833 12/20/2012 05:29 pm Christos Stavrakakis

Add more tests for db, logic and api

fcf2479a 12/20/2012 05:22 pm Christos Stavrakakis

Fix wrong count of reserved pool entries

Padding should not be considered when counting unavailable entries.

ce9abd26 12/19/2012 05:32 pm Christos Stavrakakis

Fix bugs in models methods

c8908e51 12/19/2012 05:32 pm Christos Stavrakakis

Add more tests for db and logic

672db045 12/14/2012 06:22 pm Christos Stavrakakis

Add object factories for most db models

Use 'factory_boy' library for creating Django ORM objects as test data.
These factories can be used as fixtures replacement since they are
easier to write and maintain.

35e2f2d4 12/14/2012 06:22 pm Christos Stavrakakis

Include Pool tests to Django testsuite

47eeffa9 12/14/2012 06:22 pm Christos Stavrakakis

Fix current db, logic and api tests

21c9042c 12/12/2012 11:12 am Christos Stavrakakis

Do not allow creation of more than one pools

Do not allow creation of more than one Bridge or MacPrefix pool, since
we can not handle them yet.

b7d38981 12/04/2012 04:51 pm Dimitris Aragiorgis

Introduce network flavors to replace network types

Add tags and mode to network db model. Replace existing type with
flavor. Introduce 4 different flavors. Each flavor has mode, link,
mac_prefix, tags. Supported flavors are CUSTOM, IP_LESS_ROUTED,
MAC_FILTERED, PHYSICAL_VLAN and are hardcoded in db models....

1ef9dac4 12/04/2012 04:51 pm Dimitris Aragiorgis

Migration files for network types

e3187d7a 11/27/2012 04:13 pm Christos Stavrakakis

Fix bugs from merging

b8b676a1 11/26/2012 05:58 pm Christos Stavrakakis

Add migration file for quotaholderserial

048fab1e 11/26/2012 12:32 pm Christos Stavrakakis

Reorder code

3416e629 11/26/2012 12:32 pm Christos Stavrakakis

Create QuotaHolderSerial table

004967e4 11/26/2012 12:32 pm Christos Stavrakakis

Add QuotaHolderSerial column to VM and Network

Correlate the VirtualMachine and Network models with a QuotaHolderSerial
entry, holding the serial number returned by the QuotaHolder for the
last allocation for these resources.

4d5d0b9c 11/26/2012 12:31 pm Christos Stavrakakis

Do not automatically update network state

Each modification in a BackendNetwork object, triggers an update
to the corresponding Network object. Until now this was done by
the BackendNetwork save() method. Now it is explicitly done
from the backend pross_network_status.

3e7c63f8 11/22/2012 01:26 pm Christos Stavrakakis

Implement resizing of pools

Extend PoolManager to support extending and shrinking of Pools. Also
add extra option '--size' to pool-modify command.

190d155f 11/09/2012 03:51 pm Christos Stavrakakis

Add indexes to VirtualMachine and Network

Add indexes to VirtualMachine userid and deleted columns
Add indexes to Network userid, deleted and public columns

7f2dbcad 11/07/2012 12:52 pm Christos Stavrakakis

Use select_for_update for VirtualMachines

Use select_for_update method when accessing VM objects to prevent
race conditions. Also move start_action from logic to api.

82c1c610 11/05/2012 02:02 pm Christos Stavrakakis

Delete BackendNetworks when deleting a Backend

038d6772 10/30/2012 01:00 pm Christos Stavrakakis

Merge branch 'ui-0.11' into devel-0.12