Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / app_settings / default / api.py @ 0224049a

History | View | Annotate | Download (5.5 kB)

1
# -*- coding: utf-8 -*-
2
#
3
# API configuration
4
#####################
5

    
6

    
7
DEBUG = False
8

    
9
# Top-level URL for deployment. Numerous other URLs depend on this.
10
APP_INSTALL_URL = "https://host:port"
11

    
12
# The API implementation needs to accept and return absolute references
13
# to its resources. Thus, it needs to know its public URL.
14
API_ROOT_URL = APP_INSTALL_URL + '/api'
15

    
16
# The API will return HTTP Bad Request if the ?changes-since
17
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
18
POLL_LIMIT = 3600
19

    
20
#
21
# Network Configuration
22
#
23

    
24
# Maximum allowed network size for private networks.
25
MAX_CIDR_BLOCK = 22
26
# Name of the network in Ganeti corresponding to the default public network.
27
# All created VMs will obtain an IP from this network.
28
GANETI_PUBLIC_NETWORK = 'snf-net-1'
29

    
30
# The first mac prefix to use
31
MAC_POOL_BASE = 'aa:00:0'
32
MAC_POOL_LIMIT = 65536
33

    
34
ENABLED_NETWORKS = ['PUBLIC_ROUTED',
35
                    'PRIVATE_MAC_FILTERED',
36
                    'PRIVATE_PHYSICAL_VLAN']
37
                    # CUSTOM_ROUTED,
38
                    # CUSTOM_BRIDGED,
39

    
40
# Settings for PUBLIC_ROUTED network:
41
# -----------------------------------
42
# In this case VMCs act as routers that forward the traffic to/from VMs, based
43
# on the defined routing table($PUBLIC_ROUTED_ROUTING_TABLE) and ip rules, that
44
# exist in every node, implenting an IP-less routed and proxy-arp setup.
45
# (This value is also hardcoded in fixture db/fixtures/initial_data.json)
46
PUBLIC_ROUTED_ROUTING_TABLE = 'snf_public'
47
PUBLIC_ROUTED_TAGS = ['ip-less-routed']
48

    
49
# Boolean value indicating whether synnefo would hold a Pool and allocate IP
50
# addresses. If this setting is set to False, IP pool management will be
51
# delegated to Ganeti. If machines have been created with this option as False,
52
# you must run network reconciliation after turning it to True.
53
PUBLIC_ROUTED_USE_POOL = True
54

    
55
# Settings for PRIVATE_MAC_FILTERED network:
56
# ------------------------------------------
57
# All networks of this type are bridged to the same bridge. Isolation between
58
# networks is achieved by assigning a unique MAC-prefix to each network and
59
# filtering packets via ebtables.
60
PRIVATE_MAC_FILTERED_BRIDGE = 'br0'
61
PRIVATE_MAC_FILTERED_TAGS = ['private-filtered']
62

    
63
# Settings for PRIVATE_PHSICAL_VLAN network:
64
# ------------------------------------------
65
# Each network of this type is mapped to an isolated physical VLAN, which must
66
# be preconfigured in the backend. Each vlan corresponds to a bridge named
67
# $PRIVATE_PHYSICAL_VLAN_PREFIX{1..$PRIVATE_PHYSICAL_VLAN_MAX_NUMBER} (e.g. prv5)
68
# VirtualMachine's taps are eventually bridged to the corresponding bridge.
69
PRIVATE_PHYSICAL_VLAN_BRIDGE_PREFIX = 'prv'
70
# The max limit of physical vlan pool
71
PRIVATE_PHYSICAL_VLAN_MAX_NUMBER = 100
72
PRIVATE_PHYSICAL_VLAN_TAGS = ['physical-vlan']
73

    
74

    
75
# Settings for CUSTOM_ROUTED:
76
# ---------------------------
77
# Same as PUBLIC_ROUTED but with custom values
78
CUSTOM_ROUTED_ROUTING_TABLE = 'custom_routing_table'
79
CUSTOM_ROUTED_TAGS = []
80

    
81
# Settings for CUSTOM_BRIDGED:
82
# ---------------------------
83
# Same as PRIVATE_BRIDGED but with custom values
84
CUSTOM_BRIDGED_BRIDGE = 'custom_bridge'
85
CUSTOM_BRIDGED_TAGS = []
86

    
87
# Firewalling
88
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:0:protected'
89
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:0:unprotected'
90
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:0:limited'
91

    
92
# The default firewall profile that will be in effect if no tags are defined
93
DEFAULT_FIREWALL_PROFILE = 'DISABLED'
94

    
95
# our REST API would prefer to be explicit about trailing slashes
96
APPEND_SLASH = False
97

    
98
# Ignore disk size specified by flavor, always build the
99
# machine with a 4GB (in the case of Windows: 14GB) disk.
100
# This setting is helpful in development setups.
101
#
102
IGNORE_FLAVOR_DISK_SIZES = False
103

    
104
# Quota
105
#
106
# Maximum number of VMs a user is allowed to have.
107
MAX_VMS_PER_USER = 3
108

    
109
# Override maximum number of VMs for specific users.
110
# e.g. VMS_USER_QUOTA = {'user1@grnet.gr': 5, 'user2@grnet.gr': 10}
111
VMS_USER_QUOTA = {}
112

    
113
# Maximum number of networks a user is allowed to have.
114
MAX_NETWORKS_PER_USER = 5
115

    
116
# Override maximum number of private networks for specific users.
117
# e.g. NETWORKS_USER_QUOTA = {'user1@grnet.gr': 5, 'user2@grnet.gr': 10}
118
NETWORKS_USER_QUOTA = {}
119

    
120
# URL templates for the stat graphs.
121
# The API implementation replaces '%s' with the encrypted backend id.
122
# FIXME: For now we do not encrypt the backend id.
123
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png'
124
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png'
125
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png'
126
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png'
127

    
128
# Recommended refresh period for server stats
129
STATS_REFRESH_PERIOD = 60
130

    
131
# The maximum number of file path/content pairs that can be supplied on server
132
# build
133
MAX_PERSONALITY = 5
134

    
135
# The maximum size, in bytes, for each personality file
136
MAX_PERSONALITY_SIZE = 10240
137

    
138
# Available storage types to be used as disk templates
139
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain',
140
                         'rbd',  'sharedfile')
141
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd'
142

    
143
# The URL of an astakos instance that will be used for user authentication
144
ASTAKOS_URL = 'https://astakos.okeanos.grnet.gr/im/authenticate'
145

    
146
# Key for password encryption-decryption. After changing this setting, synnefo
147
# will be unable to decrypt all existing Backend passwords. You will need to
148
# store again the new password by using 'snf-manage backend-modify'.
149
# SECRET_ENCRYPTION_KEY may up to 32 bytes. Keys bigger than 32 bytes are not
150
# supported.
151
SECRET_ENCRYPTION_KEY= "Password Encryption Key"