Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / logic / servers.py @ 5ba2cfd2

History | View | Annotate | Download (28.9 kB)

# Date Author Comment
47c27955 02/13/2014 04:20 pm Giorgos Korfiatis

cyclades: Assign new resources to a project

Add optional parameter `project' in API calls that create VMs, networks,
and floating IPs. If missing, user's base project is assumed (same uuid
as the user).

99667854 02/13/2014 04:20 pm Giorgos Korfiatis

cyclades: Reassign resources

Add API calls to assign a VM, network, or floating IP to a new project.

14402edc 01/24/2014 07:12 pm Christos Stavrakakis

cyclades: Validate fields of API requests

Make sure that all fields of a request (user input) have a valid type.
This commit validates 'ports', 'servers' and 'floating_ips' APIs.

Refs #4979

ba777b02 01/23/2014 03:44 pm Giorgos Korfiatis

cyclades: Detach serial from resource when resolved

c915a198 01/13/2014 04:55 pm Giorgos Korfiatis

cyclades: Fix passing arg shutdown_timeout in logic

c397dbce 01/10/2014 05:52 pm Christos Stavrakakis

cyclades: Add shutdown_timeout to server commands

Add support for specifying a timeout when stopping, rebooting or
destroying a server.

371ab004 12/18/2013 07:17 pm Christos Stavrakakis

cyclades: Allow deletion of ports from deleted VMs

Fix corner case where a port seems to be still attached to a VM although
the VM has already been deleted.

ba6ad346 12/17/2013 09:58 am Dionysis Grigoropoulos

cyclades: Add a function to check name legnth

  • Add a function logic/utils.py to check the length of a string and
    raise an API fault with the corresponding message.
  • Check the length of the name of servers/ports/networks/subnets
62232bba 12/10/2013 04:48 pm Christos Stavrakakis

cyclades: Add setting for Ganeti clone providers

Add new 'GANETI_CLONE_PROVIDERS' setting to containg the list of
ExtStorage providers that support cloning. For these providers the
hashmap of the image is passed as an ExtStorage parameter('origin').
Also, since the disk is already filled with data, snf-image performs...

129b94d5 12/10/2013 04:28 pm Christos Stavrakakis

cyclades: Setting for max NICs per Ganeti instance

Add new 'GANETI_MAX_NICS_PER_INSTANCE' setting which represents the
maximum number of NICs that is allowed for each Ganeti instance. The
value of this setting must be less than 'max:nic-count` option of
Ganeti's ipolicy.

16a7ced5 12/09/2013 04:54 pm Christos Stavrakakis

cyclades: Remove testing try/exception statement

2fa6faca 12/08/2013 01:59 pm Christos Stavrakakis

cyclades: Fix typo in log msg

f3c5f1df 12/02/2013 04:03 pm Stratos Psomadakis

Add support for snf-vncauthproxy >= 1.5

91884d63 11/29/2013 02:26 pm Giorgos Korfiatis

Add some missing Copyright notices

Also add 2013 in package COPYRIGHT files.

c32c74d9 11/26/2013 03:27 pm Christos Stavrakakis

cyclades: Fix bug by wrong indentation

e74a5b4b 11/26/2013 03:20 pm Christos Stavrakakis

cyclades: Improve messages for default networks

Improve log and exception messages when failing to connect new server to
default and forced server networks.

bc4dfc43 11/26/2013 01:29 pm Christos Stavrakakis

cyclades: Include 'vlmc' and 'archipelago'

Fix image ID for both 'vlmc' and 'archipelago' ext providers.

64bca363 11/15/2013 01:32 pm Giorgos Korfiatis

cyclades: Pass action params in server_command

Commission to be issued depends on extra parameters for some actions,
e.g., on the flavor when resizing a vm.

6e73f499 11/14/2013 12:14 pm Christos Stavrakakis

cyclades: Allow deletion of ports from public nets

Move check about deleting a port from a public network. This check is
only enforced in the API, but is allowed in logic layer, e.g. snf-manage
commands.

