cyclades: Add missing migration for commit 3bb0b11
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: 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: 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.
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.
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...
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 index field of NIC optional
Change 'index' field of NIC model to be optional, because the index ofbuilding NICs is unknown. Also, change all API responses to return onlythe active NICs.
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: Import settings from django.conf
cyclades: More verbose models representation
Make unicode method of VirtualMachine, Network and FloatingIP models moreverbose.
cyclades: Remove wrong model attribute
cyclades: Add migration file for IPv6 networks
cyclades: Fix exception message
cyclades: Support IPv6 only networks
Make Cyclades support IPv6 only networks. Such networks will havethe 'subnet' attribute set to None, in the same way that IPv4 onlynetworks have the 'subnet6' attribute set to None.
Because currently Ganeti does not support IPv6 only networks, we create the...
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...
cyclades: pep8 fixes
cyclades: Add disk template to flavors fixture
cyclades: Add migration file
Add migration file for floating IPs and VM task state.
cyclades: Check if a NIC is a floating IP.
Extend NetworkInterface model with a property showing if the IPv4address of the NIC is a floating IP or not. Also, simplify somerelevant code.
Distinquish between networks and Floating IP pools
Extend Network model with the 'floating_ip_pool' boolean field, toindicate whether a Network can be a floating IP pool or not. Networksthat are floating IP pools must exist in all Backends, and so'snf-manage backend-add' should try to add them....
cyclades: Separate logic for networks from API
Remove code handling networks from network API views to logic.networks
cyclades: Make NIC representation more verbose
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 requestwill fail if the user tries to allocate an IP address that is used byanothers user VM (it will succeed if they address is already used by...
cyclades: Add FloatingIP model
Add Floating IP model to represent a floating IP that has been reservedby a user. Each FloatingIP has an owner(UUID), an IPv4 address, thenetwork(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...
cyclades: Extend /servers with floating IP actions
Extend '/servers/action' API endpoint, to support 'addFloatingIP'and 'removeFloatingIP' actions.
cyclades: Remove custom init method from VM model
cyclades: Major refactor to api and logic apps
Major refactor to cyclades api and logic apps that removes most codefrom the api views and moves it to logic app, so that the same logiccode can be used by different apps (e.g. EC2 API). Code is moved into...
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 ofthe new flavor are the same with the old one, and if the VM is in...
cyclades: Make flavor representation more verbose
cyclades: Remove obsolete settings
Remove obsolete GANETI_DISK_TEMPLATES and DEFAULT_GANETI_DISK_TEMPLATEsettings.
Fix compatibility issues with factory_boy
Update models_factory to use factory.DjangoModelFactory instead offactory.Factory.
cyclades: Add 'drained' flag to Network
Extend Network model with the 'drained' attribute, to indicate whether anetwork should be used in public IP allocation when creating servers.This option is only useful for public networks.
cyclades: Add --hypervisor option to backend cmds
Add '--hypervisor' option to 'backend-add' and 'backend-modify'management commands.
Refs #3772
cyclades: Sypport backends with Xen hypervisor
cyclades: fix db migration
Migration 0066 should not run on a fresh installation.
cyclades: Make cyclades work with pycrypto==2.6
In PyCrypto 2.6, it is mandatory to use an IV of 16 bytes when using AESencryption. This commit updates 'aes_encrypt' module to use a random IV.Also, a data migration is required to re-encrypt the old passwords, as...
cyclades: Implement lazy networks
Implement "lazy networks", which are not created to all Ganeti backendsupon creation, but only when an instance that resides in a Ganeti isconnected to that network.
Update 'create_network' to create the Network object in DB without...
Refactor QuotaHolder serial model
Remove VM/Network DeletedError and BuildingError
Handle these errors explicitly in the code instead of the "api_method" decorator.
Move cloud faults to 'snf_django.lib.api.faults'
Gather all faults from all synnefo projects into common'snf_django.lib.api.faults'.
Simple tests for synnefo.quotas
Fix NIC's default state
Use "ACTIVE" as NIC's default state, to avoid addding a data migration.
Create public NIC when creating VM
Until now, a server's public NetworkInterface was not created in the DBuntil the arrival of the message from Ganeti hooks. However, the IPv4address of the NIC is reserved before sending the OP_INSTANCE_CREATEjob to Ganeti....
Bypass commissioning for orphan networks
Cyclades public networks do not have an owner, and since can not usethe commissioning system. Also, make snf-dispatcher instead of failingfor networks without userid to just a log a warning. This does not apply for...
Fix BridgePoolTable testcase
Fix whitespace, Licence
Re-implement select_for_update
Previous implementation of 'select_for_update' method was based on anattribute of the 'ForUpdateManager'. However, the model manager is sharedbetween all threads, which lead to race conditions. This commitreimplements 'select_for_update', by making it return a custom QuerySet...
Fix bug in PoolTable
Catch correct exception
Remove unused module
pep8 fixes
Add disk_template to Flavor name
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
Fix bug about networks and offline backends
Ignore offline backends when computing the state of the network, sinceno notification will be received from them. Also, create noBackendNetwork for an offline backend. This will be created byreconcilliation, when the backend gets online again.
Add more tests for db, logic and api
Fix wrong count of reserved pool entries
Padding should not be considered when counting unavailable entries.
Fix bugs in models methods
Add more tests for db and logic
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 areeasier to write and maintain.
Include Pool tests to Django testsuite
Fix current db, logic and api tests
Do not allow creation of more than one pools
Do not allow creation of more than one Bridge or MacPrefix pool, sincewe can not handle them yet.
Introduce network flavors to replace network types
Add tags and mode to network db model. Replace existing type withflavor. 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....
Migration files for network types
Fix bugs from merging
Add migration file for quotaholderserial
Reorder code
Create QuotaHolderSerial table
Add QuotaHolderSerial column to VM and Network
Correlate the VirtualMachine and Network models with a QuotaHolderSerialentry, holding the serial number returned by the QuotaHolder for thelast allocation for these resources.
Do not automatically update network state
Each modification in a BackendNetwork object, triggers an updateto the corresponding Network object. Until now this was done bythe BackendNetwork save() method. Now it is explicitly donefrom the backend pross_network_status.
Implement resizing of pools
Extend PoolManager to support extending and shrinking of Pools. Alsoadd extra option '--size' to pool-modify command.
Add indexes to VirtualMachine and Network
Add indexes to VirtualMachine userid and deleted columnsAdd indexes to Network userid, deleted and public columns
Use select_for_update for VirtualMachines
Use select_for_update method when accessing VM objects to preventrace conditions. Also move start_action from logic to api.
Delete BackendNetworks when deleting a Backend
Merge branch 'ui-0.11' into devel-0.12
Do not allow actions to deleted networks
Remove depricated settings and update migrations
Merge remote-tracking branch 'origin/devel-0.12' into ui-0.11
Fix compatibility issues with python-bitarray
Reapply diagnostics migrations
Merge branch 'devel-0.12' into ui-0.11
Do not create bridge for public network
Bridge indexes must start from 1
Restore IP Pool creation for corner cases
Create IPPool when creating Network
Create the IPPool associated with each Network, when creating it. Untilnow, IPPools were created on first demand. However, because the Networkobject is not accessed in exclusive mode, concurrent access to theNetwork model resulted in a race condition. More than one workers may...
Fix typos
Release mac_prefix only if network is MAC_FILTERED
Change and fix migration files
Change network migration, so that it does not allocate a new bridge toexisting network. Instead it keeps the bridges from the old NetworkLinkpool.
Remove network_mac_prefix migration because there are no networks withmac prefixes....
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
Fix bug about RAPI client pooling
Modify the pooled_rapi_client context manager to handle exceptionsand release the client in any case. Also modify uses of reconciliationto handle exceptions inside the scope of the context manager
Fix wrong call in VirtualMachine get_client
Add missing arguments in Backend's get_client
Remove user provided names from models unicode
Remove user provided names from models representation, as the usermay provide a value that can affect the admin terminal. Fix suggestedby vkoukis.
Add extra logging
Pool Ganeti RAPI clients
- Move Ganeti RAPI client from snf-common to snf-cyclades-app/logic.- Create GanetiRapiClientPool for pooling GanetiRapiClient objects- Create context manager in db.models for pool handling- Update code using the RAPI client
Perform allocations in separate transactions
Add ForUpdateManager to the Backend model, in order to guaranteeexclusive order when allocating a VM.
Use manual transactions when allocating Backend and public IP for a newVM, since these allocations need exclusive access (SELECT..FOR UPDATE)...
Add tests for PoolManager(s)
Fix bugs in IPPool
- Do not always reserve gateway- Initial reservations must be in reserved map