cyclades: Fix code for networks logic and API
cyclades: Fix quotas tests
cyclades: Update api/subnets.py and tests
Commit 4e3a667 introduced a new model for Subnets, this commit containsthe following changes:
cyclades: Fix helpdesk code and tests for new nets
cyclades: Fix DB tests
cyclades: Fix indentation, PEP8 and wrong imports
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 thenecessary refactor for making tests for server API calls succeed.
Integrate /networks API call
cyclades: Add /ports api call
cyclades: Make API server tests pass
cyclades: Make IPPool manager work for subnets
Temporary commit to make IPPool manager work. This will work only ifthere is only one allocation pool for each subnet.
cyclades: Change 'null' attribute of Subnet models
cyclades: Add missing migration file
cyclades: Add api/subnets.py
cyclades: Use a constant for name length of models
Use a constant for declaring the max length of the name of amodel
cyclades: Replace FloatingIP with IPAddress
This commit just replaces all references to FloatingIP objects withreferences to IPAddress object, in order to be able to just load thecode. But the code is left unchanged, so all tests will fail.
cyclades: Update models_factory
Update models factory to match the new models.
Signed-off-by: Marios Kogias <marioskogias@grnet.gr>Signed-off-by: Dionysis Grigoropoulos <dgrig@grnet.gr>
cyclades: Remove unused fields and model from DB
Remove unused 'ipv4' and 'ipv6' attributes from NetworkInterface modeland totally remove FloatingIP model. This information has been movedin commit 972a428 to IPAddress model.
cyclades: Data migration from NIC to IPAddress
Migrate db data from NetworkInterface model to IPAddress model.
cyclades: Major refactor on NIC model
Major refactor on db models concerning NetworkInterface models. A newtable, namely 'IPAddress' has been created to represent an IPAddress(IPv4 or IPv6). Each IPAddress is related with a network and the subnetfrom which it has been allocated. Also it contains 'floating_ip' attribute...
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 modelin commit 779c887. Also extend model with the 'external_router'...
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 thepool belongs to.
Signed-off-by: Dionysis Grigoropoulos <dgrig@grnet.gr>
cyclades: Add DB data migration for subnets
Migrate attributes from old Network model to new Subnet model.
cyclades: Do not delete FIPs if VM is deleted
Remove on delete CASCADE for floating IPs if the VirtualMachine isdeleted.
cyclades: Include 'index' when comparing NICs
cyclades: Clear FloatingIP when deleting NIC
Override 'delete' method of NetworkInterface model, to clear the'machine' flag of the corresponding NIC, if any.
cyclades: Ignore Ganeti NICs with unknown ID
Do not process Ganeti NICs that do not have a valid ID and so areunknown to Cyclades, because processing these NICs would require tocreate them in DB and then rename them in Ganeti with the correspondingidentifier....
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.
cyclades: Change format of 'attachment' attribute
Change the format of the 'attachment' attribute. Until now, eachattachment had an identifier of the form 'nic-$vm_id-$nic_id'. Thiscommit changes the identifier to just '$nic_id', since from now onis unique for the lifetime of a NIC.
cyclades: Fix case where 'dfree' is None
If Ganeti has not enabled 'plain' or 'drbd' disk template, then itreports 'dfree' as None. Fix this corner case by treating None as 0.
cyclades: Add 'ip_type' attribute to NIC
Extend NetworkInterface model with the 'ip_type' attribute to showwhether the IP is a floating or fixed.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
cyclades: Use UUIDs to update VM NICs
Callback functions of snf-dispatcher updated the NICs of a VM bydeleting all NICs from DB, and creating the new NICs that were describedin the message. However, since NICs have UUIDs, this is no longerrequired. This commit update callbacks to update the NICs based on their...
gtools: Make eventd send job fields
Make snf-ganeti-eventd send 'job_fields' for instance and networkopcodes, and modify the corresponding backend functions andsnf-dispatcher callbacks.
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'.
cyclades: Make reconciliation timeouts constants
Remove hard-coded timeouts from code and make them constants. Also donot perform reconciliation for recent building NICs.
cyclades: Use NIC uuid when deleting NIC
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 commitupdates Synnefo to refer to devices by their name. Synnefo will set thename of the devices which will be a UUID. We do not use Ganeti's UUIDs...
Fix compatibility issues with ganeti-2.7
Use opportunistic locking
Use opportunistic locking, introduced in Ganeti 2.7, to allow parallel creationof VMs in the Ganeti backend. When this option is set, Ganeti iallocatorwill allocate the VM only to nodes that not locked (e.g. by other VMcreation). This may result in unbalanced clusters, but `hbal` can be...
Remove deprecated network type in ganeti
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Pass network type info in tags during create
Remove hotplug from InstanceCreate
New style format for modifying a NIC
cyclades: fix typo in snf-dispatcher
cyclades: Fix bug in floating IP test
cyclades: Fix bug for externally reserved IPs
Skip check if there are no externally reserved IPs in the Ganetibackend.
ui: Reboot required notification in networks view
ui: Exclude rebooting machines from network connect overlay
cyclades: Do not release externally reserved IPs
Do not automatically release an externally reserved IP if it is releasedfrom a Ganeti backend. The IP should be released with snf-managenetwork-modify management commands.
cyclades: Refactor network-modify command
Refactor snf-manage network-modify command. Remove options that modifiedlink, mac_prefix, mode, enable_dhcp or state of the network. Thisoptions modified only the network in DB and resulted in incosistenciesbetween Cyclades DB and Ganeti.
cyclades: Make (network, ipv4) unique for each NIC
Add a unique constraint to NetworkInterface model. This constraintasserts that the same IPv4 address from the same network will no beassigned to more than one NICs.
cyclades: Refactor reconciliation of pools
Move reconciliation of IP pools from 'snf-manage reconcile-networks'to 'snf-manage reconcile-pools'. Also change the way reconciliationworks: Instead of reconciling the IP pools in DB with the IP pools inGaneti, the new reconciliation just checks that:...
cyclades: Fix str representation for pool objects
cyclades: Refactor code for renaming a server
Created function for renaming a server.
cyclades: Fix server-modify management command
cyclades: Resize server from management command
Add the --flavor option in server-modify management command to resize aserver to a different flavor.
cyclades: Add --action option in server-modify cmd
Add --action option in server modify command, to start, stop or rebootan instance.
cyclades: Fix bug in backend_allocator
The 'disk_template' attribute for flavors of external disk templateincluded the name of the provider. The backend allocator tried to find abackend with an enabled 'ext_$(provider)' disk template. This commitfixes this by searching only for 'ext' in the enabled disk templates.
cyclades: Add missing migration for commit 3bb0b11
cyclades: Add 'server-remove' management command
Implement server-remove management command that deletes an instance froma Ganeti backend. The command will wait by default for theOP_INSTANCE_REMOVE job to complete, except if --wait=False is used.
cyclades: Add 'on_delete' to all ForeignKeys
Add 'on_delete' argument to all ForeignKeys. The value of thisargument depends on the type of each relation.
cyclades: Fix bug in update_cluster callback
Decorate 'update_cluster' callback with 'handle_message_delivery' tohandle acknowledgement of messages.
cyclades: Remove custom ForUpdateManager
Remove custom manager that implemented select_for_update(), since thisis already implemented in Django 1.4.
cyclades: Remove custom ProtectedDeletedManager
Remove custom ProtectedDeletedManager. Instead use theForeignKey.on_delete attribute that has been introduced in Django 1.4.
cyclades: Add missing queue
QUEUE_CLUSTER must be included in QUEUES.
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.
cyclades: Fix typo
cyclades: Fix bug in custom field
Rename get_db_prep_value to get_prep_value. In django 1.4 the second oneis just a wrapper for the first one.
Request Django=>1.4, <1.5
Drop support for Django 1.2. Remove compatibility code that were used inorder to support Django 1.2 and 1.4. Finally update django documentationlink in the docs.
wheezy: Rename depricated HttpRequest attribute
From django docs:""" HttpRequest.raw_post_data renamed to HttpRequest.body
This attribute was confusingly named HttpRequest.raw_post_data, but itactually provided the body of the HTTP request. It’s been renamed to...
wheezy: fix is_safe attribute of template filters
In Django 1.4 'is_safe' and 'needs_autoescape' attributes has been madekeyword arguments of @register.filter
Merge branch 'hotfix-0.14.8' into develop
Merge hotfix-0.14.8 which ports Synnefo to wheezy and Django 1.4.5
Conflicts: ci/ci_squeeze.conf ci/ci_wheezy.conf ci/schemas/one_node_squeeze/packages.conf ci/schemas/one_node_squeeze/squeeze.conf ci/schemas/one_node_squeeze/wheezy.conf...
cyclades: Callback for cluster modifications
Extend snf-dispatcher callbacks with one to run every time anOP_CLUSTER_ opcode is executed in a Ganeti backend.
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 disktemplates of all online Ganeti backends.
Allocate VMs based on enabled disk-templates
Remove the ARCHIPELAGO_BACKENDS setting. Instead allocate VMs based onthe disk-templates that are enabled and allowed in ipolicy for eachbackend. The command 'snf-manage backend-update-status' can be used to...
cyclades: Display disk-templates in backend-list
cyclades: Extend Backend model with disk_templates
Extend 'Backend' models with 'disk_template' attribute, that containsthe list of disk templates that are available in each backend.
cyclades: Add SeparatedValuesList field
Add custom field for storing a list of values in DB. The valuesare stored as a TextField separated by a delimiter.
Revert "wheezy: Rename depricated HttpRequest attribute"
This reverts commit cfc4b87c301504627e6a75ab2e4d32c8cd7a6e15. Thiscommit is reverted because it breaks compatibility with Django 1.2. Thisshould be applied for Synnefo 0.15.
Revert "wheezy: fix is_safe attribute of template filters"
This reverts commit 730fb3b0a0607bba95b90db1c6154cb7febb9187. Thiscommit is reverted because it breaks compatibility with Django 1.2. Thisshould be applied for Synnefo 0.15.
Revert "wheezy: Remove setup_environ"
This reverts commit a813a25117f3db14d5517f630d6d0e163a58b0f8. Thiscommit is reverted because it breaks compatibility with Django 1.2. Thisshould be applied for Synnefo 0.15.
reconciliation: Strip Ganeti IP addresses
Strip spaces from Ganeti IP addresses, since they are not automaticallyignored in newer versions of ipaddr.
wheezy: Remove setup_environ
From Django docs:""" This function temporarily modified sys.path in order to make the parent“project” directory importable under the old flat startproject layout.This function is now deprecated, as its path workarounds are no longer...
cyclades: Return the newest vm object upon creation
The server_command decorator commits the just created object and retrievesit back from the database. Return the latter, because the former is stalein memory.
cyclades: Remove commit_manually decorator
Replace commit_manually decorator with commit_on_success. Since networkis no longer created in DB in the API request, the manually decorator isno longer needed.
wheezy: Temporary disable reconciliation tests
Temporary disable reconciliation tests because they still run withfixture data, that are not loaded correctly.
wheezy: urls module doesn't export defaults
Fix missing import and broken test
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 thecommission in case of build, because the VM will be created in DB.
cyclades: Helper function for commissioning
Create 'quotas.handle_resource_commission' function for handlingcommissions for VMs and Networks.
cyclades: Handle errors during vm creation
Commit #f2080d1 mocked an OP_INSTANCE_REMOVE when enqueuing anOP_INSTANCE_CREATE job to Ganeti failed. However, this may result inreleasing IPs that may get reserved in Ganeti, because we can neverreally know if the job has reached Ganeti or not (e.g. timeout). For...
cyclades: Add missing commit_on_success decorator
cyclades: Add quotas for build server action
cyclades: refactor server creation command
Split the server creation command in more steps in order to bedecorated with the 'server_command' function and follow the logic of allother server commands. The main change is that the commission job is notaccepted when the VM is stored in DB, but when the OP_INSTANCE_CREATE...
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. Thiscommit applies commits #f2080d1, #ea9b0fb, #32a0b85 to the new file.
Merge branch 'master' into develop
Conflicts: Changelog version
helpdesk: Fix network interface queryset
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...