32b1ed4a 11/13/2013 09:44 am Christos Stavrakakis

cyclades: Check drained only if not destroying

Check drained flag only if network actions is not destroy. When network
is being destroyed the network is automatically marked as drained to
exclude it from IP allocations.

af1832fe 11/13/2013 09:18 am Christos Stavrakakis

cyclades: Check for all finalized states

a1dae38d 11/12/2013 01:34 pm Christos Stavrakakis

Merge branch 'feature-cyclades-networks' into develop

Conflicts:
snf-cyclades-app/synnefo/api/management/commands/server-inspect.py
snf-cyclades-app/synnefo/app_settings/urls.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/logic/backend_allocator.py...

80a548e3 11/11/2013 12:59 pm Christos Stavrakakis

Merge branch 'master' into develop

Conflicts:
Changelog
astakosclient/astakosclient/keypath.py
ci/utils.py
docs/admin-guide.rst
snf-astakos-app/astakos/im/cookie.py
snf-astakos-app/astakos/im/functions.py
snf-astakos-app/astakos/im/quotas.py
snf-astakos-app/astakos/im/views/projects.py...

8f335041 11/08/2013 05:19 pm Christos Stavrakakis

cyclades: Handle 'drained' flag of networks

  • Export 'SNF:DRAINED' status for drained networks.
  • Do not allow creation of new ports in drained networks.
  • Do not allow allocation of new IPs in drained networks.
8d5795b4 11/06/2013 02:00 pm Christos Stavrakakis

Cyclades: Rename 'Can not' to 'Cannot' to all msgs

ee688a71 11/06/2013 01:28 pm Christos Stavrakakis

cyclades: Do not allow any action on 'ERROR' vms

Do not allow any action, other than 'DESTROY' in servers that are in
'ERROR' state. If the server is in 'ERROR' state then the corresponding
Ganeti instance may not exist, so all actions will fail.

3aecadc8 11/05/2013 11:07 am Christos Stavrakakis

cyclades: Fix default/forced server networking

Fix the default behaviour for networking of servers that are being
created. There are two settings controlling this behaviour:

  • CYCLADES_DEFAULT_SERVER_NETWORKS: This setting contains list of
    networks to connect a newly created server to, if the user has not...
0292883e 11/04/2013 03:52 pm Christos Stavrakakis

cyclades: Refactor code

Move code relative with allocating ips and floating IPs to 'logic.ips'
module.

3f18f035 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Forbid new ports no deleting network

Do not allow creation of new ports and reservation of floating IPs on
network that are being deleted. Currently the state of the network
changes only when the network gets deleted from all backends. So we
check if a network is being deleted by checking if the action of the...

d2c3c533 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Create server in public net with FIP

Remove 'floating_ips' extension attribute to POST /servers API call.
Instead use the 'fixed_ip' attribute of 'networks' attribute to specify
the IPv4 address of a floating IP. So in order to create a server
connected to a private network and a public network, the 'networks'...

09b76b7e 11/02/2013 02:39 pm Christos Stavrakakis

cyclades: Fix permissions when looking up ports

Look up of ports should check the port userid and not the network
userid.

99988465 11/02/2013 01:43 pm Christos Stavrakakis

cyclades: Create server with existing ports

Extend POST /servers API call to support creation of servers that will
be using existing ports. Networking of the instance is defined via the
'networks' attribute which can contain either network UUIDs or port
UUIDs. In case of network UUIDs, the user can also request for a...

ae2da8a2 11/02/2013 01:08 pm Christos Stavrakakis

cyclades: Fix double double creation of IP log

The port creation command called 'associate_port_with_machine' function
in order to associate the port with the machine and create an
IPAddressLog entry. However, this is already done by the connect
function which sends the job in the Ganeti backend. This resulted in...

fae6e5f0 11/01/2013 04:17 pm Christos Stavrakakis

cyclades: Create ports without 'device_id'

