cyclades: Add snf-manage subnet-inspect
cyclades: Fix permissions when looking up ports
Look up of ports should check the port userid and not the networkuserid.
cyclades: Create server with existing ports
Extend POST /servers API call to support creation of servers that willbe using existing ports. Networking of the instance is defined via the'networks' attribute which can contain either network UUIDs or portUUIDs. In case of network UUIDs, the user can also request for a...
cyclades: Fix double double creation of IP log
The port creation command called 'associate_port_with_machine' functionin order to associate the port with the machine and create anIPAddressLog entry. However, this is already done by the connectfunction which sends the job in the Ganeti backend. This resulted in...
cyclades: Reconcile pools only for IPv4+dhcp subs
Perform IP pools reconciliation only for networks with an IPv4 subnetthat has enabled the dhcp option.
cyclades: Create ports without 'device_id'
Allow creation of ports that are not connected to any instance. Suchports will be in 'DOWN' state. To allow this, 'machine' attribute ofNetworkInterface model has been made to allow null values. Finally, the'logic.ports' module has been remove, and the corresponding code has...
cyclades: Fix bug in floating-ip-list
cyclades: Add accounting for IP Addresses
Create IPAddressLog DB table to hold information about allocation of IPaddresses to virtual servers. The information that is currently savedcontains the IP address, the ID of the virtual server, the ID of thevirtual network along with the datetime that the address has been...
cyclades: PEP8 Fix
cyclades: Fix bug in port-create
Check if floating-ip belongs to the given network
cyclades: Common code for creating ports
Merge code for creating ports that was duplicated between'logic.servers' and 'logic.ports' modules.
cyclades: Various refactors in subnets
cyclades: Fix stale references to moved function
cyclades: Update state of NICs if VM creation fail
Set the state of NICs(ports) to ERROR if the OP_INSTANCE_CREATE jobfails.
cyclades: Rename Port state from BUILDING to BUILD
Neutron API defines the 'BUILD' status. This commit renames BUILDING state of NIC to BUILD.
cyclades: Common module for pretty-printing
Create common module for pretty-printing database objects. Currently itcontains only functions for pretty-printing networks and ports.
cyclades: Make tests work with multiple IP pools
Refactor tests so that they are aware that a network can have multipleIP pools. Also, add extra check to PoolManager methods in order to checkwhether a value is contained in the pool.
cyclades: Various fixes to networks/subnets/pools
cyclades: Fix reconciliation for network and pools
cyclades: Small bug fixes in logic/subnets.py
cyclades: Update docstrings, remove old functions
cyclades: Fix some bugs in subnets
cyclades: Remove stale references to vm.router
cyclades: Fix output of network-inspect command
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 changesthis to be done for any kind of networks.
cyclades: Set external_router for public networks
Set 'external_router' attribute of created networks to True, if anetwork is a public network.
cyclades: Use existing IP when creating port
Extend port creation with the option to use an existing IPAddress. Thiswill be used to create a port with an existing Floating IP. Also, extendport-creata management command with the '--floating-ip' option.
cyclades: Fixes to port-create command
Verbal and code-style fixes to port-create command.
cyclades: PEP8 fix
cyclades: Fix snf-manage floating-ip-list
A minor fix to the snf-manage floating-ip-list command to complyto the new models
cyclades: snf-manage floating-ip-attach
snf-manage floating-ip-attach <address> --machine <server_id/router_id>
cyclades: Bug fixes in subnets
cyclades: move subnets.py from api to logic
Move api/subnets.py to logic/subnets.py, for further code refactoring
cyclades: Fix network inspect management command
cyclades: Add backend code to Ports API/logic
Add backend code to create and remove ports from Ganeti backends. Alsoadd some imporovements and fixes to logic, API code and managementcommands.
cyclades: Fix bug when creating networks
cyclades: Add snf-manage port-remove command
cyclades: Add logic ports.py
Created a new file for ports in logic directory. This will havethe code about port manipulation in the backend. For now it is justused for db filling.Use the new function 'create' in the ports API.
cyclades: Refactor backend code for new networks
cyclades: Create IPv4 pool when creating network
Create IPv4 address pool when creating the network. This is a temporarycommit to make logic network work, since subnet and pool creation mustbe moved out of the network creation part.
cyclades: Add method to get ip stats to network
Extend Network model with a method to get the number of free and totalIPv4 addresses of the network. Also, add method to IPAddress model torelease its IPv4 address if any. Finally, update backend-list management...
cyclades: Refactor code for allocating IPs
Refactor code that was used for allocating IP addresses and creatingNetworkInterfaces. The new code is more suitable to the new DB schemawhere each network may have many IPv4 subnets and each subnet mayhave many IP pools. Also, the new functions are using prefetch related...
cyclades: Fix code for networks logic and API
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.
cyclades: Make API server tests pass
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: 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: 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 for externally reserved IPs
Skip check if there are no externally reserved IPs in the Ganetibackend.
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 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: Refactor code for renaming a server
Created function for renaming a server.
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: Fix bug in update_cluster callback
Decorate 'update_cluster' callback with 'handle_message_delivery' tohandle acknowledgement of messages.
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: 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: 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: 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: 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 '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...
cyclades: Make GanetiRapiClient work with gevent
GanetiRapiClient uses PyCurl, a Python interface to libcurl, andperforms blocking requests, so does not work well with gevent. Thiscommit makes GanetiRapiClient to use 'Requests' HTTP library that isgreenlet-safe.
cyclades: Simplify code
Simplify code by removing unnecessary temp variable.
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 beenreleased.
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 resourceobject becomes stale: its lock is released and another thread may acquire...
cyclades: fix typos
cyclades: Update NICs even if job failed
Make snf-ganeti-eventd send the NICs of the instance not only onsuccess, but also if the job has failed or has been canceled. Also,update snf-dispatcher to handle those messages. This step is required toclear BUILDING NICs that fail.
cyclades: Store action to the VM
cyclades: Fix bug in reconciliation
VMs at building error that do not exist in Ganeti must not be reportedas stale. The VM is stale only if the user has asked to destroy the VM,and so the action is DESTROY.
cyclades: Create NIC before send job to Ganeti
Create NICs in building state before enqueuing corresponding jobs toGaneti. This has already been done when creating the instance, but notwhen connecting it to other networks.
cyclades: Fix bug in snf-dispatcher logic
This commit reverts commits #07602322 and #30514662 which introduced abug in dispatcher's logic. These commit fixed the issue that, in a casethe Cyclades DB is unsynced with Ganeti, a resource that does not exist...
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 aresemantically different. The 'SOFT' and 'HARD' reboot types of OS API aremapped to 'shutdown_timeout' option of Ganeti jobs. However, setting...
cyclades: Do not pass 'hotplug' if disabled
Fix passing of hotplug argument to GanetiRAPIClient, in case theGANETI_USE_HOTPLUG is unset. If the Ganeti version does not supporthotplug, passing hotplug=False, will make the jobs fail at Ganeti opcodevalidation. This commit fixes this by passing the argument, only when...
cyclades: Add check for net action with no hotplug
In case hotplug is disabled, via GANETI_USE_HOTPLUG setting, networkactions should be allowed only on STOPPED vms. This commit adds thischeck and a unittest for this case. Also it makes some other checks...
cyclades: Fix check for firewall profile