Statistics
| Branch: | Tag: | Revision:

root / lib / constants.py @ 5c947f38

History | View | Annotate | Download (2.3 kB)

1 a8083063 Iustin Pop
#!/usr/bin/python
2 a8083063 Iustin Pop
#
3 a8083063 Iustin Pop
4 a8083063 Iustin Pop
# Copyright (C) 2006, 2007 Google Inc.
5 a8083063 Iustin Pop
#
6 a8083063 Iustin Pop
# This program is free software; you can redistribute it and/or modify
7 a8083063 Iustin Pop
# it under the terms of the GNU General Public License as published by
8 a8083063 Iustin Pop
# the Free Software Foundation; either version 2 of the License, or
9 a8083063 Iustin Pop
# (at your option) any later version.
10 a8083063 Iustin Pop
#
11 a8083063 Iustin Pop
# This program is distributed in the hope that it will be useful, but
12 a8083063 Iustin Pop
# WITHOUT ANY WARRANTY; without even the implied warranty of
13 a8083063 Iustin Pop
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 a8083063 Iustin Pop
# General Public License for more details.
15 a8083063 Iustin Pop
#
16 a8083063 Iustin Pop
# You should have received a copy of the GNU General Public License
17 a8083063 Iustin Pop
# along with this program; if not, write to the Free Software
18 a8083063 Iustin Pop
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 a8083063 Iustin Pop
# 02110-1301, USA.
20 a8083063 Iustin Pop
21 a8083063 Iustin Pop
22 a8083063 Iustin Pop
"""Module holding different constants."""
23 a8083063 Iustin Pop
24 a8083063 Iustin Pop
# various versions
25 0006af7d Michael Hanselmann
CONFIG_VERSION = 3
26 a8083063 Iustin Pop
PROTOCOL_VERSION = 2
27 a8083063 Iustin Pop
RELEASE_VERSION = "1.2a1"
28 a8083063 Iustin Pop
OS_API_VERSION = 4
29 a8083063 Iustin Pop
EXPORT_VERSION = 0
30 a8083063 Iustin Pop
31 a8083063 Iustin Pop
32 a8083063 Iustin Pop
# file paths
33 a8083063 Iustin Pop
DATA_DIR = "/var/lib/ganeti"
34 a8083063 Iustin Pop
CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
35 a8083063 Iustin Pop
SSL_CERT_FILE = DATA_DIR + "/server.pem"
36 a8083063 Iustin Pop
WATCHER_STATEFILE = DATA_DIR + "/restart_state"
37 a8083063 Iustin Pop
38 a8083063 Iustin Pop
NODE_INITD_SCRIPT = "/etc/init.d/ganeti"
39 a8083063 Iustin Pop
DEFAULT_NODED_PORT = 1811
40 a8083063 Iustin Pop
FIRST_DRBD_PORT = 11000
41 a8083063 Iustin Pop
LAST_DRBD_PORT = 14999
42 880478f8 Iustin Pop
MASTER_SCRIPT = "ganeti-master"
43 a8083063 Iustin Pop
44 a8083063 Iustin Pop
LOG_DIR = "/var/log/ganeti"
45 a8083063 Iustin Pop
LOG_OS_DIR = LOG_DIR + "/os"
46 a8083063 Iustin Pop
LOG_NODESERVER = LOG_DIR + "/node-daemon.log"
47 a8083063 Iustin Pop
48 a8083063 Iustin Pop
OS_DIR = "/srv/ganeti/os"
49 a8083063 Iustin Pop
EXPORT_DIR = "/srv/ganeti/export"
50 a8083063 Iustin Pop
51 a8083063 Iustin Pop
EXPORT_CONF_FILE = "config.ini"
52 a8083063 Iustin Pop
53 a8083063 Iustin Pop
# hooks-related constants
54 a8083063 Iustin Pop
HOOKS_BASE_DIR = "/etc/ganeti/hooks"
55 a8083063 Iustin Pop
HOOKS_PHASE_PRE = "pre"
56 a8083063 Iustin Pop
HOOKS_PHASE_POST = "post"
57 a8083063 Iustin Pop
HOOKS_VERSION = 1
58 a8083063 Iustin Pop
59 a8083063 Iustin Pop
# hooks subject type (what object type does the LU deal with)
60 a8083063 Iustin Pop
HTYPE_CLUSTER = "CLUSTER"
61 a8083063 Iustin Pop
HTYPE_NODE = "NODE"
62 a8083063 Iustin Pop
HTYPE_INSTANCE = "INSTANCE"
63 a8083063 Iustin Pop
64 a8083063 Iustin Pop
HKR_SKIP = 0
65 a8083063 Iustin Pop
HKR_FAIL = 1
66 a8083063 Iustin Pop
HKR_SUCCESS = 2
67 a8083063 Iustin Pop
68 a8083063 Iustin Pop
# disk template types
69 a8083063 Iustin Pop
DT_DISKLESS = "diskless"
70 a8083063 Iustin Pop
DT_PLAIN = "plain"
71 a8083063 Iustin Pop
DT_LOCAL_RAID1 = "local_raid1"
72 a8083063 Iustin Pop
DT_REMOTE_RAID1 = "remote_raid1"
73 a8083063 Iustin Pop
74 a8083063 Iustin Pop
# instance creation modem
75 a8083063 Iustin Pop
INSTANCE_CREATE = "create"
76 a8083063 Iustin Pop
INSTANCE_IMPORT = "import"
77 a8083063 Iustin Pop
78 a8083063 Iustin Pop
DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN,
79 a8083063 Iustin Pop
                            DT_LOCAL_RAID1, DT_REMOTE_RAID1])
80 a8083063 Iustin Pop
81 a8083063 Iustin Pop
# import/export config options
82 a8083063 Iustin Pop
INISECT_EXP = "export"
83 a8083063 Iustin Pop
INISECT_INS = "instance"
84 38242904 Iustin Pop
85 38242904 Iustin Pop
# common exit codes
86 38242904 Iustin Pop
EXIT_NOTMASTER = 11
87 cf62a272 Michael Hanselmann
88 5c947f38 Iustin Pop
# tags
89 5c947f38 Iustin Pop
TAG_CLUSTER = "cluster"
90 5c947f38 Iustin Pop
TAG_NODE = "node"
91 5c947f38 Iustin Pop
TAG_INSTANCE = "instance"
92 5c947f38 Iustin Pop
MAX_TAG_LEN = 128
93 5c947f38 Iustin Pop
MAX_TAGS_PER_OBJ = 4096
94 5c947f38 Iustin Pop
95 cf62a272 Michael Hanselmann
# others
96 cf62a272 Michael Hanselmann
DEFAULT_BRIDGE = "xen-br0"
97 e31c43f7 Michael Hanselmann
SYNC_SPEED = 30 * 1024