Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / logic / backend.py @ 326c3ec8

History | View | Annotate | Download (36.5 kB)

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

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

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

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.

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.

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.

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.

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

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

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

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.

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

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

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.

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

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

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

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

cyclades: Fix corner case in snf-dispatcher

Same as commit 0514662, but for servers.

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

cyclades: Fix type error

Create network may return a list of job IDs.

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.

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

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.

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

cyclades: Various fixes regarding floating IPs

Fix some issues regarding floating ips introduced by rebasing branch.

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

cyclades: Add network policy at server create

Add 'DEFAULT_INSTANCE_NETWORKS' setting that can be used by the
administrator to define the list of networks that each server that is
created must be connected to. Each created VM will have a NIC connected
to each of these networks. This settings can include a list of network...

72dea98f 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Do not release floating IPs

Update 'release_instance_nics' backend function which is called to
process NIC modifications in the Ganeti backend, to not return a
IPv4 address back to pool if this address is a floating IP.

2c022086 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Support many NICs when creating vms

Support arbitraty number of NICs when creating Ganeti instances.

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

2cd3f389 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Add backend function for resizing vm

Add 'resize_instance' backend function for resizing a vm. This command
issues an OP_INSTANCE_MODIFY job with the specified beparams, which
currently are vcpus, minmem and maxmem.

Refs #3870

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

cyclades: Handle Ganeti msgs for resized VMs

Handle 'OP_INSTANCE_SET_PARAMS' notifications from Ganeti that have
'beparams' attribute, which corresponds to resized VMs. In such
case, the corresponding flavor is found an the VM in DB is updated to
have this flavor....

e77a29ab 06/28/2013 08:45 pm Christos Stavrakakis

cyclades: Fixes relative to reconciliation

Get available backends once and work only with them, since available
backends may change during reconciliation. Also temporary remove support
for communicating with each backend in a separate process.

b12ab2d0 06/25/2013 03:23 pm Christos Stavrakakis

Revert "cyclades: Speed up reconciliation"

This reverts commit cf2241c45a22dac71e31dbf32f4700c475804c12.

cf2241c4 06/25/2013 11:36 am Christos Stavrakakis

cyclades: Speed up reconciliation

Speed up reconciliation by using mulitprocessing to get in parallel
the instances from all Ganeti backends.

79f65825 06/21/2013 01:40 pm Christos Stavrakakis

cyclades: Handle errors when using multiprocessing

Check the process exitcode to determine if a process finished
successfully.

d986cb32 06/21/2013 12:54 pm Christos Stavrakakis

cyclades: Speed up reconciliation

Speed up reconciliation by using mulitprocessing to get in parallel
the instances from all Ganeti backends.

40d53b77 06/19/2013 11:07 am Christos Stavrakakis

cyclades: Fix deadlock when creating servers

Fix deadlock between snf-dispatcher and backend allocator, by making
snf-dispatcher take an exclusive lock to the backend which hosts the vm,
before trying to get the exclusive locks to the IP pools in order to...

b2222a7f 06/13/2013 05:10 pm Christos Stavrakakis

cyclades: Pass disk origin for all 'ext' flavors

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....
fd95834e 05/14/2013 01:25 pm Christos Stavrakakis

dispatcher: Handle NICs in callbacks.

Update 'update_db' callback to handle instance NICs together with
instance status.

Also update the relevant tests.

be4d8aed 05/14/2013 01:25 pm Christos Stavrakakis

cyclades: simplify comparison of NICs

acfc71ef 05/14/2013 01:25 pm Christos Stavrakakis

cyclades: Fix deadlock when connecting vms

Fix deadlock caused by 'get_or_create' method, since it acquires an
implicit shared lock. Take an exclusive lock on network to fix this
deadlock.

27cda06b 05/14/2013 01:24 pm Christos Stavrakakis

cyclades: Fixes relevant to lazy networks

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

2509ce17 04/30/2013 05:05 pm Christos Stavrakakis

cyclades: refactor code relative to commission

Refactor Cyclades code that handles commissioning with Quotaholder. This
commit removes the 'uses_commission' decorator. Instead it introduces
the 'issue_and_accept_commission' function that is responsible for...

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

8528b8ac 02/14/2013 11:03 am Christos Stavrakakis

Totally remove password from create_instance

Never pass password as an 'osparam' to Ganeti. Always use the vmapi,
even for VMs created with server-create management command.

cc92b70f 02/06/2013 02:18 pm Christos Stavrakakis

Fix pep8 warnings

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

5480daec 12/20/2012 05:22 pm Christos Stavrakakis

Remove dummy function