Allow creation of ports that are not connected to any instance. Such
ports will be in 'DOWN' state. To allow this, 'machine' attribute of
NetworkInterface model has been made to allow null values. Finally, the
'logic.ports' module has been remove, and the corresponding code has...

ff863a80 11/01/2013 12:45 am Christos Stavrakakis

cyclades: Add accounting for IP Addresses

Create IPAddressLog DB table to hold information about allocation of IP
addresses to virtual servers. The information that is currently saved
contains the IP address, the ID of the virtual server, the ID of the
virtual network along with the datetime that the address has been...

6b8dc47c 10/30/2013 06:27 pm Christos Stavrakakis

cyclades: Common code for creating ports

Merge code for creating ports that was duplicated between
'logic.servers' and 'logic.ports' modules.

3a6be177 10/30/2013 12:51 pm Christos Stavrakakis

cyclades: Rename Port state from BUILDING to BUILD

Neutron API defines the 'BUILD' status. This commit renames BUILDING
state of NIC to BUILD.
014df29c 10/29/2013 03:40 pm Christos Stavrakakis

cyclades: Remove stale references to vm.router

54f13218 10/25/2013 02:30 pm Christos Stavrakakis

cyclades: PEP8 fix

d9c36253 10/25/2013 12:35 am Marios Kogias

cyclades: snf-manage floating-ip-attach

snf-manage floating-ip-attach <address> --machine <server_id/router_id>

710b1c43 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Refactor code for allocating IPs

Refactor code that was used for allocating IP addresses and creating
NetworkInterfaces. The new code is more suitable to the new DB schema
where each network may have many IPv4 subnets and each subnet may
have many IP pools. Also, the new functions are using prefetch related...

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.

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.

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.

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.

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

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

cyclades: Refactor code for renaming a server

Created function for renaming a server.

e5e62972 09/27/2013 12:38 pm Giorgos Korfiatis

cyclades: Return the newest vm object upon creation

The server_command decorator commits the just created object and retrieves
it back from the database. Return the latter, because the former is stale
in memory.

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.

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

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

8e67ea28 09/18/2013 06:22 pm Christos Stavrakakis

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. This
commit applies commits #f2080d1, #ea9b0fb, #32a0b85 to the new file.

c9fefba3 09/10/2013 03:29 pm Christos Stavrakakis

cyclades: Store action to the VM

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.

9599e997 08/20/2013 03:41 pm Christos Stavrakakis

cyclades: Add check for net action with no hotplug

In case hotplug is disabled, via GANETI_USE_HOTPLUG setting, network
actions should be allowed only on STOPPED vms. This commit adds this
check and a unittest for this case. Also it makes some other checks...

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

cyclades: Import settings from django.conf

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.

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

6193628f 07/08/2013 12:04 pm Christos Stavrakakis

cyclades: Fix typo bug in management command

f05a25af 07/05/2013 04:52 pm Christos Stavrakakis

cyclades: Fix wrong unit of ram

9446e7e5 07/02/2013 01:24 pm Christos Stavrakakis

cyclades: Rename "public" to "SNF:ANY_PUBLIC"

Rename reserved work for automatically choosing a public network from
"public" to "SNF:ANY_PUBLIC". Also add the setting description to conf
files.

660b9f3b 07/02/2013 12:32 pm Christos Stavrakakis

cyclades: Remove PUBLIC_USE_POOL setting

Remove PUBLIC_USE_POOL setting, since in order to use floating IPs, the
cyclades must be responsible for managing all IP pools.

816d7588 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Choose floating-ips when creating server

Extend POST /servers API call, to take an optional attribute
'floating_ips', which is a list of floating IP addresses. The server
will have one NIC for each of this addresses after the
'DEFAULT_INSTANCE_NETWORKS' and before any private networks that the...

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

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

cyclades: Check if network exists in backend

Raise 503 if a user tries to add a floating IP to a VM that resides in a
Ganeti backend that the coressponding network does not exist.

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.

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.

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

34c03a51 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Handle 'EmptyPool' in util method

Refactor cyclades code to handle 'EmptyPool' exception in
'get_network_free_address' function.