Statistics
| Branch: | Tag: | Revision:

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

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
ENABLED_NETWORKS = ['PUBLIC_ROUTED',
31
                    'PRIVATE_MAC_FILTERED',
32
                    'PRIVATE_PHYSICAL_VLAN']
33
                    # CUSTOM_ROUTED,
34
                    # CUSTOM_BRIDGED,
35

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

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

    
51
# Settings for PRIVATE_MAC_FILTERED network:
52
# ------------------------------------------
53
# All networks of this type are bridged to the same bridge. Isolation between
54
# networks is achieved by assigning a unique MAC-prefix to each network and
55
# filtering packets via ebtables.
56
PRIVATE_MAC_FILTERED_BRIDGE = 'br0'
57
# The first mac prefix to use
58
PRIVATE_MAC_FILTERED_BASE_MAC_PREFIX = 'aa:00:00'
59
PRIVATE_MAC_FILTERED_MAX_PREFIX_NUMBER = 8192
60
PRIVATE_MAC_FILTERED_TAGS = ['private-filtered']
61

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

    
73

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
145
# Key for password encryption-decryption. After changing this setting, synnefo
146
# will be unable to decrypt all existing Backend passwords. You will need to
147
# store again the new password by using 'snf-manage backend-modify'
148
ENCRYPTION_KEY= "Password Encryption Key"