e6f6627c 12/14/2012 06:22 pm Christos Stavrakakis

Misc minor bug fixes

f45a7ac4 12/12/2012 02:05 pm Christos Stavrakakis

Fix variable scope bug in process_net_status

c414bc87 12/10/2012 04:14 pm Christos Stavrakakis

Add backend-id option to reconcile-servers

Make reconcile-servers perform reconciliation only for the specified
backend.

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

006c6249 11/30/2012 12:49 pm Christos Stavrakakis

Fix typos

2a599282 11/30/2012 12:20 pm Christos Stavrakakis

Merge handling of ext_<provider> disk templates

33050118 11/29/2012 03:55 pm Georgios D. Tsoukalas

Merge branch 'origin/devel-0.13' into quota

Conflicts:
snf-cyclades-app/synnefo/api/servers.py

cb4eee84 11/26/2012 12:40 pm Christos Stavrakakis

Issue commission when deleting VM/Network

Issue commission to the Quotaholder when being notified from the Ganeti
backend that a VM/Network has been deleted. Although the resource has
already been deleting, we are interacting with the quotaholder in a
two step phase: issue commission and accept commission. It would be...

10de1102 11/26/2012 12:40 pm Christos Stavrakakis

Remove transaction from update_network_state

Remove transaction decorator from update_network_state function, since
this function is only called from process_network_status, which already runs
inside a transaction.

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.

d7841399 11/23/2012 03:13 pm Christos Stavrakakis

Remove IGNORE_FLAVOR_DISK_SIZES setting

79b7dbb7 11/23/2012 01:50 pm Christos Stavrakakis

Use vmapi when creating servers

Use the vmapi when creating servers. Creete instance RAPI call takes the
configuration url instead all the image parametere. The id and format
of the image are still passed, just for readability and debugging.

Also renamed params_url to config-url.

b578d9e7 11/22/2012 01:26 pm Christos Stavrakakis

snf-dispatcher: Update NICs only when needed

Do not remove and recreate the NICs of a VM when NICs have not changed.

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.

fd2bdbb2 11/07/2012 11:04 am Christos Stavrakakis

Process OP_NETWORK_SET_PARAMS Ganeti jobs

Modify snf-ganeti-eventd and snf-dispatcher to handle jobs with
OP_NETWORK_SET_PARAMS opcode. Handling of these jobs is needed
to update the IP Pool of network, when reserving and releasing
IPs directly from the Ganeti backend.

2d762302 11/06/2012 12:57 pm Dimitris Aragiorgis

Minor backend fixes in networks

Add conflicts_check option when creating and add network. Check only
if a network is public.

Let tags argument in rapi calls be a list.

Signed-off-by: Dimitris Aragiorgis <>

e221ade2 11/01/2012 01:24 pm Christos Stavrakakis

Do not allow any API action on suspended VMs

Do not allow any modification of any administratively suspended VM through the
API.

1e2cc762 10/29/2012 02:28 pm Kostas Papadimitriou

Merge remote-tracking branch 'origin/devel-0.12' into ui-0.11

eeffcbea 10/23/2012 04:28 pm Kostas Papadimitriou

Merge branch 'devel-0.12' into ui-0.11

40ef487d 10/23/2012 03:50 pm Christos Stavrakakis

Fix bug, UI not updating NICs

Dummy-save the Network when processing messages from Ganeti hooks
about a VM NICs. This is needed, because the UI uses the HTTP changes-sinces
when requesting VMs and Networks, and combines the result in order to show
the new NICs. Not updating the Network object, resulted in VMs IPv4...

87920bc3 10/16/2012 08:50 pm Christos Stavrakakis

Do not give IPs to networks without dhcp

122c4019 10/15/2012 12:56 pm Christos Stavrakakis

Fix bug in reconcile-networks

Fix bug when connecting a network to a nodegroup in network
reconciliation. Use connect_network instead of obsolete
connect_network_group method. Also fix job dependency handling in this
method.

e97288bc 10/15/2012 12:55 pm Christos Stavrakakis

Refactor process op and network status callbacks

e60b4630 10/10/2012 01:36 pm Christos Stavrakakis

Fix bug when synchronously creating networks

fa454545 10/10/2012 01:05 pm Christos Stavrakakis

Release address only if a NIC has an IP

b16db49b 10/09/2012 04:27 pm Kostas Papadimitriou

Merge branch 'devel-0.11' into ui-0.11

Conflicts:
snf-cyclades-app/synnefo/db/models.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/ui/static/snf/js/models.js

6cc3a31c 10/04/2012 03:23 pm Christos Stavrakakis

Add missing ipv6 arguments to create_network