root / lib / constants.py @ 63c73073
History | View | Annotate | Download (57.4 kB)
1 | 2f31098c | Iustin Pop | #
|
---|---|---|---|
2 | a8083063 | Iustin Pop | #
|
3 | a8083063 | Iustin Pop | |
4 | d04c9d45 | Iustin Pop | # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 | 4fe80ef2 | Iustin Pop | import re |
25 | 47334810 | Iustin Pop | import socket |
26 | 4fe80ef2 | Iustin Pop | |
27 | 2ec08468 | Michael Hanselmann | from ganeti import _autoconf |
28 | 13aeae6a | Iustin Pop | from ganeti import _vcsversion |
29 | b8028dcf | Michael Hanselmann | from ganeti import compat |
30 | 9f2265bc | Michael Hanselmann | from ganeti import pathutils |
31 | 3329f4de | Michael Hanselmann | |
32 | 7c18ef8e | Michael Hanselmann | |
33 | a8083063 | Iustin Pop | # various versions
|
34 | 2ec08468 | Michael Hanselmann | RELEASE_VERSION = _autoconf.PACKAGE_VERSION |
35 | d1a7d66f | Guido Trotter | OS_API_V10 = 10
|
36 | d1a7d66f | Guido Trotter | OS_API_V15 = 15
|
37 | b41b3516 | Iustin Pop | OS_API_V20 = 20
|
38 | b8028dcf | Michael Hanselmann | OS_API_VERSIONS = compat.UniqueFrozenset([ |
39 | b8028dcf | Michael Hanselmann | OS_API_V10, |
40 | b8028dcf | Michael Hanselmann | OS_API_V15, |
41 | b8028dcf | Michael Hanselmann | OS_API_V20, |
42 | b8028dcf | Michael Hanselmann | ]) |
43 | 13aeae6a | Iustin Pop | VCS_VERSION = _vcsversion.VCS_VERSION |
44 | a8083063 | Iustin Pop | EXPORT_VERSION = 0
|
45 | bac5ffc3 | Oleksiy Mishchenko | RAPI_VERSION = 2
|
46 | a8083063 | Iustin Pop | |
47 | 1b45f4e5 | Michael Hanselmann | |
48 | 243cdbcc | Michael Hanselmann | # Format for CONFIG_VERSION:
|
49 | 243cdbcc | Michael Hanselmann | # 01 03 0123 = 01030123
|
50 | 243cdbcc | Michael Hanselmann | # ^^ ^^ ^^^^
|
51 | 243cdbcc | Michael Hanselmann | # | | + Configuration version/revision
|
52 | 243cdbcc | Michael Hanselmann | # | + Minor version
|
53 | 243cdbcc | Michael Hanselmann | # + Major version
|
54 | 243cdbcc | Michael Hanselmann | #
|
55 | f0a26429 | Michael Hanselmann | # It is stored as an integer. Make sure not to write an octal number.
|
56 | 1b45f4e5 | Michael Hanselmann | |
57 | 1b45f4e5 | Michael Hanselmann | # BuildVersion and SplitVersion must be in here because we can't import other
|
58 | 1b45f4e5 | Michael Hanselmann | # modules. The cfgupgrade tool must be able to read and write version numbers
|
59 | 1b45f4e5 | Michael Hanselmann | # and thus requires these functions. To avoid code duplication, they're kept in
|
60 | 1b45f4e5 | Michael Hanselmann | # here.
|
61 | 1b45f4e5 | Michael Hanselmann | |
62 | 1b45f4e5 | Michael Hanselmann | def BuildVersion(major, minor, revision): |
63 | 1b45f4e5 | Michael Hanselmann | """Calculates int version number from major, minor and revision numbers.
|
64 | 1b45f4e5 | Michael Hanselmann |
|
65 | 1b45f4e5 | Michael Hanselmann | Returns: int representing version number
|
66 | 1b45f4e5 | Michael Hanselmann |
|
67 | 1b45f4e5 | Michael Hanselmann | """
|
68 | 1b45f4e5 | Michael Hanselmann | assert isinstance(major, int) |
69 | 1b45f4e5 | Michael Hanselmann | assert isinstance(minor, int) |
70 | 1b45f4e5 | Michael Hanselmann | assert isinstance(revision, int) |
71 | 1b45f4e5 | Michael Hanselmann | return (1000000 * major + |
72 | 1b45f4e5 | Michael Hanselmann | 10000 * minor +
|
73 | 1b45f4e5 | Michael Hanselmann | 1 * revision)
|
74 | 1b45f4e5 | Michael Hanselmann | |
75 | 1b45f4e5 | Michael Hanselmann | |
76 | 1b45f4e5 | Michael Hanselmann | def SplitVersion(version): |
77 | 1b45f4e5 | Michael Hanselmann | """Splits version number stored in an int.
|
78 | 1b45f4e5 | Michael Hanselmann |
|
79 | 1b45f4e5 | Michael Hanselmann | Returns: tuple; (major, minor, revision)
|
80 | 1b45f4e5 | Michael Hanselmann |
|
81 | 1b45f4e5 | Michael Hanselmann | """
|
82 | 1b45f4e5 | Michael Hanselmann | assert isinstance(version, int) |
83 | 1b45f4e5 | Michael Hanselmann | |
84 | 1b45f4e5 | Michael Hanselmann | (major, remainder) = divmod(version, 1000000) |
85 | 1b45f4e5 | Michael Hanselmann | (minor, revision) = divmod(remainder, 10000) |
86 | 1b45f4e5 | Michael Hanselmann | |
87 | 1b45f4e5 | Michael Hanselmann | return (major, minor, revision)
|
88 | 1b45f4e5 | Michael Hanselmann | |
89 | 1b45f4e5 | Michael Hanselmann | |
90 | 243cdbcc | Michael Hanselmann | CONFIG_MAJOR = int(_autoconf.VERSION_MAJOR)
|
91 | 243cdbcc | Michael Hanselmann | CONFIG_MINOR = int(_autoconf.VERSION_MINOR)
|
92 | 243cdbcc | Michael Hanselmann | CONFIG_REVISION = 0
|
93 | 1b45f4e5 | Michael Hanselmann | CONFIG_VERSION = BuildVersion(CONFIG_MAJOR, CONFIG_MINOR, CONFIG_REVISION) |
94 | a8083063 | Iustin Pop | |
95 | cc7d6f1a | Michael Hanselmann | #: RPC protocol version
|
96 | cc7d6f1a | Michael Hanselmann | PROTOCOL_VERSION = BuildVersion(CONFIG_MAJOR, CONFIG_MINOR, 0)
|
97 | cc7d6f1a | Michael Hanselmann | |
98 | 8b72b05c | René Nussbaumer | # user separation
|
99 | 8b72b05c | René Nussbaumer | DAEMONS_GROUP = _autoconf.DAEMONS_GROUP |
100 | f12e1736 | René Nussbaumer | ADMIN_GROUP = _autoconf.ADMIN_GROUP |
101 | 8b72b05c | René Nussbaumer | MASTERD_USER = _autoconf.MASTERD_USER |
102 | f12e1736 | René Nussbaumer | MASTERD_GROUP = _autoconf.MASTERD_GROUP |
103 | 8b72b05c | René Nussbaumer | RAPI_USER = _autoconf.RAPI_USER |
104 | f12e1736 | René Nussbaumer | RAPI_GROUP = _autoconf.RAPI_GROUP |
105 | f12e1736 | René Nussbaumer | CONFD_USER = _autoconf.CONFD_USER |
106 | f12e1736 | René Nussbaumer | CONFD_GROUP = _autoconf.CONFD_GROUP |
107 | f12e1736 | René Nussbaumer | NODED_USER = _autoconf.NODED_USER |
108 | 03881cb0 | René Nussbaumer | NODED_GROUP = _autoconf.NODED_GROUP |
109 | 052783ff | Michael Hanselmann | SSH_LOGIN_USER = _autoconf.SSH_LOGIN_USER |
110 | 052783ff | Michael Hanselmann | SSH_CONSOLE_USER = _autoconf.SSH_CONSOLE_USER |
111 | 8b72b05c | René Nussbaumer | |
112 | 7e7629c6 | Tsachy Shacham | # cpu pinning separators and constants
|
113 | 7e7629c6 | Tsachy Shacham | CPU_PINNING_SEP = ":"
|
114 | 7e7629c6 | Tsachy Shacham | CPU_PINNING_ALL = "all"
|
115 | 7e7629c6 | Tsachy Shacham | # internal representation of "all"
|
116 | 7e7629c6 | Tsachy Shacham | CPU_PINNING_ALL_VAL = -1
|
117 | bf5681c0 | Tsachy Shacham | # one "all" entry in a CPU list means CPU pinning is off
|
118 | bf5681c0 | Tsachy Shacham | CPU_PINNING_OFF = [CPU_PINNING_ALL_VAL] |
119 | 7e7629c6 | Tsachy Shacham | |
120 | 7e7629c6 | Tsachy Shacham | # A Xen-specific implementation detail - there is no way to actually say
|
121 | 7e7629c6 | Tsachy Shacham | # "use any cpu for pinning" in a Xen configuration file, as opposed to the
|
122 | 7e7629c6 | Tsachy Shacham | # command line, where you can say "xm vcpu-pin <domain> <vcpu> all".
|
123 | 7e7629c6 | Tsachy Shacham | # The workaround used in Xen is "0-63" (see source code function
|
124 | 7e7629c6 | Tsachy Shacham | # xm_vcpu_pin in <xen-source>/tools/python/xen/xm/main.py).
|
125 | 7e7629c6 | Tsachy Shacham | # To support future changes, the following constant is treated as a
|
126 | 7e7629c6 | Tsachy Shacham | # blackbox string that simply means use-any-cpu-for-pinning-under-xen.
|
127 | 7e7629c6 | Tsachy Shacham | CPU_PINNING_ALL_XEN = "0-63"
|
128 | a03fcb26 | René Nussbaumer | |
129 | bf5681c0 | Tsachy Shacham | # A KVM-specific implementation detail - the following value is used
|
130 | bf5681c0 | Tsachy Shacham | # to set CPU affinity to all processors (#0 through #31), per taskset
|
131 | bf5681c0 | Tsachy Shacham | # man page.
|
132 | 38ef0c2c | Michael Hanselmann | # FIXME: This only works for machines with up to 32 CPU cores
|
133 | bf5681c0 | Tsachy Shacham | CPU_PINNING_ALL_KVM = 0xFFFFFFFF
|
134 | bf5681c0 | Tsachy Shacham | |
135 | 6e991d0e | René Nussbaumer | # Wipe
|
136 | da63bb4e | René Nussbaumer | DD_CMD = "dd"
|
137 | a03fcb26 | René Nussbaumer | MAX_WIPE_CHUNK = 1024 # 1GB |
138 | a03fcb26 | René Nussbaumer | MIN_WIPE_CHUNK_PERCENT = 10
|
139 | a03fcb26 | René Nussbaumer | |
140 | 8b72b05c | René Nussbaumer | RUN_DIRS_MODE = 0775
|
141 | 5bae14d9 | Guido Trotter | SECURE_DIR_MODE = 0700
|
142 | 637c8ab8 | Balazs Lecz | SECURE_FILE_MODE = 0600
|
143 | b6135bbc | Apollon Oikonomopoulos | ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
|
144 | cb7c0198 | Iustin Pop | ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE |
145 | 4b97f902 | Apollon Oikonomopoulos | ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE |
146 | cd8b0072 | Iustin Pop | ENABLE_CONFD = _autoconf.ENABLE_CONFD |
147 | 42ab9ac4 | Iustin Pop | ENABLE_SPLIT_QUERY = _autoconf.ENABLE_SPLIT_QUERY |
148 | 1fdeb284 | Michael Hanselmann | ENABLE_RESTRICTED_COMMANDS = _autoconf.ENABLE_RESTRICTED_COMMANDS |
149 | 9894ece7 | Michael Hanselmann | |
150 | cd50653c | Guido Trotter | NODED = "ganeti-noded"
|
151 | 18679072 | Guido Trotter | CONFD = "ganeti-confd"
|
152 | 8c96d01f | Guido Trotter | RAPI = "ganeti-rapi"
|
153 | dae3fdd2 | Guido Trotter | MASTERD = "ganeti-masterd"
|
154 | cd50653c | Guido Trotter | |
155 | cd50653c | Guido Trotter | DAEMONS_PORTS = { |
156 | cd50653c | Guido Trotter | # daemon-name: ("proto", "default-port")
|
157 | cd50653c | Guido Trotter | NODED: ("tcp", 1811), |
158 | 18679072 | Guido Trotter | CONFD: ("udp", 1814), |
159 | 8c96d01f | Guido Trotter | RAPI: ("tcp", 5080), |
160 | 2089573e | René Nussbaumer | "ssh": ("tcp", 22), |
161 | cd50653c | Guido Trotter | } |
162 | cd50653c | Guido Trotter | DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
|
163 | 18679072 | Guido Trotter | DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
|
164 | 8c96d01f | Guido Trotter | DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
|
165 | cd50653c | Guido Trotter | |
166 | a8083063 | Iustin Pop | FIRST_DRBD_PORT = 11000
|
167 | a8083063 | Iustin Pop | LAST_DRBD_PORT = 14999
|
168 | a8083063 | Iustin Pop | |
169 | 3a6a89d7 | Michael Hanselmann | DAEMONS_LOGFILES = { |
170 | 3a6a89d7 | Michael Hanselmann | NODED: pathutils.GetLogFilename("node-daemon"),
|
171 | 3a6a89d7 | Michael Hanselmann | CONFD: pathutils.GetLogFilename("conf-daemon"),
|
172 | 3a6a89d7 | Michael Hanselmann | RAPI: pathutils.GetLogFilename("rapi-daemon"),
|
173 | 3a6a89d7 | Michael Hanselmann | MASTERD: pathutils.GetLogFilename("master-daemon"),
|
174 | 3a6a89d7 | Michael Hanselmann | } |
175 | 3a6a89d7 | Michael Hanselmann | |
176 | 481d47e8 | Luca Bigliardi | DEV_CONSOLE = "/dev/console"
|
177 | 481d47e8 | Luca Bigliardi | |
178 | 1b045f5d | Balazs Lecz | PROC_MOUNTS = "/proc/mounts"
|
179 | 1b045f5d | Balazs Lecz | |
180 | 3d5ebbf0 | Stephen Shirley | # Local UniX Interface related constants
|
181 | 25942a6c | Guido Trotter | LUXI_EOM = "\3"
|
182 | e986f20c | Michael Hanselmann | LUXI_VERSION = CONFIG_VERSION |
183 | 25942a6c | Guido Trotter | |
184 | d0c8c01d | Iustin Pop | # one of "no", "yes", "only"
|
185 | 551b6283 | Iustin Pop | SYSLOG_USAGE = _autoconf.SYSLOG_USAGE |
186 | 551b6283 | Iustin Pop | SYSLOG_NO = "no"
|
187 | 551b6283 | Iustin Pop | SYSLOG_YES = "yes"
|
188 | 551b6283 | Iustin Pop | SYSLOG_ONLY = "only"
|
189 | 551b6283 | Iustin Pop | SYSLOG_SOCKET = "/dev/log"
|
190 | 551b6283 | Iustin Pop | |
191 | a8083063 | Iustin Pop | EXPORT_CONF_FILE = "config.ini"
|
192 | a8083063 | Iustin Pop | |
193 | 2f2dbb4b | Jun Futagawa | XEN_BOOTLOADER = _autoconf.XEN_BOOTLOADER |
194 | f00b46bc | Michael Hanselmann | XEN_KERNEL = _autoconf.XEN_KERNEL |
195 | f00b46bc | Michael Hanselmann | XEN_INITRD = _autoconf.XEN_INITRD |
196 | 0625d08f | René Nussbaumer | XEN_CMD_XM = "xm"
|
197 | 0625d08f | René Nussbaumer | XEN_CMD_XL = "xl"
|
198 | 0625d08f | René Nussbaumer | # FIXME: This will be made configurable using hvparams in Ganeti 2.7
|
199 | 0625d08f | René Nussbaumer | XEN_CMD = _autoconf.XEN_CMD |
200 | 053c356a | Guido Trotter | # When the Xen toolstack used is "xl", live migration requires the source host
|
201 | 053c356a | Guido Trotter | # to connect to the target host via ssh (xl runs this command). We need to pass
|
202 | 053c356a | Guido Trotter | # the command xl runs some extra info so that it can use Ganeti's key
|
203 | 053c356a | Guido Trotter | # verification and not fail. Note that this string is incomplete: it must be
|
204 | 053c356a | Guido Trotter | # filled with the cluster name before being used.
|
205 | f215debf | Guido Trotter | XL_SSH_CMD = ("ssh -l %s -oGlobalKnownHostsFile=%s"
|
206 | 053c356a | Guido Trotter | " -oUserKnownHostsFile=/dev/null"
|
207 | 053c356a | Guido Trotter | " -oCheckHostIp=no -oStrictHostKeyChecking=yes"
|
208 | f215debf | Guido Trotter | " -oHostKeyAlias=%%s") % (SSH_LOGIN_USER,
|
209 | f215debf | Guido Trotter | pathutils.SSH_KNOWN_HOSTS_FILE) |
210 | f00b46bc | Michael Hanselmann | |
211 | 7e2c5b9e | Guido Trotter | KVM_PATH = _autoconf.KVM_PATH |
212 | b8203e1e | Iustin Pop | KVM_KERNEL = _autoconf.KVM_KERNEL |
213 | 14aa53cb | Guido Trotter | SOCAT_PATH = _autoconf.SOCAT_PATH |
214 | fe5b0c42 | Michael Hanselmann | SOCAT_USE_ESCAPE = _autoconf.SOCAT_USE_ESCAPE |
215 | e90739d6 | Michael Hanselmann | SOCAT_USE_COMPRESS = _autoconf.SOCAT_USE_COMPRESS |
216 | 86d6bc2a | Guido Trotter | SOCAT_ESCAPE_CODE = "0x1d"
|
217 | 7e2c5b9e | Guido Trotter | |
218 | 25ce3ec4 | Michael Hanselmann | #: Console as SSH command
|
219 | 25ce3ec4 | Michael Hanselmann | CONS_SSH = "ssh"
|
220 | 25ce3ec4 | Michael Hanselmann | |
221 | 25ce3ec4 | Michael Hanselmann | #: Console as VNC server
|
222 | 25ce3ec4 | Michael Hanselmann | CONS_VNC = "vnc"
|
223 | 25ce3ec4 | Michael Hanselmann | |
224 | 4d2cdb5a | Andrea Spadaccini | #: Console as SPICE server
|
225 | 4d2cdb5a | Andrea Spadaccini | CONS_SPICE = "spice"
|
226 | 4d2cdb5a | Andrea Spadaccini | |
227 | 25ce3ec4 | Michael Hanselmann | #: Display a message for console access
|
228 | 25ce3ec4 | Michael Hanselmann | CONS_MESSAGE = "msg"
|
229 | 25ce3ec4 | Michael Hanselmann | |
230 | 25ce3ec4 | Michael Hanselmann | #: All console types
|
231 | b8028dcf | Michael Hanselmann | CONS_ALL = compat.UniqueFrozenset([ |
232 | b8028dcf | Michael Hanselmann | CONS_SSH, |
233 | b8028dcf | Michael Hanselmann | CONS_VNC, |
234 | b8028dcf | Michael Hanselmann | CONS_SPICE, |
235 | b8028dcf | Michael Hanselmann | CONS_MESSAGE, |
236 | b8028dcf | Michael Hanselmann | ]) |
237 | 25ce3ec4 | Michael Hanselmann | |
238 | bdd5e420 | Michael Hanselmann | # For RSA keys more bits are better, but they also make operations more
|
239 | bdd5e420 | Michael Hanselmann | # expensive. NIST SP 800-131 recommends a minimum of 2048 bits from the year
|
240 | bdd5e420 | Michael Hanselmann | # 2010 on.
|
241 | bdd5e420 | Michael Hanselmann | RSA_KEY_BITS = 2048
|
242 | bdd5e420 | Michael Hanselmann | |
243 | 971bbd84 | Michael Hanselmann | # Ciphers allowed for SSL connections. For the format, see ciphers(1). A better
|
244 | 971bbd84 | Michael Hanselmann | # way to disable ciphers would be to use the exclamation mark (!), but socat
|
245 | 971bbd84 | Michael Hanselmann | # versions below 1.5 can't parse exclamation marks in options properly. When
|
246 | 7407c2d5 | Adeodato Simo | # modifying the ciphers, ensure not to accidentially add something after it's
|
247 | 971bbd84 | Michael Hanselmann | # been removed. Use the "openssl" utility to check the allowed ciphers, e.g.
|
248 | 971bbd84 | Michael Hanselmann | # "openssl ciphers -v HIGH:-DES".
|
249 | 971bbd84 | Michael Hanselmann | OPENSSL_CIPHERS = "HIGH:-DES:-3DES:-EXPORT:-ADH"
|
250 | 971bbd84 | Michael Hanselmann | |
251 | bdd5e420 | Michael Hanselmann | # Digest used to sign certificates ("openssl x509" uses SHA1 by default)
|
252 | bdd5e420 | Michael Hanselmann | X509_CERT_SIGN_DIGEST = "SHA1"
|
253 | bdd5e420 | Michael Hanselmann | |
254 | 600535f0 | Manuel Franceschini | # Default validity of certificates in days
|
255 | 600535f0 | Manuel Franceschini | X509_CERT_DEFAULT_VALIDITY = 365 * 5 |
256 | 600535f0 | Manuel Franceschini | |
257 | 600535f0 | Manuel Franceschini | # commonName (CN) used in certificates
|
258 | 600535f0 | Manuel Franceschini | X509_CERT_CN = "ganeti.example.com"
|
259 | 600535f0 | Manuel Franceschini | |
260 | 68857643 | Michael Hanselmann | X509_CERT_SIGNATURE_HEADER = "X-Ganeti-Signature"
|
261 | 68857643 | Michael Hanselmann | |
262 | 2d76b580 | Michael Hanselmann | # Import/export daemon mode
|
263 | 2d76b580 | Michael Hanselmann | IEM_IMPORT = "import"
|
264 | 2d76b580 | Michael Hanselmann | IEM_EXPORT = "export"
|
265 | 2d76b580 | Michael Hanselmann | |
266 | 7e3c1da6 | Michael Hanselmann | # Import/export transport compression
|
267 | 7e3c1da6 | Michael Hanselmann | IEC_NONE = "none"
|
268 | 7e3c1da6 | Michael Hanselmann | IEC_GZIP = "gzip"
|
269 | b8028dcf | Michael Hanselmann | IEC_ALL = compat.UniqueFrozenset([ |
270 | 7e3c1da6 | Michael Hanselmann | IEC_NONE, |
271 | 7e3c1da6 | Michael Hanselmann | IEC_GZIP, |
272 | 7e3c1da6 | Michael Hanselmann | ]) |
273 | 7e3c1da6 | Michael Hanselmann | |
274 | f9323011 | Michael Hanselmann | IE_CUSTOM_SIZE = "fd"
|
275 | f9323011 | Michael Hanselmann | |
276 | 1d3dfa29 | Michael Hanselmann | IE_MAGIC_RE = re.compile(r"^[-_.a-zA-Z0-9]{5,100}$")
|
277 | 1d3dfa29 | Michael Hanselmann | |
278 | 1651d116 | Michael Hanselmann | # Import/export I/O
|
279 | 1651d116 | Michael Hanselmann | # Direct file I/O, equivalent to a shell's I/O redirection using '<' or '>'
|
280 | 1651d116 | Michael Hanselmann | IEIO_FILE = "file"
|
281 | 1651d116 | Michael Hanselmann | # Raw block device I/O using "dd"
|
282 | 1651d116 | Michael Hanselmann | IEIO_RAW_DISK = "raw"
|
283 | 1651d116 | Michael Hanselmann | # OS definition import/export script
|
284 | 1651d116 | Michael Hanselmann | IEIO_SCRIPT = "script"
|
285 | 1651d116 | Michael Hanselmann | |
286 | 973d7867 | Iustin Pop | VALUE_DEFAULT = "default"
|
287 | 4c566ede | Guido Trotter | VALUE_AUTO = "auto"
|
288 | 4c566ede | Guido Trotter | VALUE_GENERATE = "generate"
|
289 | 973d7867 | Iustin Pop | VALUE_NONE = "none"
|
290 | 1817f49b | Guido Trotter | VALUE_TRUE = "true"
|
291 | 1817f49b | Guido Trotter | VALUE_FALSE = "false"
|
292 | 973d7867 | Iustin Pop | |
293 | 4fe80ef2 | Iustin Pop | # External script validation mask
|
294 | 4fe80ef2 | Iustin Pop | EXT_PLUGIN_MASK = re.compile("^[a-zA-Z0-9_-]+$")
|
295 | 4fe80ef2 | Iustin Pop | |
296 | a8083063 | Iustin Pop | # hooks-related constants
|
297 | a8083063 | Iustin Pop | HOOKS_PHASE_PRE = "pre"
|
298 | a8083063 | Iustin Pop | HOOKS_PHASE_POST = "post"
|
299 | 6a4aa7c1 | Iustin Pop | HOOKS_NAME_CFGUPDATE = "config-update"
|
300 | 9e289e36 | Guido Trotter | HOOKS_NAME_WATCHER = "watcher"
|
301 | f3e2e4c6 | Iustin Pop | HOOKS_VERSION = 2
|
302 | fe5ca2bb | Andrea Spadaccini | HOOKS_PATH = "/sbin:/bin:/usr/sbin:/usr/bin"
|
303 | a8083063 | Iustin Pop | |
304 | a8083063 | Iustin Pop | # hooks subject type (what object type does the LU deal with)
|
305 | a8083063 | Iustin Pop | HTYPE_CLUSTER = "CLUSTER"
|
306 | a8083063 | Iustin Pop | HTYPE_NODE = "NODE"
|
307 | b1ee5610 | Adeodato Simo | HTYPE_GROUP = "GROUP"
|
308 | a8083063 | Iustin Pop | HTYPE_INSTANCE = "INSTANCE"
|
309 | eaa4c57c | Dimitris Aragiorgis | HTYPE_NETWORK = "NETWORK"
|
310 | a8083063 | Iustin Pop | |
311 | a8083063 | Iustin Pop | HKR_SKIP = 0
|
312 | a8083063 | Iustin Pop | HKR_FAIL = 1
|
313 | a8083063 | Iustin Pop | HKR_SUCCESS = 2
|
314 | a8083063 | Iustin Pop | |
315 | ac2d0fe4 | Michael Hanselmann | # Storage types
|
316 | ac2d0fe4 | Michael Hanselmann | ST_FILE = "file"
|
317 | ac2d0fe4 | Michael Hanselmann | ST_LVM_PV = "lvm-pv"
|
318 | ac2d0fe4 | Michael Hanselmann | ST_LVM_VG = "lvm-vg"
|
319 | 6032697c | Michael Hanselmann | |
320 | 6032697c | Michael Hanselmann | # Storage fields
|
321 | 620a85fd | Iustin Pop | # first two are valid in LU context only, not passed to backend
|
322 | 620a85fd | Iustin Pop | SF_NODE = "node"
|
323 | 620a85fd | Iustin Pop | SF_TYPE = "type"
|
324 | 620a85fd | Iustin Pop | # and the rest are valid in backend
|
325 | 6032697c | Michael Hanselmann | SF_NAME = "name"
|
326 | 6032697c | Michael Hanselmann | SF_SIZE = "size"
|
327 | 6032697c | Michael Hanselmann | SF_FREE = "free"
|
328 | 6032697c | Michael Hanselmann | SF_USED = "used"
|
329 | 6032697c | Michael Hanselmann | SF_ALLOCATABLE = "allocatable"
|
330 | 6032697c | Michael Hanselmann | |
331 | 6c3c6db9 | Michael Hanselmann | # Storage operations
|
332 | 6c3c6db9 | Michael Hanselmann | SO_FIX_CONSISTENCY = "fix-consistency"
|
333 | 6c3c6db9 | Michael Hanselmann | |
334 | 6032697c | Michael Hanselmann | # Available fields per storage type
|
335 | b8028dcf | Michael Hanselmann | VALID_STORAGE_FIELDS = compat.UniqueFrozenset([ |
336 | 21daa4a8 | Stephen Shirley | SF_NAME, |
337 | 21daa4a8 | Stephen Shirley | SF_TYPE, |
338 | 21daa4a8 | Stephen Shirley | SF_SIZE, |
339 | 21daa4a8 | Stephen Shirley | SF_USED, |
340 | 21daa4a8 | Stephen Shirley | SF_FREE, |
341 | 3c286190 | Dimitris Aragiorgis | SF_ALLOCATABLE, |
342 | 21daa4a8 | Stephen Shirley | ]) |
343 | 620a85fd | Iustin Pop | |
344 | b8028dcf | Michael Hanselmann | VALID_STORAGE_TYPES = compat.UniqueFrozenset([ |
345 | b8028dcf | Michael Hanselmann | ST_FILE, |
346 | b8028dcf | Michael Hanselmann | ST_LVM_PV, |
347 | b8028dcf | Michael Hanselmann | ST_LVM_VG, |
348 | b8028dcf | Michael Hanselmann | ]) |
349 | a8083063 | Iustin Pop | |
350 | efb8da02 | Michael Hanselmann | MODIFIABLE_STORAGE_FIELDS = { |
351 | efb8da02 | Michael Hanselmann | ST_LVM_PV: frozenset([SF_ALLOCATABLE]),
|
352 | efb8da02 | Michael Hanselmann | } |
353 | efb8da02 | Michael Hanselmann | |
354 | 4b37cac5 | Michael Hanselmann | VALID_STORAGE_OPERATIONS = { |
355 | 6c3c6db9 | Michael Hanselmann | ST_LVM_VG: frozenset([SO_FIX_CONSISTENCY]),
|
356 | 4b37cac5 | Michael Hanselmann | } |
357 | 4b37cac5 | Michael Hanselmann | |
358 | 74f37195 | Michael Hanselmann | # Local disk status
|
359 | 74f37195 | Michael Hanselmann | # Note: Code depends on LDS_OKAY < LDS_UNKNOWN < LDS_FAULTY
|
360 | 74f37195 | Michael Hanselmann | (LDS_OKAY, |
361 | 74f37195 | Michael Hanselmann | LDS_UNKNOWN, |
362 | 74f37195 | Michael Hanselmann | LDS_FAULTY) = range(1, 4) |
363 | 74f37195 | Michael Hanselmann | |
364 | a8083063 | Iustin Pop | # disk template types
|
365 | a8083063 | Iustin Pop | DT_DISKLESS = "diskless"
|
366 | a8083063 | Iustin Pop | DT_PLAIN = "plain"
|
367 | a1f445d3 | Iustin Pop | DT_DRBD8 = "drbd"
|
368 | 04fa07f2 | Manuel Franceschini | DT_FILE = "file"
|
369 | 4b97f902 | Apollon Oikonomopoulos | DT_SHARED_FILE = "sharedfile"
|
370 | b6135bbc | Apollon Oikonomopoulos | DT_BLOCK = "blockdev"
|
371 | 7181fba0 | Constantinos Venetsanopoulos | DT_RBD = "rbd"
|
372 | 376631d1 | Constantinos Venetsanopoulos | DT_EXT = "ext"
|
373 | a1f445d3 | Iustin Pop | |
374 | a1f445d3 | Iustin Pop | # the set of network-mirrored disk templates
|
375 | b8028dcf | Michael Hanselmann | DTS_INT_MIRROR = compat.UniqueFrozenset([DT_DRBD8]) |
376 | a8083063 | Iustin Pop | |
377 | b6135bbc | Apollon Oikonomopoulos | # the set of externally-mirrored disk templates (e.g. SAN, NAS)
|
378 | b8028dcf | Michael Hanselmann | DTS_EXT_MIRROR = compat.UniqueFrozenset([ |
379 | b8028dcf | Michael Hanselmann | DT_SHARED_FILE, |
380 | b8028dcf | Michael Hanselmann | DT_BLOCK, |
381 | b8028dcf | Michael Hanselmann | DT_RBD, |
382 | 376631d1 | Constantinos Venetsanopoulos | DT_EXT, |
383 | b8028dcf | Michael Hanselmann | ]) |
384 | 4b97f902 | Apollon Oikonomopoulos | |
385 | d63e148a | Manuel Franceschini | # the set of non-lvm-based disk templates
|
386 | b8028dcf | Michael Hanselmann | DTS_NOT_LVM = compat.UniqueFrozenset([ |
387 | b8028dcf | Michael Hanselmann | DT_DISKLESS, |
388 | b8028dcf | Michael Hanselmann | DT_FILE, |
389 | b8028dcf | Michael Hanselmann | DT_SHARED_FILE, |
390 | b8028dcf | Michael Hanselmann | DT_BLOCK, |
391 | b8028dcf | Michael Hanselmann | DT_RBD, |
392 | 376631d1 | Constantinos Venetsanopoulos | DT_EXT, |
393 | b8028dcf | Michael Hanselmann | ]) |
394 | d63e148a | Manuel Franceschini | |
395 | 728489a3 | Guido Trotter | # the set of disk templates which can be grown
|
396 | b8028dcf | Michael Hanselmann | DTS_GROWABLE = compat.UniqueFrozenset([ |
397 | b8028dcf | Michael Hanselmann | DT_PLAIN, |
398 | b8028dcf | Michael Hanselmann | DT_DRBD8, |
399 | b8028dcf | Michael Hanselmann | DT_FILE, |
400 | b8028dcf | Michael Hanselmann | DT_SHARED_FILE, |
401 | b8028dcf | Michael Hanselmann | DT_RBD, |
402 | 376631d1 | Constantinos Venetsanopoulos | DT_EXT, |
403 | b8028dcf | Michael Hanselmann | ]) |
404 | 728489a3 | Guido Trotter | |
405 | 3b08cd1c | Apollon Oikonomopoulos | # the set of disk templates that allow adoption
|
406 | b8028dcf | Michael Hanselmann | DTS_MAY_ADOPT = compat.UniqueFrozenset([ |
407 | b8028dcf | Michael Hanselmann | DT_PLAIN, |
408 | b8028dcf | Michael Hanselmann | DT_BLOCK, |
409 | b8028dcf | Michael Hanselmann | ]) |
410 | b6135bbc | Apollon Oikonomopoulos | |
411 | b6135bbc | Apollon Oikonomopoulos | # the set of disk templates that *must* use adoption
|
412 | b8028dcf | Michael Hanselmann | DTS_MUST_ADOPT = compat.UniqueFrozenset([DT_BLOCK]) |
413 | 3b08cd1c | Apollon Oikonomopoulos | |
414 | 85a0ff7e | Apollon Oikonomopoulos | # the set of disk templates that allow migrations
|
415 | 3429a076 | Apollon Oikonomopoulos | DTS_MIRRORED = frozenset.union(DTS_INT_MIRROR, DTS_EXT_MIRROR)
|
416 | 85a0ff7e | Apollon Oikonomopoulos | |
417 | c16915bd | Guido Trotter | # the set of file based disk templates
|
418 | b8028dcf | Michael Hanselmann | DTS_FILEBASED = compat.UniqueFrozenset([ |
419 | b8028dcf | Michael Hanselmann | DT_FILE, |
420 | b8028dcf | Michael Hanselmann | DT_SHARED_FILE, |
421 | b8028dcf | Michael Hanselmann | ]) |
422 | 85a0ff7e | Apollon Oikonomopoulos | |
423 | fe96220b | Iustin Pop | # logical disk types
|
424 | fe96220b | Iustin Pop | LD_LV = "lvm"
|
425 | a1f445d3 | Iustin Pop | LD_DRBD8 = "drbd8"
|
426 | 04fa07f2 | Manuel Franceschini | LD_FILE = "file"
|
427 | b6135bbc | Apollon Oikonomopoulos | LD_BLOCKDEV = "blockdev"
|
428 | 7181fba0 | Constantinos Venetsanopoulos | LD_RBD = "rbd"
|
429 | 376631d1 | Constantinos Venetsanopoulos | LD_EXT = "ext"
|
430 | b8028dcf | Michael Hanselmann | LOGICAL_DISK_TYPES = compat.UniqueFrozenset([ |
431 | bc5d0215 | Andrea Spadaccini | LD_LV, |
432 | bc5d0215 | Andrea Spadaccini | LD_DRBD8, |
433 | bc5d0215 | Andrea Spadaccini | LD_FILE, |
434 | bc5d0215 | Andrea Spadaccini | LD_BLOCKDEV, |
435 | 7181fba0 | Constantinos Venetsanopoulos | LD_RBD, |
436 | 376631d1 | Constantinos Venetsanopoulos | LD_EXT, |
437 | bc5d0215 | Andrea Spadaccini | ]) |
438 | bc5d0215 | Andrea Spadaccini | |
439 | b8028dcf | Michael Hanselmann | LDS_BLOCK = compat.UniqueFrozenset([ |
440 | b8028dcf | Michael Hanselmann | LD_LV, |
441 | b8028dcf | Michael Hanselmann | LD_DRBD8, |
442 | b8028dcf | Michael Hanselmann | LD_BLOCKDEV, |
443 | b8028dcf | Michael Hanselmann | LD_RBD, |
444 | 376631d1 | Constantinos Venetsanopoulos | LD_EXT, |
445 | b8028dcf | Michael Hanselmann | ]) |
446 | 04fa07f2 | Manuel Franceschini | |
447 | 2899d9de | Iustin Pop | # drbd constants
|
448 | 2899d9de | Iustin Pop | DRBD_HMAC_ALG = "md5"
|
449 | 3c03759a | Iustin Pop | DRBD_NET_PROTOCOL = "C"
|
450 | 61e062dd | Michele Tartara | DRBD_STATUS_FILE = "/proc/drbd"
|
451 | 8a69b3a8 | Andrea Spadaccini | |
452 | 0c77c331 | René Nussbaumer | #: Size of DRBD meta block device
|
453 | 0c77c331 | René Nussbaumer | DRBD_META_SIZE = 128
|
454 | 0c77c331 | René Nussbaumer | |
455 | 8a69b3a8 | Andrea Spadaccini | # drbd barrier types
|
456 | 8a69b3a8 | Andrea Spadaccini | DRBD_B_NONE = "n"
|
457 | 8a69b3a8 | Andrea Spadaccini | DRBD_B_DISK_BARRIERS = "b"
|
458 | 8a69b3a8 | Andrea Spadaccini | DRBD_B_DISK_DRAIN = "d"
|
459 | 8a69b3a8 | Andrea Spadaccini | DRBD_B_DISK_FLUSH = "f"
|
460 | 8a69b3a8 | Andrea Spadaccini | |
461 | 8a69b3a8 | Andrea Spadaccini | # Valid barrier combinations: "n" or any non-null subset of "bfd"
|
462 | b8028dcf | Michael Hanselmann | DRBD_VALID_BARRIER_OPT = compat.UniqueFrozenset([ |
463 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_NONE]),
|
464 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_BARRIERS]),
|
465 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_DRAIN]),
|
466 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_FLUSH]),
|
467 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_DRAIN, DRBD_B_DISK_FLUSH]),
|
468 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_DRAIN]),
|
469 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH]),
|
470 | 8a69b3a8 | Andrea Spadaccini | frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH, DRBD_B_DISK_DRAIN]),
|
471 | 8a69b3a8 | Andrea Spadaccini | ]) |
472 | 2899d9de | Iustin Pop | |
473 | 7181fba0 | Constantinos Venetsanopoulos | # rbd tool command
|
474 | 7181fba0 | Constantinos Venetsanopoulos | RBD_CMD = "rbd"
|
475 | 7181fba0 | Constantinos Venetsanopoulos | |
476 | 04fa07f2 | Manuel Franceschini | # file backend driver
|
477 | 04fa07f2 | Manuel Franceschini | FD_LOOP = "loop"
|
478 | 04fa07f2 | Manuel Franceschini | FD_BLKTAP = "blktap"
|
479 | a1f445d3 | Iustin Pop | |
480 | a1f445d3 | Iustin Pop | # the set of drbd-like disk types
|
481 | b8028dcf | Michael Hanselmann | LDS_DRBD = compat.UniqueFrozenset([LD_DRBD8]) |
482 | fe96220b | Iustin Pop | |
483 | 08db7c5c | Iustin Pop | # disk access mode
|
484 | 24991749 | Iustin Pop | DISK_RDONLY = "ro"
|
485 | 24991749 | Iustin Pop | DISK_RDWR = "rw"
|
486 | b8028dcf | Michael Hanselmann | DISK_ACCESS_SET = compat.UniqueFrozenset([DISK_RDONLY, DISK_RDWR]) |
487 | 08db7c5c | Iustin Pop | |
488 | a9e0c397 | Iustin Pop | # disk replacement mode
|
489 | cfacfd6e | Iustin Pop | REPLACE_DISK_PRI = "replace_on_primary" # replace disks on primary |
490 | cfacfd6e | Iustin Pop | REPLACE_DISK_SEC = "replace_on_secondary" # replace disks on secondary |
491 | cfacfd6e | Iustin Pop | REPLACE_DISK_CHG = "replace_new_secondary" # change secondary node |
492 | 942be002 | Michael Hanselmann | REPLACE_DISK_AUTO = "replace_auto"
|
493 | b8028dcf | Michael Hanselmann | REPLACE_MODES = compat.UniqueFrozenset([ |
494 | 3636400f | Iustin Pop | REPLACE_DISK_PRI, |
495 | 3636400f | Iustin Pop | REPLACE_DISK_SEC, |
496 | 3636400f | Iustin Pop | REPLACE_DISK_CHG, |
497 | 3636400f | Iustin Pop | REPLACE_DISK_AUTO, |
498 | 3636400f | Iustin Pop | ]) |
499 | a9e0c397 | Iustin Pop | |
500 | 4a96f1d1 | Michael Hanselmann | # Instance export mode
|
501 | 4a96f1d1 | Michael Hanselmann | EXPORT_MODE_LOCAL = "local"
|
502 | 4a96f1d1 | Michael Hanselmann | EXPORT_MODE_REMOTE = "remote"
|
503 | b8028dcf | Michael Hanselmann | EXPORT_MODES = compat.UniqueFrozenset([ |
504 | 4a96f1d1 | Michael Hanselmann | EXPORT_MODE_LOCAL, |
505 | 4a96f1d1 | Michael Hanselmann | EXPORT_MODE_REMOTE, |
506 | 4a96f1d1 | Michael Hanselmann | ]) |
507 | 4a96f1d1 | Michael Hanselmann | |
508 | 2f6eebee | Guido Trotter | # instance creation modes
|
509 | a8083063 | Iustin Pop | INSTANCE_CREATE = "create"
|
510 | a8083063 | Iustin Pop | INSTANCE_IMPORT = "import"
|
511 | 9bf56d77 | Michael Hanselmann | INSTANCE_REMOTE_IMPORT = "remote-import"
|
512 | b8028dcf | Michael Hanselmann | INSTANCE_CREATE_MODES = compat.UniqueFrozenset([ |
513 | 9bf56d77 | Michael Hanselmann | INSTANCE_CREATE, |
514 | 9bf56d77 | Michael Hanselmann | INSTANCE_IMPORT, |
515 | 9bf56d77 | Michael Hanselmann | INSTANCE_REMOTE_IMPORT, |
516 | 9bf56d77 | Michael Hanselmann | ]) |
517 | a8083063 | Iustin Pop | |
518 | 1410fa8d | Michael Hanselmann | # Remote import/export handshake message and version
|
519 | 1410fa8d | Michael Hanselmann | RIE_VERSION = 0
|
520 | 1410fa8d | Michael Hanselmann | RIE_HANDSHAKE = "Hi, I'm Ganeti"
|
521 | 1410fa8d | Michael Hanselmann | |
522 | 1410fa8d | Michael Hanselmann | # Remote import/export certificate validity in seconds
|
523 | 1410fa8d | Michael Hanselmann | RIE_CERT_VALIDITY = 24 * 60 * 60 |
524 | 1410fa8d | Michael Hanselmann | |
525 | 4478301b | Michael Hanselmann | # Overall timeout for establishing connection
|
526 | 8fd2e34c | Michael Hanselmann | RIE_CONNECT_TIMEOUT = 180
|
527 | 4a96f1d1 | Michael Hanselmann | |
528 | 4478301b | Michael Hanselmann | # Export only: how long to wait per connection attempt (seconds)
|
529 | 4478301b | Michael Hanselmann | RIE_CONNECT_ATTEMPT_TIMEOUT = 20
|
530 | 4478301b | Michael Hanselmann | |
531 | 4478301b | Michael Hanselmann | # Export only: number of attempts to connect
|
532 | 4478301b | Michael Hanselmann | RIE_CONNECT_RETRIES = 10
|
533 | 4478301b | Michael Hanselmann | |
534 | c74cda62 | René Nussbaumer | #: Give child process up to 5 seconds to exit after sending a signal
|
535 | c74cda62 | René Nussbaumer | CHILD_LINGER_TIMEOUT = 5.0
|
536 | 4a96f1d1 | Michael Hanselmann | |
537 | b8028dcf | Michael Hanselmann | DISK_TEMPLATES = compat.UniqueFrozenset([ |
538 | 21daa4a8 | Stephen Shirley | DT_DISKLESS, |
539 | 21daa4a8 | Stephen Shirley | DT_PLAIN, |
540 | 21daa4a8 | Stephen Shirley | DT_DRBD8, |
541 | 21daa4a8 | Stephen Shirley | DT_FILE, |
542 | 21daa4a8 | Stephen Shirley | DT_SHARED_FILE, |
543 | 7181fba0 | Constantinos Venetsanopoulos | DT_BLOCK, |
544 | 3c286190 | Dimitris Aragiorgis | DT_RBD, |
545 | 376631d1 | Constantinos Venetsanopoulos | DT_EXT |
546 | 21daa4a8 | Stephen Shirley | ]) |
547 | 04fa07f2 | Manuel Franceschini | |
548 | b8028dcf | Michael Hanselmann | FILE_DRIVER = compat.UniqueFrozenset([FD_LOOP, FD_BLKTAP]) |
549 | a8083063 | Iustin Pop | |
550 | a8083063 | Iustin Pop | # import/export config options
|
551 | a8083063 | Iustin Pop | INISECT_EXP = "export"
|
552 | a8083063 | Iustin Pop | INISECT_INS = "instance"
|
553 | 3c8954ad | Iustin Pop | INISECT_HYP = "hypervisor"
|
554 | 3c8954ad | Iustin Pop | INISECT_BEP = "backend"
|
555 | 535b49cb | Iustin Pop | INISECT_OSP = "os"
|
556 | 38242904 | Iustin Pop | |
557 | 24991749 | Iustin Pop | # dynamic device modification
|
558 | 61a14bb3 | Iustin Pop | DDM_ADD = "add"
|
559 | bf629e45 | Michael Hanselmann | DDM_MODIFY = "modify"
|
560 | 61a14bb3 | Iustin Pop | DDM_REMOVE = "remove"
|
561 | b8028dcf | Michael Hanselmann | DDMS_VALUES = compat.UniqueFrozenset([DDM_ADD, DDM_REMOVE]) |
562 | bf629e45 | Michael Hanselmann | DDMS_VALUES_WITH_MODIFY = (DDMS_VALUES | frozenset([
|
563 | bf629e45 | Michael Hanselmann | DDM_MODIFY, |
564 | bf629e45 | Michael Hanselmann | ])) |
565 | bf629e45 | Michael Hanselmann | # TODO: DDM_SWAP, DDM_MOVE?
|
566 | 24991749 | Iustin Pop | |
567 | 38242904 | Iustin Pop | # common exit codes
|
568 | a5bc662a | Iustin Pop | EXIT_SUCCESS = 0
|
569 | 438b45d4 | Michael Hanselmann | EXIT_FAILURE = 1
|
570 | 46479775 | Guido Trotter | EXIT_NOTCLUSTER = 5
|
571 | 38242904 | Iustin Pop | EXIT_NOTMASTER = 11
|
572 | 619fdc8e | Iustin Pop | EXIT_NODESETUP_ERROR = 12
|
573 | a5bc662a | Iustin Pop | EXIT_CONFIRMATION = 13 # need user confirmation |
574 | cf62a272 | Michael Hanselmann | |
575 | ee3aedff | Michael Hanselmann | #: Exit code for query operations with unknown fields
|
576 | ee3aedff | Michael Hanselmann | EXIT_UNKNOWN_FIELD = 14
|
577 | ee3aedff | Michael Hanselmann | |
578 | 5c947f38 | Iustin Pop | # tags
|
579 | 5c947f38 | Iustin Pop | TAG_CLUSTER = "cluster"
|
580 | 1ffd2673 | Michael Hanselmann | TAG_NODEGROUP = "nodegroup"
|
581 | 5c947f38 | Iustin Pop | TAG_NODE = "node"
|
582 | 5c947f38 | Iustin Pop | TAG_INSTANCE = "instance"
|
583 | 8140e24f | Dimitris Aragiorgis | TAG_NETWORK = "network"
|
584 | b8028dcf | Michael Hanselmann | VALID_TAG_TYPES = compat.UniqueFrozenset([ |
585 | 3636400f | Iustin Pop | TAG_CLUSTER, |
586 | 1ffd2673 | Michael Hanselmann | TAG_NODEGROUP, |
587 | 3636400f | Iustin Pop | TAG_NODE, |
588 | 3636400f | Iustin Pop | TAG_INSTANCE, |
589 | 8140e24f | Dimitris Aragiorgis | TAG_NETWORK, |
590 | 3636400f | Iustin Pop | ]) |
591 | 5c947f38 | Iustin Pop | MAX_TAG_LEN = 128
|
592 | 5c947f38 | Iustin Pop | MAX_TAGS_PER_OBJ = 4096
|
593 | 5c947f38 | Iustin Pop | |
594 | cf62a272 | Michael Hanselmann | # others
|
595 | cf62a272 | Michael Hanselmann | DEFAULT_BRIDGE = "xen-br0"
|
596 | 6e9814a1 | Andrea Spadaccini | CLASSIC_DRBD_SYNC_SPEED = 60 * 1024 # 60 MiB, expressed in KiB |
597 | 9769bb78 | Manuel Franceschini | IP4_ADDRESS_LOCALHOST = "127.0.0.1"
|
598 | 9769bb78 | Manuel Franceschini | IP4_ADDRESS_ANY = "0.0.0.0"
|
599 | 0d2cd893 | Manuel Franceschini | IP6_ADDRESS_LOCALHOST = "::1"
|
600 | 0d2cd893 | Manuel Franceschini | IP6_ADDRESS_ANY = "::"
|
601 | 2f20d07b | Manuel Franceschini | IP4_VERSION = 4
|
602 | 2f20d07b | Manuel Franceschini | IP6_VERSION = 6
|
603 | b8028dcf | Michael Hanselmann | VALID_IP_VERSIONS = compat.UniqueFrozenset([IP4_VERSION, IP6_VERSION]) |
604 | 47334810 | Iustin Pop | # for export to htools
|
605 | 47334810 | Iustin Pop | IP4_FAMILY = socket.AF_INET |
606 | 47334810 | Iustin Pop | IP6_FAMILY = socket.AF_INET6 |
607 | 47334810 | Iustin Pop | |
608 | 16abfbc2 | Alexander Schreiber | TCP_PING_TIMEOUT = 10
|
609 | d63e148a | Manuel Franceschini | DEFAULT_VG = "xenvg"
|
610 | ee2f0ed4 | Luca Bigliardi | DEFAULT_DRBD_HELPER = "/bin/true"
|
611 | 8d1a2a64 | Michael Hanselmann | MIN_VG_SIZE = 20480
|
612 | c5e489f7 | Iustin Pop | DEFAULT_MAC_PREFIX = "aa:00:00"
|
613 | 88cd08aa | Guido Trotter | # default maximum instance wait time, in seconds.
|
614 | 88cd08aa | Guido Trotter | DEFAULT_SHUTDOWN_TIMEOUT = 120
|
615 | 313b2dd4 | Michael Hanselmann | NODE_MAX_CLOCK_SKEW = 150
|
616 | 033a1d00 | Michael Hanselmann | # Time for an intra-cluster disk transfer to wait for a connection
|
617 | 81635b5a | Iustin Pop | DISK_TRANSFER_CONNECT_TIMEOUT = 60
|
618 | 3536c792 | Iustin Pop | # Disk index separator
|
619 | 3536c792 | Iustin Pop | DISK_SEPARATOR = _autoconf.DISK_SEPARATOR |
620 | c4dfb0b6 | Andrea Spadaccini | IP_COMMAND_PATH = _autoconf.IP_PATH |
621 | 7900ed01 | Iustin Pop | |
622 | 6a373640 | Michael Hanselmann | #: Key for job IDs in opcode result
|
623 | 6a373640 | Michael Hanselmann | JOB_IDS_KEY = "jobs"
|
624 | 6a373640 | Michael Hanselmann | |
625 | 6bb65e3a | Guido Trotter | # runparts results
|
626 | 6bb65e3a | Guido Trotter | (RUNPARTS_SKIP, |
627 | 6bb65e3a | Guido Trotter | RUNPARTS_RUN, |
628 | 6bb65e3a | Guido Trotter | RUNPARTS_ERR) = range(3) |
629 | 6bb65e3a | Guido Trotter | |
630 | b8028dcf | Michael Hanselmann | RUNPARTS_STATUS = compat.UniqueFrozenset([ |
631 | b8028dcf | Michael Hanselmann | RUNPARTS_SKIP, |
632 | b8028dcf | Michael Hanselmann | RUNPARTS_RUN, |
633 | b8028dcf | Michael Hanselmann | RUNPARTS_ERR, |
634 | b8028dcf | Michael Hanselmann | ]) |
635 | 6bb65e3a | Guido Trotter | |
636 | 12bce260 | Michael Hanselmann | # RPC constants
|
637 | 12bce260 | Michael Hanselmann | (RPC_ENCODING_NONE, |
638 | 12bce260 | Michael Hanselmann | RPC_ENCODING_ZLIB_BASE64) = range(2) |
639 | 12bce260 | Michael Hanselmann | |
640 | 2ff587d4 | Agata Murawska | # Various time constants for the timeout table
|
641 | 2ff587d4 | Agata Murawska | RPC_TMO_URGENT = 60 # one minute |
642 | 2ff587d4 | Agata Murawska | RPC_TMO_FAST = 5 * 60 # five minutes |
643 | 2ff587d4 | Agata Murawska | RPC_TMO_NORMAL = 15 * 60 # 15 minutes |
644 | 2ff587d4 | Agata Murawska | RPC_TMO_SLOW = 3600 # one hour |
645 | 2ff587d4 | Agata Murawska | RPC_TMO_4HRS = 4 * 3600 |
646 | 2ff587d4 | Agata Murawska | RPC_TMO_1DAY = 86400
|
647 | 2ff587d4 | Agata Murawska | |
648 | 2ff587d4 | Agata Murawska | # Timeout for connecting to nodes (seconds)
|
649 | 2ff587d4 | Agata Murawska | RPC_CONNECT_TIMEOUT = 5
|
650 | 2ff587d4 | Agata Murawska | |
651 | ded1c679 | Guido Trotter | # os related constants
|
652 | d0c8c01d | Iustin Pop | OS_SCRIPT_CREATE = "create"
|
653 | d0c8c01d | Iustin Pop | OS_SCRIPT_IMPORT = "import"
|
654 | d0c8c01d | Iustin Pop | OS_SCRIPT_EXPORT = "export"
|
655 | d0c8c01d | Iustin Pop | OS_SCRIPT_RENAME = "rename"
|
656 | d0c8c01d | Iustin Pop | OS_SCRIPT_VERIFY = "verify"
|
657 | b8028dcf | Michael Hanselmann | OS_SCRIPTS = compat.UniqueFrozenset([ |
658 | 21daa4a8 | Stephen Shirley | OS_SCRIPT_CREATE, |
659 | 21daa4a8 | Stephen Shirley | OS_SCRIPT_IMPORT, |
660 | 21daa4a8 | Stephen Shirley | OS_SCRIPT_EXPORT, |
661 | 21daa4a8 | Stephen Shirley | OS_SCRIPT_RENAME, |
662 | 3c286190 | Dimitris Aragiorgis | OS_SCRIPT_VERIFY, |
663 | 21daa4a8 | Stephen Shirley | ]) |
664 | 37482e7b | Guido Trotter | |
665 | d0c8c01d | Iustin Pop | OS_API_FILE = "ganeti_api_version"
|
666 | d0c8c01d | Iustin Pop | OS_VARIANTS_FILE = "variants.list"
|
667 | d0c8c01d | Iustin Pop | OS_PARAMETERS_FILE = "parameters.list"
|
668 | b41b3516 | Iustin Pop | |
669 | d0c8c01d | Iustin Pop | OS_VALIDATE_PARAMETERS = "parameters"
|
670 | b8028dcf | Michael Hanselmann | OS_VALIDATE_CALLS = compat.UniqueFrozenset([OS_VALIDATE_PARAMETERS]) |
671 | b6b45e0d | Guido Trotter | |
672 | 376631d1 | Constantinos Venetsanopoulos | # External Storage (ES) related constants
|
673 | 376631d1 | Constantinos Venetsanopoulos | ES_ACTION_CREATE = "create"
|
674 | 376631d1 | Constantinos Venetsanopoulos | ES_ACTION_REMOVE = "remove"
|
675 | 376631d1 | Constantinos Venetsanopoulos | ES_ACTION_GROW = "grow"
|
676 | 376631d1 | Constantinos Venetsanopoulos | ES_ACTION_ATTACH = "attach"
|
677 | 376631d1 | Constantinos Venetsanopoulos | ES_ACTION_DETACH = "detach"
|
678 | 376631d1 | Constantinos Venetsanopoulos | ES_ACTION_SETINFO = "setinfo"
|
679 | 938adc87 | Constantinos Venetsanopoulos | ES_ACTION_VERIFY = "verify"
|
680 | 376631d1 | Constantinos Venetsanopoulos | |
681 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_CREATE = ES_ACTION_CREATE |
682 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_REMOVE = ES_ACTION_REMOVE |
683 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_GROW = ES_ACTION_GROW |
684 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_ATTACH = ES_ACTION_ATTACH |
685 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_DETACH = ES_ACTION_DETACH |
686 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_SETINFO = ES_ACTION_SETINFO |
687 | 938adc87 | Constantinos Venetsanopoulos | ES_SCRIPT_VERIFY = ES_ACTION_VERIFY |
688 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPTS = frozenset([
|
689 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_CREATE, |
690 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_REMOVE, |
691 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_GROW, |
692 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_ATTACH, |
693 | 376631d1 | Constantinos Venetsanopoulos | ES_SCRIPT_DETACH, |
694 | 938adc87 | Constantinos Venetsanopoulos | ES_SCRIPT_SETINFO, |
695 | 938adc87 | Constantinos Venetsanopoulos | ES_SCRIPT_VERIFY |
696 | 376631d1 | Constantinos Venetsanopoulos | ]) |
697 | 376631d1 | Constantinos Venetsanopoulos | |
698 | 938adc87 | Constantinos Venetsanopoulos | ES_PARAMETERS_FILE = "parameters.list"
|
699 | 938adc87 | Constantinos Venetsanopoulos | |
700 | 70d9e3d8 | Iustin Pop | # ssh constants
|
701 | fff33d70 | Michael Hanselmann | SSH = "ssh"
|
702 | fff33d70 | Michael Hanselmann | SCP = "scp"
|
703 | 007a2f3e | Alexander Schreiber | |
704 | 007a2f3e | Alexander Schreiber | # reboot types
|
705 | 007a2f3e | Alexander Schreiber | INSTANCE_REBOOT_SOFT = "soft"
|
706 | 007a2f3e | Alexander Schreiber | INSTANCE_REBOOT_HARD = "hard"
|
707 | 007a2f3e | Alexander Schreiber | INSTANCE_REBOOT_FULL = "full"
|
708 | 2584d4a4 | Alexander Schreiber | |
709 | b8028dcf | Michael Hanselmann | REBOOT_TYPES = compat.UniqueFrozenset([ |
710 | 990ade2d | Stephen Shirley | INSTANCE_REBOOT_SOFT, |
711 | 990ade2d | Stephen Shirley | INSTANCE_REBOOT_HARD, |
712 | 3c286190 | Dimitris Aragiorgis | INSTANCE_REBOOT_FULL, |
713 | 990ade2d | Stephen Shirley | ]) |
714 | 990ade2d | Stephen Shirley | |
715 | 990ade2d | Stephen Shirley | # instance reboot behaviors
|
716 | 990ade2d | Stephen Shirley | INSTANCE_REBOOT_ALLOWED = "reboot"
|
717 | 990ade2d | Stephen Shirley | INSTANCE_REBOOT_EXIT = "exit"
|
718 | 990ade2d | Stephen Shirley | |
719 | b8028dcf | Michael Hanselmann | REBOOT_BEHAVIORS = compat.UniqueFrozenset([ |
720 | 990ade2d | Stephen Shirley | INSTANCE_REBOOT_ALLOWED, |
721 | 3c286190 | Dimitris Aragiorgis | INSTANCE_REBOOT_EXIT, |
722 | 990ade2d | Stephen Shirley | ]) |
723 | 00f91f29 | Iustin Pop | |
724 | d0c8c01d | Iustin Pop | VTYPE_STRING = "string"
|
725 | 59525e1f | Michael Hanselmann | VTYPE_MAYBE_STRING = "maybe-string"
|
726 | d0c8c01d | Iustin Pop | VTYPE_BOOL = "bool"
|
727 | d0c8c01d | Iustin Pop | VTYPE_SIZE = "size" # size, in MiBs |
728 | d0c8c01d | Iustin Pop | VTYPE_INT = "int"
|
729 | b8028dcf | Michael Hanselmann | ENFORCEABLE_TYPES = compat.UniqueFrozenset([ |
730 | 21daa4a8 | Stephen Shirley | VTYPE_STRING, |
731 | 21daa4a8 | Stephen Shirley | VTYPE_MAYBE_STRING, |
732 | 21daa4a8 | Stephen Shirley | VTYPE_BOOL, |
733 | 21daa4a8 | Stephen Shirley | VTYPE_SIZE, |
734 | 21daa4a8 | Stephen Shirley | VTYPE_INT, |
735 | 21daa4a8 | Stephen Shirley | ]) |
736 | a5728081 | Guido Trotter | |
737 | b1cb62bd | Andrea Spadaccini | # Constant representing that the user does not specify any IP version
|
738 | b1cb62bd | Andrea Spadaccini | IFACE_NO_IP_VERSION_SPECIFIED = 0
|
739 | b1cb62bd | Andrea Spadaccini | |
740 | e64b8beb | Iustin Pop | # HV parameter names (global namespace)
|
741 | e64b8beb | Iustin Pop | HV_BOOT_ORDER = "boot_order"
|
742 | e64b8beb | Iustin Pop | HV_CDROM_IMAGE_PATH = "cdrom_image_path"
|
743 | cc130cc7 | Marco Casavecchia | HV_KVM_CDROM2_IMAGE_PATH = "cdrom2_image_path"
|
744 | cc130cc7 | Marco Casavecchia | HV_KVM_FLOPPY_IMAGE_PATH = "floppy_image_path"
|
745 | e64b8beb | Iustin Pop | HV_NIC_TYPE = "nic_type"
|
746 | e64b8beb | Iustin Pop | HV_DISK_TYPE = "disk_type"
|
747 | cc130cc7 | Marco Casavecchia | HV_KVM_CDROM_DISK_TYPE = "cdrom_disk_type"
|
748 | e64b8beb | Iustin Pop | HV_VNC_BIND_ADDRESS = "vnc_bind_address"
|
749 | 6e6bb8d5 | Guido Trotter | HV_VNC_PASSWORD_FILE = "vnc_password_file"
|
750 | 8b2d1013 | Guido Trotter | HV_VNC_TLS = "vnc_tls"
|
751 | 8b2d1013 | Guido Trotter | HV_VNC_X509 = "vnc_x509_path"
|
752 | 8b2d1013 | Guido Trotter | HV_VNC_X509_VERIFY = "vnc_x509_verify"
|
753 | b1cb62bd | Andrea Spadaccini | HV_KVM_SPICE_BIND = "spice_bind"
|
754 | b1cb62bd | Andrea Spadaccini | HV_KVM_SPICE_IP_VERSION = "spice_ip_version"
|
755 | b451c4c7 | Andrea Spadaccini | HV_KVM_SPICE_PASSWORD_FILE = "spice_password_file"
|
756 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_LOSSLESS_IMG_COMPR = "spice_image_compression"
|
757 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_JPEG_IMG_COMPR = "spice_jpeg_wan_compression"
|
758 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR = "spice_zlib_glz_wan_compression"
|
759 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_STREAMING_VIDEO_DETECTION = "spice_streaming_video"
|
760 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_AUDIO_COMPR = "spice_playback_compression"
|
761 | bfe86c76 | Andrea Spadaccini | HV_KVM_SPICE_USE_TLS = "spice_use_tls"
|
762 | 3e40b587 | Andrea Spadaccini | HV_KVM_SPICE_TLS_CIPHERS = "spice_tls_ciphers"
|
763 | 3e40b587 | Andrea Spadaccini | HV_KVM_SPICE_USE_VDAGENT = "spice_use_vdagent"
|
764 | e64b8beb | Iustin Pop | HV_ACPI = "acpi"
|
765 | e64b8beb | Iustin Pop | HV_PAE = "pae"
|
766 | 2f2dbb4b | Jun Futagawa | HV_USE_BOOTLOADER = "use_bootloader"
|
767 | 2f2dbb4b | Jun Futagawa | HV_BOOTLOADER_ARGS = "bootloader_args"
|
768 | 2f2dbb4b | Jun Futagawa | HV_BOOTLOADER_PATH = "bootloader_path"
|
769 | f9d6542d | Iustin Pop | HV_KERNEL_ARGS = "kernel_args"
|
770 | e64b8beb | Iustin Pop | HV_KERNEL_PATH = "kernel_path"
|
771 | e64b8beb | Iustin Pop | HV_INITRD_PATH = "initrd_path"
|
772 | 074ca009 | Guido Trotter | HV_ROOT_PATH = "root_path"
|
773 | a2faf9ee | Guido Trotter | HV_SERIAL_CONSOLE = "serial_console"
|
774 | 11344a50 | Guido Trotter | HV_USB_MOUSE = "usb_mouse"
|
775 | 4f580fef | Sébastien Bocahu | HV_KEYMAP = "keymap"
|
776 | 09ea8710 | Iustin Pop | HV_DEVICE_MODEL = "device_model"
|
777 | 48297fa2 | Iustin Pop | HV_INIT_SCRIPT = "init_script"
|
778 | 78411c60 | Iustin Pop | HV_MIGRATION_PORT = "migration_port"
|
779 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_BANDWIDTH = "migration_bandwidth"
|
780 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_DOWNTIME = "migration_downtime"
|
781 | 783a6c0b | Iustin Pop | HV_MIGRATION_MODE = "migration_mode"
|
782 | 6b970cef | Jun Futagawa | HV_USE_LOCALTIME = "use_localtime"
|
783 | ea0f3d7a | Iustin Pop | HV_DISK_CACHE = "disk_cache"
|
784 | 3424767f | Guido Trotter | HV_SECURITY_MODEL = "security_model"
|
785 | 3424767f | Guido Trotter | HV_SECURITY_DOMAIN = "security_domain"
|
786 | 7ba594c0 | Guido Trotter | HV_KVM_FLAG = "kvm_flag"
|
787 | fbe27e2b | Guido Trotter | HV_VHOST_NET = "vhost_net"
|
788 | 84c08e4e | Balazs Lecz | HV_KVM_USE_CHROOT = "use_chroot"
|
789 | e3ed5316 | Balazs Lecz | HV_CPU_MASK = "cpu_mask"
|
790 | 4f958b0b | Miguel Di Ciurcio Filho | HV_MEM_PATH = "mem_path"
|
791 | 87f0aa48 | Jack | HV_PASSTHROUGH = "pci_pass"
|
792 | 525011bc | Maciej Bliziński | HV_BLOCKDEV_PREFIX = "blockdev_prefix"
|
793 | 990ade2d | Stephen Shirley | HV_REBOOT_BEHAVIOR = "reboot_behavior"
|
794 | 7cb42171 | Nikita Staroverov | HV_CPU_TYPE = "cpu_type"
|
795 | 8bd977e9 | Sébastien Bocahu | HV_CPU_CAP = "cpu_cap"
|
796 | 8bd977e9 | Sébastien Bocahu | HV_CPU_WEIGHT = "cpu_weight"
|
797 | 8bd977e9 | Sébastien Bocahu | |
798 | e64b8beb | Iustin Pop | |
799 | a5728081 | Guido Trotter | HVS_PARAMETER_TYPES = { |
800 | a5728081 | Guido Trotter | HV_BOOT_ORDER: VTYPE_STRING, |
801 | cc130cc7 | Marco Casavecchia | HV_KVM_FLOPPY_IMAGE_PATH: VTYPE_STRING, |
802 | a5728081 | Guido Trotter | HV_CDROM_IMAGE_PATH: VTYPE_STRING, |
803 | cc130cc7 | Marco Casavecchia | HV_KVM_CDROM2_IMAGE_PATH: VTYPE_STRING, |
804 | a5728081 | Guido Trotter | HV_NIC_TYPE: VTYPE_STRING, |
805 | a5728081 | Guido Trotter | HV_DISK_TYPE: VTYPE_STRING, |
806 | cc130cc7 | Marco Casavecchia | HV_KVM_CDROM_DISK_TYPE: VTYPE_STRING, |
807 | 6e6bb8d5 | Guido Trotter | HV_VNC_PASSWORD_FILE: VTYPE_STRING, |
808 | a5728081 | Guido Trotter | HV_VNC_BIND_ADDRESS: VTYPE_STRING, |
809 | a5728081 | Guido Trotter | HV_VNC_TLS: VTYPE_BOOL, |
810 | a5728081 | Guido Trotter | HV_VNC_X509: VTYPE_STRING, |
811 | a5728081 | Guido Trotter | HV_VNC_X509_VERIFY: VTYPE_BOOL, |
812 | b1cb62bd | Andrea Spadaccini | HV_KVM_SPICE_BIND: VTYPE_STRING, |
813 | b1cb62bd | Andrea Spadaccini | HV_KVM_SPICE_IP_VERSION: VTYPE_INT, |
814 | b451c4c7 | Andrea Spadaccini | HV_KVM_SPICE_PASSWORD_FILE: VTYPE_STRING, |
815 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_LOSSLESS_IMG_COMPR: VTYPE_STRING, |
816 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_JPEG_IMG_COMPR: VTYPE_STRING, |
817 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR: VTYPE_STRING, |
818 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_STREAMING_VIDEO_DETECTION: VTYPE_STRING, |
819 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_AUDIO_COMPR: VTYPE_BOOL, |
820 | bfe86c76 | Andrea Spadaccini | HV_KVM_SPICE_USE_TLS: VTYPE_BOOL, |
821 | 3e40b587 | Andrea Spadaccini | HV_KVM_SPICE_TLS_CIPHERS: VTYPE_STRING, |
822 | 3e40b587 | Andrea Spadaccini | HV_KVM_SPICE_USE_VDAGENT: VTYPE_BOOL, |
823 | a5728081 | Guido Trotter | HV_ACPI: VTYPE_BOOL, |
824 | a5728081 | Guido Trotter | HV_PAE: VTYPE_BOOL, |
825 | 2f2dbb4b | Jun Futagawa | HV_USE_BOOTLOADER: VTYPE_BOOL, |
826 | 2f2dbb4b | Jun Futagawa | HV_BOOTLOADER_PATH: VTYPE_STRING, |
827 | 2f2dbb4b | Jun Futagawa | HV_BOOTLOADER_ARGS: VTYPE_STRING, |
828 | a5728081 | Guido Trotter | HV_KERNEL_PATH: VTYPE_STRING, |
829 | f9d6542d | Iustin Pop | HV_KERNEL_ARGS: VTYPE_STRING, |
830 | a5728081 | Guido Trotter | HV_INITRD_PATH: VTYPE_STRING, |
831 | 7adf7814 | René Nussbaumer | HV_ROOT_PATH: VTYPE_MAYBE_STRING, |
832 | a5728081 | Guido Trotter | HV_SERIAL_CONSOLE: VTYPE_BOOL, |
833 | a5728081 | Guido Trotter | HV_USB_MOUSE: VTYPE_STRING, |
834 | 4f580fef | Sébastien Bocahu | HV_KEYMAP: VTYPE_STRING, |
835 | 09ea8710 | Iustin Pop | HV_DEVICE_MODEL: VTYPE_STRING, |
836 | 48297fa2 | Iustin Pop | HV_INIT_SCRIPT: VTYPE_STRING, |
837 | 78411c60 | Iustin Pop | HV_MIGRATION_PORT: VTYPE_INT, |
838 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_BANDWIDTH: VTYPE_INT, |
839 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_DOWNTIME: VTYPE_INT, |
840 | 783a6c0b | Iustin Pop | HV_MIGRATION_MODE: VTYPE_STRING, |
841 | 6b970cef | Jun Futagawa | HV_USE_LOCALTIME: VTYPE_BOOL, |
842 | ea0f3d7a | Iustin Pop | HV_DISK_CACHE: VTYPE_STRING, |
843 | 3424767f | Guido Trotter | HV_SECURITY_MODEL: VTYPE_STRING, |
844 | 3424767f | Guido Trotter | HV_SECURITY_DOMAIN: VTYPE_STRING, |
845 | 7ba594c0 | Guido Trotter | HV_KVM_FLAG: VTYPE_STRING, |
846 | fbe27e2b | Guido Trotter | HV_VHOST_NET: VTYPE_BOOL, |
847 | 84c08e4e | Balazs Lecz | HV_KVM_USE_CHROOT: VTYPE_BOOL, |
848 | e3ed5316 | Balazs Lecz | HV_CPU_MASK: VTYPE_STRING, |
849 | 4f958b0b | Miguel Di Ciurcio Filho | HV_MEM_PATH: VTYPE_STRING, |
850 | 87f0aa48 | Jack | HV_PASSTHROUGH: VTYPE_STRING, |
851 | 525011bc | Maciej Bliziński | HV_BLOCKDEV_PREFIX: VTYPE_STRING, |
852 | 990ade2d | Stephen Shirley | HV_REBOOT_BEHAVIOR: VTYPE_STRING, |
853 | 7cb42171 | Nikita Staroverov | HV_CPU_TYPE: VTYPE_STRING, |
854 | 8bd977e9 | Sébastien Bocahu | HV_CPU_CAP: VTYPE_INT, |
855 | 8bd977e9 | Sébastien Bocahu | HV_CPU_WEIGHT: VTYPE_INT, |
856 | a5728081 | Guido Trotter | } |
857 | a5728081 | Guido Trotter | |
858 | a5728081 | Guido Trotter | HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
|
859 | 5018a335 | Iustin Pop | |
860 | a6c7e2a2 | Iustin Pop | HVS_PARAMETER_TITLES = { |
861 | a6c7e2a2 | Iustin Pop | HV_ACPI: "ACPI",
|
862 | a6c7e2a2 | Iustin Pop | HV_BOOT_ORDER: "Boot_order",
|
863 | a6c7e2a2 | Iustin Pop | HV_CDROM_IMAGE_PATH: "CDROM_image_path",
|
864 | a6c7e2a2 | Iustin Pop | HV_DISK_TYPE: "Disk_type",
|
865 | a6c7e2a2 | Iustin Pop | HV_INITRD_PATH: "Initrd_path",
|
866 | a6c7e2a2 | Iustin Pop | HV_KERNEL_PATH: "Kernel_path",
|
867 | a6c7e2a2 | Iustin Pop | HV_NIC_TYPE: "NIC_type",
|
868 | a6c7e2a2 | Iustin Pop | HV_PAE: "PAE",
|
869 | a6c7e2a2 | Iustin Pop | HV_VNC_BIND_ADDRESS: "VNC_bind_address",
|
870 | a6c7e2a2 | Iustin Pop | HV_PASSTHROUGH: "pci_pass",
|
871 | a6c7e2a2 | Iustin Pop | HV_CPU_TYPE: "cpu_type",
|
872 | a6c7e2a2 | Iustin Pop | } |
873 | a6c7e2a2 | Iustin Pop | |
874 | 6a1434d7 | Andrea Spadaccini | # Migration statuses
|
875 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_COMPLETED = "completed"
|
876 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_ACTIVE = "active"
|
877 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_FAILED = "failed"
|
878 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_CANCELLED = "cancelled"
|
879 | 6a1434d7 | Andrea Spadaccini | |
880 | b8028dcf | Michael Hanselmann | HV_MIGRATION_VALID_STATUSES = compat.UniqueFrozenset([ |
881 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_COMPLETED, |
882 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_ACTIVE, |
883 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_FAILED, |
884 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_CANCELLED, |
885 | 6a1434d7 | Andrea Spadaccini | ]) |
886 | 6a1434d7 | Andrea Spadaccini | |
887 | b8028dcf | Michael Hanselmann | HV_MIGRATION_FAILED_STATUSES = compat.UniqueFrozenset([ |
888 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_FAILED, |
889 | 6a1434d7 | Andrea Spadaccini | HV_MIGRATION_CANCELLED, |
890 | 6a1434d7 | Andrea Spadaccini | ]) |
891 | 6a1434d7 | Andrea Spadaccini | |
892 | 6a1434d7 | Andrea Spadaccini | # KVM-specific statuses
|
893 | 6a1434d7 | Andrea Spadaccini | HV_KVM_MIGRATION_VALID_STATUSES = HV_MIGRATION_VALID_STATUSES |
894 | 6a1434d7 | Andrea Spadaccini | |
895 | 34fbc862 | Andrea Spadaccini | # Node info keys
|
896 | 34fbc862 | Andrea Spadaccini | HV_NODEINFO_KEY_VERSION = "hv_version"
|
897 | 34fbc862 | Andrea Spadaccini | |
898 | 5b49ed09 | René Nussbaumer | # Hypervisor state
|
899 | 5b49ed09 | René Nussbaumer | HVST_MEMORY_TOTAL = "mem_total"
|
900 | 5b49ed09 | René Nussbaumer | HVST_MEMORY_NODE = "mem_node"
|
901 | 5b49ed09 | René Nussbaumer | HVST_MEMORY_HV = "mem_hv"
|
902 | 5b49ed09 | René Nussbaumer | HVST_CPU_TOTAL = "cpu_total"
|
903 | 5b49ed09 | René Nussbaumer | HVST_CPU_NODE = "cpu_node"
|
904 | 5b49ed09 | René Nussbaumer | |
905 | 2da9f556 | René Nussbaumer | HVST_DEFAULTS = { |
906 | 2da9f556 | René Nussbaumer | HVST_MEMORY_TOTAL: 0,
|
907 | 2da9f556 | René Nussbaumer | HVST_MEMORY_NODE: 0,
|
908 | 2da9f556 | René Nussbaumer | HVST_MEMORY_HV: 0,
|
909 | 2da9f556 | René Nussbaumer | HVST_CPU_TOTAL: 1,
|
910 | 2da9f556 | René Nussbaumer | HVST_CPU_NODE: 1,
|
911 | 2da9f556 | René Nussbaumer | } |
912 | 2da9f556 | René Nussbaumer | |
913 | 5b49ed09 | René Nussbaumer | HVSTS_PARAMETER_TYPES = { |
914 | 5b49ed09 | René Nussbaumer | HVST_MEMORY_TOTAL: VTYPE_INT, |
915 | 5b49ed09 | René Nussbaumer | HVST_MEMORY_NODE: VTYPE_INT, |
916 | 5b49ed09 | René Nussbaumer | HVST_MEMORY_HV: VTYPE_INT, |
917 | 5b49ed09 | René Nussbaumer | HVST_CPU_TOTAL: VTYPE_INT, |
918 | 5b49ed09 | René Nussbaumer | HVST_CPU_NODE: VTYPE_INT, |
919 | 5b49ed09 | René Nussbaumer | } |
920 | 5b49ed09 | René Nussbaumer | |
921 | 5b49ed09 | René Nussbaumer | HVSTS_PARAMETERS = frozenset(HVSTS_PARAMETER_TYPES.keys())
|
922 | 5b49ed09 | René Nussbaumer | |
923 | 5b49ed09 | René Nussbaumer | # Disk state
|
924 | 5b49ed09 | René Nussbaumer | DS_DISK_TOTAL = "disk_total"
|
925 | 5b49ed09 | René Nussbaumer | DS_DISK_RESERVED = "disk_reserved"
|
926 | 5b49ed09 | René Nussbaumer | DS_DISK_OVERHEAD = "disk_overhead"
|
927 | 5b49ed09 | René Nussbaumer | |
928 | 2da9f556 | René Nussbaumer | DS_DEFAULTS = { |
929 | 2da9f556 | René Nussbaumer | DS_DISK_TOTAL: 0,
|
930 | 2da9f556 | René Nussbaumer | DS_DISK_RESERVED: 0,
|
931 | 2da9f556 | René Nussbaumer | DS_DISK_OVERHEAD: 0,
|
932 | 2da9f556 | René Nussbaumer | } |
933 | 2da9f556 | René Nussbaumer | |
934 | 5b49ed09 | René Nussbaumer | DSS_PARAMETER_TYPES = { |
935 | 5b49ed09 | René Nussbaumer | DS_DISK_TOTAL: VTYPE_INT, |
936 | 5b49ed09 | René Nussbaumer | DS_DISK_RESERVED: VTYPE_INT, |
937 | 5b49ed09 | René Nussbaumer | DS_DISK_OVERHEAD: VTYPE_INT, |
938 | 5b49ed09 | René Nussbaumer | } |
939 | 5b49ed09 | René Nussbaumer | |
940 | 5b49ed09 | René Nussbaumer | DSS_PARAMETERS = frozenset(DSS_PARAMETER_TYPES.keys())
|
941 | b8028dcf | Michael Hanselmann | DS_VALID_TYPES = compat.UniqueFrozenset([LD_LV]) |
942 | 5b49ed09 | René Nussbaumer | |
943 | 3d5ebbf0 | Stephen Shirley | # Backend parameter names
|
944 | 8c72ab2b | Guido Trotter | BE_MEMORY = "memory" # deprecated and replaced by max and min mem |
945 | 8c72ab2b | Guido Trotter | BE_MAXMEM = "maxmem"
|
946 | 8c72ab2b | Guido Trotter | BE_MINMEM = "minmem"
|
947 | e64b8beb | Iustin Pop | BE_VCPUS = "vcpus"
|
948 | c0f2b229 | Iustin Pop | BE_AUTO_BALANCE = "auto_balance"
|
949 | 11dc66f3 | Bernardo Dal Seno | BE_ALWAYS_FAILOVER = "always_failover"
|
950 | 34700f5b | René Nussbaumer | BE_SPINDLE_USE = "spindle_use"
|
951 | e64b8beb | Iustin Pop | |
952 | a5728081 | Guido Trotter | BES_PARAMETER_TYPES = { |
953 | 2e1a6024 | Guido Trotter | BE_MAXMEM: VTYPE_SIZE, |
954 | 2e1a6024 | Guido Trotter | BE_MINMEM: VTYPE_SIZE, |
955 | 2e1a6024 | Guido Trotter | BE_VCPUS: VTYPE_INT, |
956 | 2e1a6024 | Guido Trotter | BE_AUTO_BALANCE: VTYPE_BOOL, |
957 | 11dc66f3 | Bernardo Dal Seno | BE_ALWAYS_FAILOVER: VTYPE_BOOL, |
958 | 34700f5b | René Nussbaumer | BE_SPINDLE_USE: VTYPE_INT, |
959 | 2e1a6024 | Guido Trotter | } |
960 | a5728081 | Guido Trotter | |
961 | a6c7e2a2 | Iustin Pop | BES_PARAMETER_TITLES = { |
962 | a6c7e2a2 | Iustin Pop | BE_AUTO_BALANCE: "Auto_balance",
|
963 | a6c7e2a2 | Iustin Pop | BE_MAXMEM: "ConfigMaxMem",
|
964 | a6c7e2a2 | Iustin Pop | BE_MINMEM: "ConfigMinMem",
|
965 | a6c7e2a2 | Iustin Pop | BE_VCPUS: "ConfigVCPUs",
|
966 | a6c7e2a2 | Iustin Pop | } |
967 | a6c7e2a2 | Iustin Pop | |
968 | b2e233a5 | Guido Trotter | BES_PARAMETER_COMPAT = { |
969 | b2e233a5 | Guido Trotter | BE_MEMORY: VTYPE_SIZE, |
970 | b2e233a5 | Guido Trotter | } |
971 | b2e233a5 | Guido Trotter | BES_PARAMETER_COMPAT.update(BES_PARAMETER_TYPES) |
972 | b2e233a5 | Guido Trotter | |
973 | a5728081 | Guido Trotter | BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
|
974 | cd3ab26e | Iustin Pop | |
975 | 918eb80b | Agata Murawska | # instance specs
|
976 | 4f725341 | Agata Murawska | ISPEC_MEM_SIZE = "memory-size"
|
977 | 4f725341 | Agata Murawska | ISPEC_CPU_COUNT = "cpu-count"
|
978 | 4f725341 | Agata Murawska | ISPEC_DISK_COUNT = "disk-count"
|
979 | 4f725341 | Agata Murawska | ISPEC_DISK_SIZE = "disk-size"
|
980 | 4f725341 | Agata Murawska | ISPEC_NIC_COUNT = "nic-count"
|
981 | 553cb5f7 | René Nussbaumer | ISPEC_SPINDLE_USE = "spindle-use"
|
982 | 918eb80b | Agata Murawska | |
983 | 918eb80b | Agata Murawska | ISPECS_PARAMETER_TYPES = { |
984 | 4f725341 | Agata Murawska | ISPEC_MEM_SIZE: VTYPE_INT, |
985 | 4f725341 | Agata Murawska | ISPEC_CPU_COUNT: VTYPE_INT, |
986 | 4f725341 | Agata Murawska | ISPEC_DISK_COUNT: VTYPE_INT, |
987 | 4f725341 | Agata Murawska | ISPEC_DISK_SIZE: VTYPE_INT, |
988 | 4f725341 | Agata Murawska | ISPEC_NIC_COUNT: VTYPE_INT, |
989 | 553cb5f7 | René Nussbaumer | ISPEC_SPINDLE_USE: VTYPE_INT, |
990 | 918eb80b | Agata Murawska | } |
991 | 918eb80b | Agata Murawska | |
992 | 918eb80b | Agata Murawska | ISPECS_PARAMETERS = frozenset(ISPECS_PARAMETER_TYPES.keys())
|
993 | 918eb80b | Agata Murawska | |
994 | 4f725341 | Agata Murawska | ISPECS_MIN = "min"
|
995 | 4f725341 | Agata Murawska | ISPECS_MAX = "max"
|
996 | 4f725341 | Agata Murawska | ISPECS_STD = "std"
|
997 | 784b6603 | René Nussbaumer | IPOLICY_DTS = "disk-templates"
|
998 | 784b6603 | René Nussbaumer | IPOLICY_VCPU_RATIO = "vcpu-ratio"
|
999 | a194dc28 | Iustin Pop | IPOLICY_SPINDLE_RATIO = "spindle-ratio"
|
1000 | 918eb80b | Agata Murawska | |
1001 | b8028dcf | Michael Hanselmann | IPOLICY_ISPECS = compat.UniqueFrozenset([ |
1002 | 4f725341 | Agata Murawska | ISPECS_MIN, |
1003 | 4f725341 | Agata Murawska | ISPECS_MAX, |
1004 | 4f725341 | Agata Murawska | ISPECS_STD, |
1005 | 918eb80b | Agata Murawska | ]) |
1006 | ff6c5e55 | Iustin Pop | |
1007 | b8028dcf | Michael Hanselmann | IPOLICY_PARAMETERS = compat.UniqueFrozenset([ |
1008 | ff6c5e55 | Iustin Pop | IPOLICY_VCPU_RATIO, |
1009 | a194dc28 | Iustin Pop | IPOLICY_SPINDLE_RATIO, |
1010 | ff6c5e55 | Iustin Pop | ]) |
1011 | ff6c5e55 | Iustin Pop | |
1012 | ff6c5e55 | Iustin Pop | IPOLICY_ALL_KEYS = (IPOLICY_ISPECS | |
1013 | ff6c5e55 | Iustin Pop | IPOLICY_PARAMETERS | |
1014 | ff6c5e55 | Iustin Pop | frozenset([IPOLICY_DTS]))
|
1015 | 918eb80b | Agata Murawska | |
1016 | 095e71aa | René Nussbaumer | # Node parameter names
|
1017 | 095e71aa | René Nussbaumer | ND_OOB_PROGRAM = "oob_program"
|
1018 | 432e8e2f | Iustin Pop | ND_SPINDLE_COUNT = "spindle_count"
|
1019 | 0ea11dcb | Bernardo Dal Seno | ND_EXCLUSIVE_STORAGE = "exclusive_storage"
|
1020 | 095e71aa | René Nussbaumer | |
1021 | 095e71aa | René Nussbaumer | NDS_PARAMETER_TYPES = { |
1022 | 1df4d430 | Iustin Pop | ND_OOB_PROGRAM: VTYPE_STRING, |
1023 | 432e8e2f | Iustin Pop | ND_SPINDLE_COUNT: VTYPE_INT, |
1024 | 0ea11dcb | Bernardo Dal Seno | ND_EXCLUSIVE_STORAGE: VTYPE_BOOL, |
1025 | 2e1a6024 | Guido Trotter | } |
1026 | 095e71aa | René Nussbaumer | |
1027 | 095e71aa | René Nussbaumer | NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
|
1028 | 095e71aa | René Nussbaumer | |
1029 | a6c7e2a2 | Iustin Pop | NDS_PARAMETER_TITLES = { |
1030 | a6c7e2a2 | Iustin Pop | ND_OOB_PROGRAM: "OutOfBandProgram",
|
1031 | a6c7e2a2 | Iustin Pop | ND_SPINDLE_COUNT: "SpindleCount",
|
1032 | 0ea11dcb | Bernardo Dal Seno | ND_EXCLUSIVE_STORAGE: "ExclusiveStorage",
|
1033 | a6c7e2a2 | Iustin Pop | } |
1034 | a6c7e2a2 | Iustin Pop | |
1035 | bc5d0215 | Andrea Spadaccini | # Logical Disks parameters
|
1036 | ac00bf1b | Andrea Spadaccini | LDP_RESYNC_RATE = "resync-rate"
|
1037 | ac00bf1b | Andrea Spadaccini | LDP_STRIPES = "stripes"
|
1038 | ac00bf1b | Andrea Spadaccini | LDP_BARRIERS = "disabled-barriers"
|
1039 | ac00bf1b | Andrea Spadaccini | LDP_NO_META_FLUSH = "disable-meta-flush"
|
1040 | 8002e46b | Andrea Spadaccini | LDP_DEFAULT_METAVG = "default-metavg"
|
1041 | ad1dd4c7 | Andrea Spadaccini | LDP_DISK_CUSTOM = "disk-custom"
|
1042 | ad1dd4c7 | Andrea Spadaccini | LDP_NET_CUSTOM = "net-custom"
|
1043 | f2f57b6e | Andrea Spadaccini | LDP_DYNAMIC_RESYNC = "dynamic-resync"
|
1044 | 8584e922 | Andrea Spadaccini | LDP_PLAN_AHEAD = "c-plan-ahead"
|
1045 | 8584e922 | Andrea Spadaccini | LDP_FILL_TARGET = "c-fill-target"
|
1046 | 8584e922 | Andrea Spadaccini | LDP_DELAY_TARGET = "c-delay-target"
|
1047 | 8584e922 | Andrea Spadaccini | LDP_MAX_RATE = "c-max-rate"
|
1048 | 8584e922 | Andrea Spadaccini | LDP_MIN_RATE = "c-min-rate"
|
1049 | 7181fba0 | Constantinos Venetsanopoulos | LDP_POOL = "pool"
|
1050 | bc5d0215 | Andrea Spadaccini | DISK_LD_TYPES = { |
1051 | ac00bf1b | Andrea Spadaccini | LDP_RESYNC_RATE: VTYPE_INT, |
1052 | ac00bf1b | Andrea Spadaccini | LDP_STRIPES: VTYPE_INT, |
1053 | ac00bf1b | Andrea Spadaccini | LDP_BARRIERS: VTYPE_STRING, |
1054 | ac00bf1b | Andrea Spadaccini | LDP_NO_META_FLUSH: VTYPE_BOOL, |
1055 | 8002e46b | Andrea Spadaccini | LDP_DEFAULT_METAVG: VTYPE_STRING, |
1056 | ad1dd4c7 | Andrea Spadaccini | LDP_DISK_CUSTOM: VTYPE_STRING, |
1057 | ad1dd4c7 | Andrea Spadaccini | LDP_NET_CUSTOM: VTYPE_STRING, |
1058 | f2f57b6e | Andrea Spadaccini | LDP_DYNAMIC_RESYNC: VTYPE_BOOL, |
1059 | 8584e922 | Andrea Spadaccini | LDP_PLAN_AHEAD: VTYPE_INT, |
1060 | 8584e922 | Andrea Spadaccini | LDP_FILL_TARGET: VTYPE_INT, |
1061 | 8584e922 | Andrea Spadaccini | LDP_DELAY_TARGET: VTYPE_INT, |
1062 | 8584e922 | Andrea Spadaccini | LDP_MAX_RATE: VTYPE_INT, |
1063 | 8584e922 | Andrea Spadaccini | LDP_MIN_RATE: VTYPE_INT, |
1064 | 7181fba0 | Constantinos Venetsanopoulos | LDP_POOL: VTYPE_STRING, |
1065 | bc5d0215 | Andrea Spadaccini | } |
1066 | bc5d0215 | Andrea Spadaccini | DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
|
1067 | bc5d0215 | Andrea Spadaccini | |
1068 | f2f57b6e | Andrea Spadaccini | # Disk template parameters (can be set/changed by the user via gnt-cluster and
|
1069 | f2f57b6e | Andrea Spadaccini | # gnt-group)
|
1070 | 6e9814a1 | Andrea Spadaccini | DRBD_RESYNC_RATE = "resync-rate"
|
1071 | 43e11798 | Andrea Spadaccini | DRBD_DATA_STRIPES = "data-stripes"
|
1072 | 43e11798 | Andrea Spadaccini | DRBD_META_STRIPES = "meta-stripes"
|
1073 | 8a69b3a8 | Andrea Spadaccini | DRBD_DISK_BARRIERS = "disk-barriers"
|
1074 | 8a69b3a8 | Andrea Spadaccini | DRBD_META_BARRIERS = "meta-barriers"
|
1075 | 8002e46b | Andrea Spadaccini | DRBD_DEFAULT_METAVG = "metavg"
|
1076 | ad1dd4c7 | Andrea Spadaccini | DRBD_DISK_CUSTOM = "disk-custom"
|
1077 | ad1dd4c7 | Andrea Spadaccini | DRBD_NET_CUSTOM = "net-custom"
|
1078 | f2f57b6e | Andrea Spadaccini | DRBD_DYNAMIC_RESYNC = "dynamic-resync"
|
1079 | 8584e922 | Andrea Spadaccini | DRBD_PLAN_AHEAD = "c-plan-ahead"
|
1080 | 8584e922 | Andrea Spadaccini | DRBD_FILL_TARGET = "c-fill-target"
|
1081 | 8584e922 | Andrea Spadaccini | DRBD_DELAY_TARGET = "c-delay-target"
|
1082 | 8584e922 | Andrea Spadaccini | DRBD_MAX_RATE = "c-max-rate"
|
1083 | 8584e922 | Andrea Spadaccini | DRBD_MIN_RATE = "c-min-rate"
|
1084 | 43e11798 | Andrea Spadaccini | LV_STRIPES = "stripes"
|
1085 | 7181fba0 | Constantinos Venetsanopoulos | RBD_POOL = "pool"
|
1086 | bc5d0215 | Andrea Spadaccini | DISK_DT_TYPES = { |
1087 | 6e9814a1 | Andrea Spadaccini | DRBD_RESYNC_RATE: VTYPE_INT, |
1088 | 43e11798 | Andrea Spadaccini | DRBD_DATA_STRIPES: VTYPE_INT, |
1089 | 43e11798 | Andrea Spadaccini | DRBD_META_STRIPES: VTYPE_INT, |
1090 | 8a69b3a8 | Andrea Spadaccini | DRBD_DISK_BARRIERS: VTYPE_STRING, |
1091 | 8a69b3a8 | Andrea Spadaccini | DRBD_META_BARRIERS: VTYPE_BOOL, |
1092 | 8002e46b | Andrea Spadaccini | DRBD_DEFAULT_METAVG: VTYPE_STRING, |
1093 | ad1dd4c7 | Andrea Spadaccini | DRBD_DISK_CUSTOM: VTYPE_STRING, |
1094 | ad1dd4c7 | Andrea Spadaccini | DRBD_NET_CUSTOM: VTYPE_STRING, |
1095 | f2f57b6e | Andrea Spadaccini | DRBD_DYNAMIC_RESYNC: VTYPE_BOOL, |
1096 | 8584e922 | Andrea Spadaccini | DRBD_PLAN_AHEAD: VTYPE_INT, |
1097 | 8584e922 | Andrea Spadaccini | DRBD_FILL_TARGET: VTYPE_INT, |
1098 | 8584e922 | Andrea Spadaccini | DRBD_DELAY_TARGET: VTYPE_INT, |
1099 | 8584e922 | Andrea Spadaccini | DRBD_MAX_RATE: VTYPE_INT, |
1100 | 8584e922 | Andrea Spadaccini | DRBD_MIN_RATE: VTYPE_INT, |
1101 | 43e11798 | Andrea Spadaccini | LV_STRIPES: VTYPE_INT, |
1102 | 7181fba0 | Constantinos Venetsanopoulos | RBD_POOL: VTYPE_STRING, |
1103 | bc5d0215 | Andrea Spadaccini | } |
1104 | bc5d0215 | Andrea Spadaccini | |
1105 | bc5d0215 | Andrea Spadaccini | DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
|
1106 | bc5d0215 | Andrea Spadaccini | |
1107 | b2f29800 | René Nussbaumer | # OOB supported commands
|
1108 | b2f29800 | René Nussbaumer | OOB_POWER_ON = "power-on"
|
1109 | b2f29800 | René Nussbaumer | OOB_POWER_OFF = "power-off"
|
1110 | b2f29800 | René Nussbaumer | OOB_POWER_CYCLE = "power-cycle"
|
1111 | b2f29800 | René Nussbaumer | OOB_POWER_STATUS = "power-status"
|
1112 | b2f29800 | René Nussbaumer | OOB_HEALTH = "health"
|
1113 | b2f29800 | René Nussbaumer | |
1114 | b8028dcf | Michael Hanselmann | OOB_COMMANDS = compat.UniqueFrozenset([ |
1115 | 21daa4a8 | Stephen Shirley | OOB_POWER_ON, |
1116 | 21daa4a8 | Stephen Shirley | OOB_POWER_OFF, |
1117 | 21daa4a8 | Stephen Shirley | OOB_POWER_CYCLE, |
1118 | 21daa4a8 | Stephen Shirley | OOB_POWER_STATUS, |
1119 | 3c286190 | Dimitris Aragiorgis | OOB_HEALTH, |
1120 | 21daa4a8 | Stephen Shirley | ]) |
1121 | b2f29800 | René Nussbaumer | |
1122 | b528a12d | René Nussbaumer | OOB_POWER_STATUS_POWERED = "powered"
|
1123 | b528a12d | René Nussbaumer | |
1124 | 445f735d | René Nussbaumer | OOB_TIMEOUT = 60 # 60 seconds |
1125 | beff3779 | René Nussbaumer | OOB_POWER_DELAY = 2.0 # 2 seconds |
1126 | 445f735d | René Nussbaumer | |
1127 | 445f735d | René Nussbaumer | OOB_STATUS_OK = "OK"
|
1128 | 445f735d | René Nussbaumer | OOB_STATUS_WARNING = "WARNING"
|
1129 | 445f735d | René Nussbaumer | OOB_STATUS_CRITICAL = "CRITICAL"
|
1130 | 445f735d | René Nussbaumer | OOB_STATUS_UNKNOWN = "UNKNOWN"
|
1131 | 445f735d | René Nussbaumer | |
1132 | b8028dcf | Michael Hanselmann | OOB_STATUSES = compat.UniqueFrozenset([ |
1133 | 445f735d | René Nussbaumer | OOB_STATUS_OK, |
1134 | 445f735d | René Nussbaumer | OOB_STATUS_WARNING, |
1135 | 445f735d | René Nussbaumer | OOB_STATUS_CRITICAL, |
1136 | 445f735d | René Nussbaumer | OOB_STATUS_UNKNOWN, |
1137 | 445f735d | René Nussbaumer | ]) |
1138 | 445f735d | René Nussbaumer | |
1139 | 4ef7f423 | Guido Trotter | # Instance Parameters Profile
|
1140 | 4ef7f423 | Guido Trotter | PP_DEFAULT = "default"
|
1141 | e64b8beb | Iustin Pop | |
1142 | 246f4067 | Guido Trotter | # NIC_* constants are used inside the ganeti config
|
1143 | ac061be9 | Guido Trotter | NIC_MODE = "mode"
|
1144 | ac061be9 | Guido Trotter | NIC_LINK = "link"
|
1145 | ac061be9 | Guido Trotter | |
1146 | ac061be9 | Guido Trotter | NIC_MODE_BRIDGED = "bridged"
|
1147 | ac061be9 | Guido Trotter | NIC_MODE_ROUTED = "routed"
|
1148 | 57fb6fcb | Guido Trotter | NIC_MODE_OVS = "openvswitch"
|
1149 | eaa4c57c | Dimitris Aragiorgis | NIC_IP_POOL = "pool"
|
1150 | ac061be9 | Guido Trotter | |
1151 | b8028dcf | Michael Hanselmann | NIC_VALID_MODES = compat.UniqueFrozenset([ |
1152 | b8028dcf | Michael Hanselmann | NIC_MODE_BRIDGED, |
1153 | b8028dcf | Michael Hanselmann | NIC_MODE_ROUTED, |
1154 | b8028dcf | Michael Hanselmann | NIC_MODE_OVS, |
1155 | b8028dcf | Michael Hanselmann | ]) |
1156 | ac061be9 | Guido Trotter | |
1157 | 2556424d | Iustin Pop | RESERVE_ACTION = "reserve"
|
1158 | 2556424d | Iustin Pop | RELEASE_ACTION = "release"
|
1159 | e81eef56 | Dimitris Aragiorgis | |
1160 | eaa4c57c | Dimitris Aragiorgis | # An extra description of the network.
|
1161 | eaa4c57c | Dimitris Aragiorgis | # Can be used by hooks/kvm-vif-bridge to apply different rules
|
1162 | eaa4c57c | Dimitris Aragiorgis | NETWORK_TYPE_PRIVATE = "private"
|
1163 | eaa4c57c | Dimitris Aragiorgis | NETWORK_TYPE_PUBLIC = "public"
|
1164 | eaa4c57c | Dimitris Aragiorgis | |
1165 | b8028dcf | Michael Hanselmann | NETWORK_VALID_TYPES = compat.UniqueFrozenset([ |
1166 | b8028dcf | Michael Hanselmann | NETWORK_TYPE_PRIVATE, |
1167 | b8028dcf | Michael Hanselmann | NETWORK_TYPE_PUBLIC, |
1168 | b8028dcf | Michael Hanselmann | ]) |
1169 | eaa4c57c | Dimitris Aragiorgis | |
1170 | ac061be9 | Guido Trotter | NICS_PARAMETER_TYPES = { |
1171 | 2e1a6024 | Guido Trotter | NIC_MODE: VTYPE_STRING, |
1172 | 2e1a6024 | Guido Trotter | NIC_LINK: VTYPE_STRING, |
1173 | 2e1a6024 | Guido Trotter | } |
1174 | ac061be9 | Guido Trotter | |
1175 | ac061be9 | Guido Trotter | NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
|
1176 | e64b8beb | Iustin Pop | |
1177 | 246f4067 | Guido Trotter | # IDISK_* constants are used in opcodes, to create/change disks
|
1178 | bd061c35 | Guido Trotter | IDISK_SIZE = "size"
|
1179 | bd061c35 | Guido Trotter | IDISK_MODE = "mode"
|
1180 | 8494604f | Apollon Oikonomopoulos | IDISK_ADOPT = "adopt"
|
1181 | 7af3534e | Dmitry Chernyak | IDISK_VG = "vg"
|
1182 | 87001920 | Iustin Pop | IDISK_METAVG = "metavg"
|
1183 | 938adc87 | Constantinos Venetsanopoulos | IDISK_PROVIDER = "provider"
|
1184 | 8494604f | Apollon Oikonomopoulos | IDISK_PARAMS_TYPES = { |
1185 | 8494604f | Apollon Oikonomopoulos | IDISK_SIZE: VTYPE_SIZE, |
1186 | 8494604f | Apollon Oikonomopoulos | IDISK_MODE: VTYPE_STRING, |
1187 | 8494604f | Apollon Oikonomopoulos | IDISK_ADOPT: VTYPE_STRING, |
1188 | 7af3534e | Dmitry Chernyak | IDISK_VG: VTYPE_STRING, |
1189 | 87001920 | Iustin Pop | IDISK_METAVG: VTYPE_STRING, |
1190 | 938adc87 | Constantinos Venetsanopoulos | IDISK_PROVIDER: VTYPE_STRING, |
1191 | 8494604f | Apollon Oikonomopoulos | } |
1192 | cc87d736 | Michael Hanselmann | IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
|
1193 | cc87d736 | Michael Hanselmann | |
1194 | 246f4067 | Guido Trotter | # INIC_* constants are used in opcodes, to create/change nics
|
1195 | bd061c35 | Guido Trotter | INIC_MAC = "mac"
|
1196 | bd061c35 | Guido Trotter | INIC_IP = "ip"
|
1197 | bd061c35 | Guido Trotter | INIC_MODE = "mode"
|
1198 | bd061c35 | Guido Trotter | INIC_LINK = "link"
|
1199 | eaa4c57c | Dimitris Aragiorgis | INIC_NETWORK = "network"
|
1200 | cc87d736 | Michael Hanselmann | INIC_PARAMS_TYPES = { |
1201 | cc87d736 | Michael Hanselmann | INIC_IP: VTYPE_MAYBE_STRING, |
1202 | cc87d736 | Michael Hanselmann | INIC_LINK: VTYPE_STRING, |
1203 | cc87d736 | Michael Hanselmann | INIC_MAC: VTYPE_STRING, |
1204 | cc87d736 | Michael Hanselmann | INIC_MODE: VTYPE_STRING, |
1205 | eaa4c57c | Dimitris Aragiorgis | INIC_NETWORK: VTYPE_MAYBE_STRING, |
1206 | cc87d736 | Michael Hanselmann | } |
1207 | cc87d736 | Michael Hanselmann | INIC_PARAMS = frozenset(INIC_PARAMS_TYPES.keys())
|
1208 | bd061c35 | Guido Trotter | |
1209 | 2584d4a4 | Alexander Schreiber | # Hypervisor constants
|
1210 | 00cd937c | Iustin Pop | HT_XEN_PVM = "xen-pvm"
|
1211 | 2584d4a4 | Alexander Schreiber | HT_FAKE = "fake"
|
1212 | 00cd937c | Iustin Pop | HT_XEN_HVM = "xen-hvm"
|
1213 | 550e49b9 | Guido Trotter | HT_KVM = "kvm"
|
1214 | 48297fa2 | Iustin Pop | HT_CHROOT = "chroot"
|
1215 | 4b5e40a5 | Iustin Pop | HT_LXC = "lxc"
|
1216 | b8028dcf | Michael Hanselmann | HYPER_TYPES = compat.UniqueFrozenset([ |
1217 | 4b5e40a5 | Iustin Pop | HT_XEN_PVM, |
1218 | 4b5e40a5 | Iustin Pop | HT_FAKE, |
1219 | 4b5e40a5 | Iustin Pop | HT_XEN_HVM, |
1220 | 4b5e40a5 | Iustin Pop | HT_KVM, |
1221 | 4b5e40a5 | Iustin Pop | HT_CHROOT, |
1222 | 4b5e40a5 | Iustin Pop | HT_LXC, |
1223 | 4b5e40a5 | Iustin Pop | ]) |
1224 | b8028dcf | Michael Hanselmann | HTS_REQ_PORT = compat.UniqueFrozenset([HT_XEN_HVM, HT_KVM]) |
1225 | 2584d4a4 | Alexander Schreiber | |
1226 | 377d74c9 | Guido Trotter | VNC_BASE_PORT = 5900
|
1227 | 0d2cd893 | Manuel Franceschini | VNC_DEFAULT_BIND_ADDRESS = IP4_ADDRESS_ANY |
1228 | e54c4c5e | Guido Trotter | |
1229 | 835528af | Iustin Pop | # NIC types
|
1230 | d08f6067 | Guido Trotter | HT_NIC_RTL8139 = "rtl8139"
|
1231 | d08f6067 | Guido Trotter | HT_NIC_NE2K_PCI = "ne2k_pci"
|
1232 | d08f6067 | Guido Trotter | HT_NIC_NE2K_ISA = "ne2k_isa"
|
1233 | 43440815 | Guido Trotter | HT_NIC_I82551 = "i82551"
|
1234 | 43440815 | Guido Trotter | HT_NIC_I85557B = "i82557b"
|
1235 | 43440815 | Guido Trotter | HT_NIC_I8259ER = "i82559er"
|
1236 | 43440815 | Guido Trotter | HT_NIC_PCNET = "pcnet"
|
1237 | 43440815 | Guido Trotter | HT_NIC_E1000 = "e1000"
|
1238 | d08f6067 | Guido Trotter | HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
|
1239 | 43440815 | Guido Trotter | |
1240 | b8028dcf | Michael Hanselmann | HT_HVM_VALID_NIC_TYPES = compat.UniqueFrozenset([ |
1241 | 21daa4a8 | Stephen Shirley | HT_NIC_RTL8139, |
1242 | 21daa4a8 | Stephen Shirley | HT_NIC_NE2K_PCI, |
1243 | 21daa4a8 | Stephen Shirley | HT_NIC_E1000, |
1244 | 21daa4a8 | Stephen Shirley | HT_NIC_NE2K_ISA, |
1245 | 3c286190 | Dimitris Aragiorgis | HT_NIC_PARAVIRTUAL, |
1246 | 21daa4a8 | Stephen Shirley | ]) |
1247 | b8028dcf | Michael Hanselmann | HT_KVM_VALID_NIC_TYPES = compat.UniqueFrozenset([ |
1248 | 21daa4a8 | Stephen Shirley | HT_NIC_RTL8139, |
1249 | 21daa4a8 | Stephen Shirley | HT_NIC_NE2K_PCI, |
1250 | 21daa4a8 | Stephen Shirley | HT_NIC_NE2K_ISA, |
1251 | 21daa4a8 | Stephen Shirley | HT_NIC_I82551, |
1252 | 21daa4a8 | Stephen Shirley | HT_NIC_I85557B, |
1253 | 21daa4a8 | Stephen Shirley | HT_NIC_I8259ER, |
1254 | 21daa4a8 | Stephen Shirley | HT_NIC_PCNET, |
1255 | 21daa4a8 | Stephen Shirley | HT_NIC_E1000, |
1256 | 3c286190 | Dimitris Aragiorgis | HT_NIC_PARAVIRTUAL, |
1257 | 21daa4a8 | Stephen Shirley | ]) |
1258 | 21daa4a8 | Stephen Shirley | |
1259 | 835528af | Iustin Pop | # Disk types
|
1260 | 835528af | Iustin Pop | HT_DISK_IOEMU = "ioemu"
|
1261 | 835528af | Iustin Pop | HT_DISK_IDE = "ide"
|
1262 | 835528af | Iustin Pop | HT_DISK_SCSI = "scsi"
|
1263 | 835528af | Iustin Pop | HT_DISK_SD = "sd"
|
1264 | 835528af | Iustin Pop | HT_DISK_MTD = "mtd"
|
1265 | 835528af | Iustin Pop | HT_DISK_PFLASH = "pflash"
|
1266 | 835528af | Iustin Pop | |
1267 | ea0f3d7a | Iustin Pop | HT_CACHE_DEFAULT = "default"
|
1268 | ea0f3d7a | Iustin Pop | HT_CACHE_NONE = "none"
|
1269 | ea0f3d7a | Iustin Pop | HT_CACHE_WTHROUGH = "writethrough"
|
1270 | ea0f3d7a | Iustin Pop | HT_CACHE_WBACK = "writeback"
|
1271 | b8028dcf | Michael Hanselmann | HT_VALID_CACHE_TYPES = compat.UniqueFrozenset([ |
1272 | 21daa4a8 | Stephen Shirley | HT_CACHE_DEFAULT, |
1273 | 21daa4a8 | Stephen Shirley | HT_CACHE_NONE, |
1274 | 21daa4a8 | Stephen Shirley | HT_CACHE_WTHROUGH, |
1275 | 3c286190 | Dimitris Aragiorgis | HT_CACHE_WBACK, |
1276 | 21daa4a8 | Stephen Shirley | ]) |
1277 | ea0f3d7a | Iustin Pop | |
1278 | b8028dcf | Michael Hanselmann | HT_HVM_VALID_DISK_TYPES = compat.UniqueFrozenset([ |
1279 | b8028dcf | Michael Hanselmann | HT_DISK_PARAVIRTUAL, |
1280 | b8028dcf | Michael Hanselmann | HT_DISK_IOEMU, |
1281 | b8028dcf | Michael Hanselmann | ]) |
1282 | b8028dcf | Michael Hanselmann | HT_KVM_VALID_DISK_TYPES = compat.UniqueFrozenset([ |
1283 | 21daa4a8 | Stephen Shirley | HT_DISK_PARAVIRTUAL, |
1284 | 21daa4a8 | Stephen Shirley | HT_DISK_IDE, |
1285 | 21daa4a8 | Stephen Shirley | HT_DISK_SCSI, |
1286 | 21daa4a8 | Stephen Shirley | HT_DISK_SD, |
1287 | 21daa4a8 | Stephen Shirley | HT_DISK_MTD, |
1288 | 3c286190 | Dimitris Aragiorgis | HT_DISK_PFLASH, |
1289 | 21daa4a8 | Stephen Shirley | ]) |
1290 | b894f5a8 | Alexander Schreiber | |
1291 | 835528af | Iustin Pop | # Mouse types:
|
1292 | 835528af | Iustin Pop | HT_MOUSE_MOUSE = "mouse"
|
1293 | 835528af | Iustin Pop | HT_MOUSE_TABLET = "tablet"
|
1294 | 835528af | Iustin Pop | |
1295 | b8028dcf | Michael Hanselmann | HT_KVM_VALID_MOUSE_TYPES = compat.UniqueFrozenset([ |
1296 | b8028dcf | Michael Hanselmann | HT_MOUSE_MOUSE, |
1297 | b8028dcf | Michael Hanselmann | HT_MOUSE_TABLET, |
1298 | b8028dcf | Michael Hanselmann | ]) |
1299 | 835528af | Iustin Pop | |
1300 | 835528af | Iustin Pop | # Boot order
|
1301 | cc130cc7 | Marco Casavecchia | HT_BO_FLOPPY = "floppy"
|
1302 | 835528af | Iustin Pop | HT_BO_CDROM = "cdrom"
|
1303 | 835528af | Iustin Pop | HT_BO_DISK = "disk"
|
1304 | 835528af | Iustin Pop | HT_BO_NETWORK = "network"
|
1305 | 835528af | Iustin Pop | |
1306 | b8028dcf | Michael Hanselmann | HT_KVM_VALID_BO_TYPES = compat.UniqueFrozenset([ |
1307 | 21daa4a8 | Stephen Shirley | HT_BO_FLOPPY, |
1308 | 21daa4a8 | Stephen Shirley | HT_BO_CDROM, |
1309 | 21daa4a8 | Stephen Shirley | HT_BO_DISK, |
1310 | 3c286190 | Dimitris Aragiorgis | HT_BO_NETWORK, |
1311 | 21daa4a8 | Stephen Shirley | ]) |
1312 | 835528af | Iustin Pop | |
1313 | ea064d24 | Andrea Spadaccini | # SPICE lossless image compression options
|
1314 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_GLZ = "auto_glz"
|
1315 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_LZ = "auto_lz"
|
1316 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_QUIC = "quic"
|
1317 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_GLZ = "glz"
|
1318 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_LZ = "lz"
|
1319 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_OFF = "off"
|
1320 | ea064d24 | Andrea Spadaccini | |
1321 | b8028dcf | Michael Hanselmann | HT_KVM_SPICE_VALID_LOSSLESS_IMG_COMPR_OPTIONS = compat.UniqueFrozenset([ |
1322 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_GLZ, |
1323 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_LZ, |
1324 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_QUIC, |
1325 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_GLZ, |
1326 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_LZ, |
1327 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSLESS_IMG_COMPR_OFF, |
1328 | ea064d24 | Andrea Spadaccini | ]) |
1329 | ea064d24 | Andrea Spadaccini | |
1330 | ea064d24 | Andrea Spadaccini | # SPICE lossy image compression options (valid for both jpeg and zlib-glz)
|
1331 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSY_IMG_COMPR_AUTO = "auto"
|
1332 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSY_IMG_COMPR_NEVER = "never"
|
1333 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSY_IMG_COMPR_ALWAYS = "always"
|
1334 | ea064d24 | Andrea Spadaccini | |
1335 | b8028dcf | Michael Hanselmann | HT_KVM_SPICE_VALID_LOSSY_IMG_COMPR_OPTIONS = compat.UniqueFrozenset([ |
1336 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSY_IMG_COMPR_AUTO, |
1337 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSY_IMG_COMPR_NEVER, |
1338 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_LOSSY_IMG_COMPR_ALWAYS, |
1339 | ea064d24 | Andrea Spadaccini | ]) |
1340 | ea064d24 | Andrea Spadaccini | |
1341 | ea064d24 | Andrea Spadaccini | # SPICE video stream detection
|
1342 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_VIDEO_STREAM_DETECTION_OFF = "off"
|
1343 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_VIDEO_STREAM_DETECTION_ALL = "all"
|
1344 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_VIDEO_STREAM_DETECTION_FILTER = "filter"
|
1345 | ea064d24 | Andrea Spadaccini | |
1346 | b8028dcf | Michael Hanselmann | HT_KVM_SPICE_VALID_VIDEO_STREAM_DETECTION_OPTIONS = compat.UniqueFrozenset([ |
1347 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_VIDEO_STREAM_DETECTION_OFF, |
1348 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_VIDEO_STREAM_DETECTION_ALL, |
1349 | ea064d24 | Andrea Spadaccini | HT_KVM_SPICE_VIDEO_STREAM_DETECTION_FILTER, |
1350 | ea064d24 | Andrea Spadaccini | ]) |
1351 | ea064d24 | Andrea Spadaccini | |
1352 | 3424767f | Guido Trotter | # Security models
|
1353 | 3424767f | Guido Trotter | HT_SM_NONE = "none"
|
1354 | 3424767f | Guido Trotter | HT_SM_USER = "user"
|
1355 | 3424767f | Guido Trotter | HT_SM_POOL = "pool"
|
1356 | 3424767f | Guido Trotter | |
1357 | b8028dcf | Michael Hanselmann | HT_KVM_VALID_SM_TYPES = compat.UniqueFrozenset([ |
1358 | b8028dcf | Michael Hanselmann | HT_SM_NONE, |
1359 | b8028dcf | Michael Hanselmann | HT_SM_USER, |
1360 | b8028dcf | Michael Hanselmann | HT_SM_POOL, |
1361 | b8028dcf | Michael Hanselmann | ]) |
1362 | 3424767f | Guido Trotter | |
1363 | 7ba594c0 | Guido Trotter | # Kvm flag values
|
1364 | 7ba594c0 | Guido Trotter | HT_KVM_ENABLED = "enabled"
|
1365 | 7ba594c0 | Guido Trotter | HT_KVM_DISABLED = "disabled"
|
1366 | 7ba594c0 | Guido Trotter | |
1367 | b8028dcf | Michael Hanselmann | HT_KVM_FLAG_VALUES = compat.UniqueFrozenset([HT_KVM_ENABLED, HT_KVM_DISABLED]) |
1368 | 7ba594c0 | Guido Trotter | |
1369 | e71b9ef4 | Iustin Pop | # Migration type
|
1370 | e71b9ef4 | Iustin Pop | HT_MIGRATION_LIVE = "live"
|
1371 | e71b9ef4 | Iustin Pop | HT_MIGRATION_NONLIVE = "non-live"
|
1372 | b8028dcf | Michael Hanselmann | HT_MIGRATION_MODES = compat.UniqueFrozenset([ |
1373 | b8028dcf | Michael Hanselmann | HT_MIGRATION_LIVE, |
1374 | b8028dcf | Michael Hanselmann | HT_MIGRATION_NONLIVE, |
1375 | b8028dcf | Michael Hanselmann | ]) |
1376 | e71b9ef4 | Iustin Pop | |
1377 | e54c4c5e | Guido Trotter | # Cluster Verify steps
|
1378 | d0c8c01d | Iustin Pop | VERIFY_NPLUSONE_MEM = "nplusone_mem"
|
1379 | b8028dcf | Michael Hanselmann | VERIFY_OPTIONAL_CHECKS = compat.UniqueFrozenset([VERIFY_NPLUSONE_MEM]) |
1380 | e54c4c5e | Guido Trotter | |
1381 | eedf99b5 | Andrea Spadaccini | # Cluster Verify error classes
|
1382 | eedf99b5 | Andrea Spadaccini | CV_TCLUSTER = "cluster"
|
1383 | eedf99b5 | Andrea Spadaccini | CV_TNODE = "node"
|
1384 | eedf99b5 | Andrea Spadaccini | CV_TINSTANCE = "instance"
|
1385 | eedf99b5 | Andrea Spadaccini | |
1386 | 3ac3f5e4 | Andrea Spadaccini | # Cluster Verify error codes and documentation
|
1387 | 3ac3f5e4 | Andrea Spadaccini | CV_ECLUSTERCFG = \ |
1388 | 3ac3f5e4 | Andrea Spadaccini | (CV_TCLUSTER, "ECLUSTERCFG", "Cluster configuration verification failure") |
1389 | 3ac3f5e4 | Andrea Spadaccini | CV_ECLUSTERCERT = \ |
1390 | 3ac3f5e4 | Andrea Spadaccini | (CV_TCLUSTER, "ECLUSTERCERT",
|
1391 | 3ac3f5e4 | Andrea Spadaccini | "Cluster certificate files verification failure")
|
1392 | 3ac3f5e4 | Andrea Spadaccini | CV_ECLUSTERFILECHECK = \ |
1393 | 3ac3f5e4 | Andrea Spadaccini | (CV_TCLUSTER, "ECLUSTERFILECHECK",
|
1394 | 3ac3f5e4 | Andrea Spadaccini | "Cluster configuration verification failure")
|
1395 | 3ac3f5e4 | Andrea Spadaccini | CV_ECLUSTERDANGLINGNODES = \ |
1396 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ECLUSTERDANGLINGNODES",
|
1397 | 3ac3f5e4 | Andrea Spadaccini | "Some nodes belong to non-existing groups")
|
1398 | 3ac3f5e4 | Andrea Spadaccini | CV_ECLUSTERDANGLINGINST = \ |
1399 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ECLUSTERDANGLINGINST",
|
1400 | 3ac3f5e4 | Andrea Spadaccini | "Some instances have a non-existing primary node")
|
1401 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCEBADNODE = \ |
1402 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCEBADNODE",
|
1403 | 3ac3f5e4 | Andrea Spadaccini | "Instance marked as running lives on an offline node")
|
1404 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCEDOWN = \ |
1405 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCEDOWN", "Instance not running on its primary node") |
1406 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCELAYOUT = \ |
1407 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCELAYOUT", "Instance has multiple secondary nodes") |
1408 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCEMISSINGDISK = \ |
1409 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCEMISSINGDISK", "Missing volume on an instance") |
1410 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCEFAULTYDISK = \ |
1411 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCEFAULTYDISK",
|
1412 | 3ac3f5e4 | Andrea Spadaccini | "Impossible to retrieve status for a disk")
|
1413 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCEWRONGNODE = \ |
1414 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCEWRONGNODE", "Instance running on the wrong node") |
1415 | 3ac3f5e4 | Andrea Spadaccini | CV_EINSTANCESPLITGROUPS = \ |
1416 | 3ac3f5e4 | Andrea Spadaccini | (CV_TINSTANCE, "EINSTANCESPLITGROUPS",
|
1417 | 3ac3f5e4 | Andrea Spadaccini | "Instance with primary and secondary nodes in different groups")
|
1418 | 38c37a51 | Agata Murawska | CV_EINSTANCEPOLICY = \ |
1419 | 38c37a51 | Agata Murawska | (CV_TINSTANCE, "EINSTANCEPOLICY",
|
1420 | 38c37a51 | Agata Murawska | "Instance does not meet policy")
|
1421 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEDRBD = \ |
1422 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEDRBD", "Error parsing the DRBD status file") |
1423 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEDRBDHELPER = \ |
1424 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEDRBDHELPER", "Error caused by the DRBD helper") |
1425 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEFILECHECK = \ |
1426 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEFILECHECK",
|
1427 | 3ac3f5e4 | Andrea Spadaccini | "Error retrieving the checksum of the node files")
|
1428 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEHOOKS = \ |
1429 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEHOOKS", "Communication failure in hooks execution") |
1430 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEHV = \ |
1431 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEHV", "Hypervisor parameters verification failure") |
1432 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODELVM = \ |
1433 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODELVM", "LVM-related node error") |
1434 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEN1 = \ |
1435 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEN1", "Not enough memory to accommodate instance failovers") |
1436 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODENET = \ |
1437 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODENET", "Network-related node error") |
1438 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEOS = \ |
1439 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEOS", "OS-related node error") |
1440 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEORPHANINSTANCE = \ |
1441 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEORPHANINSTANCE", "Unknown intance running on a node") |
1442 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEORPHANLV = \ |
1443 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEORPHANLV", "Unknown LVM logical volume") |
1444 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODERPC = \ |
1445 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODERPC",
|
1446 | 3ac3f5e4 | Andrea Spadaccini | "Error during connection to the primary node of an instance")
|
1447 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODESSH = \ |
1448 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODESSH", "SSH-related node error") |
1449 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEVERSION = \ |
1450 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEVERSION",
|
1451 | 3ac3f5e4 | Andrea Spadaccini | "Protocol version mismatch or Ganeti version mismatch")
|
1452 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODESETUP = \ |
1453 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODESETUP", "Node setup error") |
1454 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODETIME = \ |
1455 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODETIME", "Node returned invalid time") |
1456 | 3ac3f5e4 | Andrea Spadaccini | CV_ENODEOOBPATH = \ |
1457 | 3ac3f5e4 | Andrea Spadaccini | (CV_TNODE, "ENODEOOBPATH", "Invalid Out Of Band path") |
1458 | 17b0b812 | Andrea Spadaccini | CV_ENODEUSERSCRIPTS = \ |
1459 | 17b0b812 | Andrea Spadaccini | (CV_TNODE, "ENODEUSERSCRIPTS", "User scripts not present or not executable") |
1460 | 72b35807 | Michael Hanselmann | CV_ENODEFILESTORAGEPATHS = \ |
1461 | 72b35807 | Michael Hanselmann | (CV_TNODE, "ENODEFILESTORAGEPATHS", "Detected bad file storage paths") |
1462 | eedf99b5 | Andrea Spadaccini | |
1463 | b8028dcf | Michael Hanselmann | CV_ALL_ECODES = compat.UniqueFrozenset([ |
1464 | eedf99b5 | Andrea Spadaccini | CV_ECLUSTERCFG, |
1465 | eedf99b5 | Andrea Spadaccini | CV_ECLUSTERCERT, |
1466 | eedf99b5 | Andrea Spadaccini | CV_ECLUSTERFILECHECK, |
1467 | eedf99b5 | Andrea Spadaccini | CV_ECLUSTERDANGLINGNODES, |
1468 | eedf99b5 | Andrea Spadaccini | CV_ECLUSTERDANGLINGINST, |
1469 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCEBADNODE, |
1470 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCEDOWN, |
1471 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCELAYOUT, |
1472 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCEMISSINGDISK, |
1473 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCEFAULTYDISK, |
1474 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCEWRONGNODE, |
1475 | eedf99b5 | Andrea Spadaccini | CV_EINSTANCESPLITGROUPS, |
1476 | 38c37a51 | Agata Murawska | CV_EINSTANCEPOLICY, |
1477 | eedf99b5 | Andrea Spadaccini | CV_ENODEDRBD, |
1478 | eedf99b5 | Andrea Spadaccini | CV_ENODEDRBDHELPER, |
1479 | eedf99b5 | Andrea Spadaccini | CV_ENODEFILECHECK, |
1480 | eedf99b5 | Andrea Spadaccini | CV_ENODEHOOKS, |
1481 | eedf99b5 | Andrea Spadaccini | CV_ENODEHV, |
1482 | eedf99b5 | Andrea Spadaccini | CV_ENODELVM, |
1483 | eedf99b5 | Andrea Spadaccini | CV_ENODEN1, |
1484 | eedf99b5 | Andrea Spadaccini | CV_ENODENET, |
1485 | eedf99b5 | Andrea Spadaccini | CV_ENODEOS, |
1486 | eedf99b5 | Andrea Spadaccini | CV_ENODEORPHANINSTANCE, |
1487 | eedf99b5 | Andrea Spadaccini | CV_ENODEORPHANLV, |
1488 | eedf99b5 | Andrea Spadaccini | CV_ENODERPC, |
1489 | eedf99b5 | Andrea Spadaccini | CV_ENODESSH, |
1490 | eedf99b5 | Andrea Spadaccini | CV_ENODEVERSION, |
1491 | eedf99b5 | Andrea Spadaccini | CV_ENODESETUP, |
1492 | eedf99b5 | Andrea Spadaccini | CV_ENODETIME, |
1493 | eedf99b5 | Andrea Spadaccini | CV_ENODEOOBPATH, |
1494 | 17b0b812 | Andrea Spadaccini | CV_ENODEUSERSCRIPTS, |
1495 | 72b35807 | Michael Hanselmann | CV_ENODEFILESTORAGEPATHS, |
1496 | eedf99b5 | Andrea Spadaccini | ]) |
1497 | eedf99b5 | Andrea Spadaccini | |
1498 | b8028dcf | Michael Hanselmann | CV_ALL_ECODES_STRINGS = \ |
1499 | b8028dcf | Michael Hanselmann | compat.UniqueFrozenset(estr for (_, estr, _) in CV_ALL_ECODES) |
1500 | eedf99b5 | Andrea Spadaccini | |
1501 | 25361b9a | Iustin Pop | # Node verify constants
|
1502 | 7ef40fbe | Luca Bigliardi | NV_DRBDHELPER = "drbd-helper"
|
1503 | b0d85178 | Iustin Pop | NV_DRBDLIST = "drbd-list"
|
1504 | 25361b9a | Iustin Pop | NV_FILELIST = "filelist"
|
1505 | 25361b9a | Iustin Pop | NV_HVINFO = "hvinfo"
|
1506 | 25361b9a | Iustin Pop | NV_HYPERVISOR = "hypervisor"
|
1507 | 58a59652 | Iustin Pop | NV_HVPARAMS = "hvparms"
|
1508 | 25361b9a | Iustin Pop | NV_INSTANCELIST = "instancelist"
|
1509 | b0d85178 | Iustin Pop | NV_LVLIST = "lvlist"
|
1510 | b0d85178 | Iustin Pop | NV_MASTERIP = "master-ip"
|
1511 | 25361b9a | Iustin Pop | NV_NODELIST = "nodelist"
|
1512 | 25361b9a | Iustin Pop | NV_NODENETTEST = "node-net-test"
|
1513 | 7c0aa8e9 | Iustin Pop | NV_NODESETUP = "nodesetup"
|
1514 | b0d85178 | Iustin Pop | NV_OSLIST = "oslist"
|
1515 | b0d85178 | Iustin Pop | NV_PVLIST = "pvlist"
|
1516 | 313b2dd4 | Michael Hanselmann | NV_TIME = "time"
|
1517 | b0d85178 | Iustin Pop | NV_VERSION = "version"
|
1518 | b0d85178 | Iustin Pop | NV_VGLIST = "vglist"
|
1519 | 8964ee14 | Iustin Pop | NV_VMNODES = "vmnodes"
|
1520 | 16f41f24 | René Nussbaumer | NV_OOB_PATHS = "oob-paths"
|
1521 | 20d317d4 | Iustin Pop | NV_BRIDGES = "bridges"
|
1522 | 17b0b812 | Andrea Spadaccini | NV_USERSCRIPTS = "user-scripts"
|
1523 | 72b35807 | Michael Hanselmann | NV_FILE_STORAGE_PATHS = "file-storage-paths"
|
1524 | 25361b9a | Iustin Pop | |
1525 | 61a980a9 | Michael Hanselmann | # Instance status
|
1526 | 61a980a9 | Michael Hanselmann | INSTST_RUNNING = "running"
|
1527 | 61a980a9 | Michael Hanselmann | INSTST_ADMINDOWN = "ADMIN_down"
|
1528 | 2e04d454 | Agata Murawska | INSTST_ADMINOFFLINE = "ADMIN_offline"
|
1529 | 61a980a9 | Michael Hanselmann | INSTST_NODEOFFLINE = "ERROR_nodeoffline"
|
1530 | 61a980a9 | Michael Hanselmann | INSTST_NODEDOWN = "ERROR_nodedown"
|
1531 | 61a980a9 | Michael Hanselmann | INSTST_WRONGNODE = "ERROR_wrongnode"
|
1532 | 61a980a9 | Michael Hanselmann | INSTST_ERRORUP = "ERROR_up"
|
1533 | 61a980a9 | Michael Hanselmann | INSTST_ERRORDOWN = "ERROR_down"
|
1534 | b8028dcf | Michael Hanselmann | INSTST_ALL = compat.UniqueFrozenset([ |
1535 | 61a980a9 | Michael Hanselmann | INSTST_RUNNING, |
1536 | 61a980a9 | Michael Hanselmann | INSTST_ADMINDOWN, |
1537 | 2e04d454 | Agata Murawska | INSTST_ADMINOFFLINE, |
1538 | 61a980a9 | Michael Hanselmann | INSTST_NODEOFFLINE, |
1539 | 61a980a9 | Michael Hanselmann | INSTST_NODEDOWN, |
1540 | 61a980a9 | Michael Hanselmann | INSTST_WRONGNODE, |
1541 | 61a980a9 | Michael Hanselmann | INSTST_ERRORUP, |
1542 | 61a980a9 | Michael Hanselmann | INSTST_ERRORDOWN, |
1543 | 61a980a9 | Michael Hanselmann | ]) |
1544 | 61a980a9 | Michael Hanselmann | |
1545 | 9ca8a7c5 | Agata Murawska | # Admin states
|
1546 | 9ca8a7c5 | Agata Murawska | ADMINST_UP = "up"
|
1547 | 9ca8a7c5 | Agata Murawska | ADMINST_DOWN = "down"
|
1548 | 9ca8a7c5 | Agata Murawska | ADMINST_OFFLINE = "offline"
|
1549 | b8028dcf | Michael Hanselmann | ADMINST_ALL = compat.UniqueFrozenset([ |
1550 | 9ca8a7c5 | Agata Murawska | ADMINST_UP, |
1551 | 9ca8a7c5 | Agata Murawska | ADMINST_DOWN, |
1552 | 9ca8a7c5 | Agata Murawska | ADMINST_OFFLINE, |
1553 | 9ca8a7c5 | Agata Murawska | ]) |
1554 | 9ca8a7c5 | Agata Murawska | |
1555 | 1e28e3b8 | Michael Hanselmann | # Node roles
|
1556 | 1e28e3b8 | Michael Hanselmann | NR_REGULAR = "R"
|
1557 | 1e28e3b8 | Michael Hanselmann | NR_MASTER = "M"
|
1558 | 1e28e3b8 | Michael Hanselmann | NR_MCANDIDATE = "C"
|
1559 | 1e28e3b8 | Michael Hanselmann | NR_DRAINED = "D"
|
1560 | 1e28e3b8 | Michael Hanselmann | NR_OFFLINE = "O"
|
1561 | b8028dcf | Michael Hanselmann | NR_ALL = compat.UniqueFrozenset([ |
1562 | 1e28e3b8 | Michael Hanselmann | NR_REGULAR, |
1563 | 1e28e3b8 | Michael Hanselmann | NR_MASTER, |
1564 | 1e28e3b8 | Michael Hanselmann | NR_MCANDIDATE, |
1565 | 1e28e3b8 | Michael Hanselmann | NR_DRAINED, |
1566 | 1e28e3b8 | Michael Hanselmann | NR_OFFLINE, |
1567 | 1e28e3b8 | Michael Hanselmann | ]) |
1568 | 1e28e3b8 | Michael Hanselmann | |
1569 | b98bf262 | Michael Hanselmann | # SSL certificate check constants (in days)
|
1570 | b98bf262 | Michael Hanselmann | SSL_CERT_EXPIRATION_WARN = 30
|
1571 | b98bf262 | Michael Hanselmann | SSL_CERT_EXPIRATION_ERROR = 7
|
1572 | b98bf262 | Michael Hanselmann | |
1573 | d61df03e | Iustin Pop | # Allocator framework constants
|
1574 | 77031881 | Iustin Pop | IALLOCATOR_VERSION = 2
|
1575 | 298fe380 | Iustin Pop | IALLOCATOR_DIR_IN = "in"
|
1576 | 298fe380 | Iustin Pop | IALLOCATOR_DIR_OUT = "out"
|
1577 | b8028dcf | Michael Hanselmann | VALID_IALLOCATOR_DIRECTIONS = compat.UniqueFrozenset([ |
1578 | 3636400f | Iustin Pop | IALLOCATOR_DIR_IN, |
1579 | 3636400f | Iustin Pop | IALLOCATOR_DIR_OUT, |
1580 | 3636400f | Iustin Pop | ]) |
1581 | 298fe380 | Iustin Pop | IALLOCATOR_MODE_ALLOC = "allocate"
|
1582 | 298fe380 | Iustin Pop | IALLOCATOR_MODE_RELOC = "relocate"
|
1583 | 60152bbe | Michael Hanselmann | IALLOCATOR_MODE_CHG_GROUP = "change-group"
|
1584 | 60152bbe | Michael Hanselmann | IALLOCATOR_MODE_NODE_EVAC = "node-evacuate"
|
1585 | 85d96a3c | René Nussbaumer | IALLOCATOR_MODE_MULTI_ALLOC = "multi-allocate"
|
1586 | b8028dcf | Michael Hanselmann | VALID_IALLOCATOR_MODES = compat.UniqueFrozenset([ |
1587 | 3636400f | Iustin Pop | IALLOCATOR_MODE_ALLOC, |
1588 | 3636400f | Iustin Pop | IALLOCATOR_MODE_RELOC, |
1589 | 60152bbe | Michael Hanselmann | IALLOCATOR_MODE_CHG_GROUP, |
1590 | 60152bbe | Michael Hanselmann | IALLOCATOR_MODE_NODE_EVAC, |
1591 | 85d96a3c | René Nussbaumer | IALLOCATOR_MODE_MULTI_ALLOC, |
1592 | 3636400f | Iustin Pop | ]) |
1593 | 298fe380 | Iustin Pop | IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH |
1594 | 43a8f36a | Bernardo Dal Seno | DEFAULT_IALLOCATOR_SHORTCUT = "."
|
1595 | 5f33b613 | Michael Hanselmann | |
1596 | 60152bbe | Michael Hanselmann | IALLOCATOR_NEVAC_PRI = "primary-only"
|
1597 | 60152bbe | Michael Hanselmann | IALLOCATOR_NEVAC_SEC = "secondary-only"
|
1598 | 60152bbe | Michael Hanselmann | IALLOCATOR_NEVAC_ALL = "all"
|
1599 | b8028dcf | Michael Hanselmann | IALLOCATOR_NEVAC_MODES = compat.UniqueFrozenset([ |
1600 | 60152bbe | Michael Hanselmann | IALLOCATOR_NEVAC_PRI, |
1601 | 60152bbe | Michael Hanselmann | IALLOCATOR_NEVAC_SEC, |
1602 | 60152bbe | Michael Hanselmann | IALLOCATOR_NEVAC_ALL, |
1603 | 60152bbe | Michael Hanselmann | ]) |
1604 | 60152bbe | Michael Hanselmann | |
1605 | cb92e7a1 | Michael Hanselmann | # Node evacuation
|
1606 | cb92e7a1 | Michael Hanselmann | NODE_EVAC_PRI = "primary-only"
|
1607 | cb92e7a1 | Michael Hanselmann | NODE_EVAC_SEC = "secondary-only"
|
1608 | cb92e7a1 | Michael Hanselmann | NODE_EVAC_ALL = "all"
|
1609 | b8028dcf | Michael Hanselmann | NODE_EVAC_MODES = compat.UniqueFrozenset([ |
1610 | cb92e7a1 | Michael Hanselmann | NODE_EVAC_PRI, |
1611 | cb92e7a1 | Michael Hanselmann | NODE_EVAC_SEC, |
1612 | cb92e7a1 | Michael Hanselmann | NODE_EVAC_ALL, |
1613 | cb92e7a1 | Michael Hanselmann | ]) |
1614 | cb92e7a1 | Michael Hanselmann | |
1615 | f1da30e6 | Michael Hanselmann | # Job queue
|
1616 | f1da30e6 | Michael Hanselmann | JOB_QUEUE_VERSION = 1
|
1617 | f87b405e | Michael Hanselmann | JOB_QUEUE_SIZE_HARD_LIMIT = 5000
|
1618 | f1da30e6 | Michael Hanselmann | |
1619 | bac5ffc3 | Oleksiy Mishchenko | JOB_ID_TEMPLATE = r"\d+"
|
1620 | cb66225d | Michael Hanselmann | JOB_FILE_RE = re.compile(r"^job-(%s)$" % JOB_ID_TEMPLATE)
|
1621 | bac5ffc3 | Oleksiy Mishchenko | |
1622 | 5c735209 | Iustin Pop | # unchanged job return
|
1623 | 5c735209 | Iustin Pop | JOB_NOTCHANGED = "nochange"
|
1624 | 5c735209 | Iustin Pop | |
1625 | 5f33b613 | Michael Hanselmann | # Job status
|
1626 | 5f33b613 | Michael Hanselmann | JOB_STATUS_QUEUED = "queued"
|
1627 | 47099cd1 | Michael Hanselmann | JOB_STATUS_WAITING = "waiting"
|
1628 | fbf0262f | Michael Hanselmann | JOB_STATUS_CANCELING = "canceling"
|
1629 | 5f33b613 | Michael Hanselmann | JOB_STATUS_RUNNING = "running"
|
1630 | 5f33b613 | Michael Hanselmann | JOB_STATUS_CANCELED = "canceled"
|
1631 | 5f33b613 | Michael Hanselmann | JOB_STATUS_SUCCESS = "success"
|
1632 | 5f33b613 | Michael Hanselmann | JOB_STATUS_ERROR = "error"
|
1633 | b8028dcf | Michael Hanselmann | JOBS_PENDING = compat.UniqueFrozenset([ |
1634 | 1eaddbc6 | Michael Hanselmann | JOB_STATUS_QUEUED, |
1635 | 1eaddbc6 | Michael Hanselmann | JOB_STATUS_WAITING, |
1636 | 1eaddbc6 | Michael Hanselmann | JOB_STATUS_CANCELING, |
1637 | 1eaddbc6 | Michael Hanselmann | ]) |
1638 | b8028dcf | Michael Hanselmann | JOBS_FINALIZED = compat.UniqueFrozenset([ |
1639 | 989a8bee | Michael Hanselmann | JOB_STATUS_CANCELED, |
1640 | 989a8bee | Michael Hanselmann | JOB_STATUS_SUCCESS, |
1641 | 989a8bee | Michael Hanselmann | JOB_STATUS_ERROR, |
1642 | 989a8bee | Michael Hanselmann | ]) |
1643 | b8028dcf | Michael Hanselmann | JOB_STATUS_ALL = compat.UniqueFrozenset([ |
1644 | db5bce34 | Michael Hanselmann | JOB_STATUS_RUNNING, |
1645 | 1eaddbc6 | Michael Hanselmann | ]) | JOBS_PENDING | JOBS_FINALIZED |
1646 | 5f33b613 | Michael Hanselmann | |
1647 | 34327f51 | Iustin Pop | # OpCode status
|
1648 | 34327f51 | Iustin Pop | # not yet finalized
|
1649 | 5f33b613 | Michael Hanselmann | OP_STATUS_QUEUED = "queued"
|
1650 | 47099cd1 | Michael Hanselmann | OP_STATUS_WAITING = "waiting"
|
1651 | fbf0262f | Michael Hanselmann | OP_STATUS_CANCELING = "canceling"
|
1652 | 5f33b613 | Michael Hanselmann | OP_STATUS_RUNNING = "running"
|
1653 | 34327f51 | Iustin Pop | # finalized
|
1654 | 4cb1d919 | Michael Hanselmann | OP_STATUS_CANCELED = "canceled"
|
1655 | 5f33b613 | Michael Hanselmann | OP_STATUS_SUCCESS = "success"
|
1656 | 5f33b613 | Michael Hanselmann | OP_STATUS_ERROR = "error"
|
1657 | b8028dcf | Michael Hanselmann | OPS_FINALIZED = compat.UniqueFrozenset([ |
1658 | 21daa4a8 | Stephen Shirley | OP_STATUS_CANCELED, |
1659 | 21daa4a8 | Stephen Shirley | OP_STATUS_SUCCESS, |
1660 | 3c286190 | Dimitris Aragiorgis | OP_STATUS_ERROR, |
1661 | 21daa4a8 | Stephen Shirley | ]) |
1662 | f1048938 | Iustin Pop | |
1663 | e5d8774b | Michael Hanselmann | # OpCode priority
|
1664 | e5d8774b | Michael Hanselmann | OP_PRIO_LOWEST = +19
|
1665 | e5d8774b | Michael Hanselmann | OP_PRIO_HIGHEST = -20
|
1666 | e5d8774b | Michael Hanselmann | |
1667 | e5d8774b | Michael Hanselmann | OP_PRIO_LOW = +10
|
1668 | e5d8774b | Michael Hanselmann | OP_PRIO_NORMAL = 0
|
1669 | e5d8774b | Michael Hanselmann | OP_PRIO_HIGH = -10
|
1670 | e5d8774b | Michael Hanselmann | |
1671 | b8028dcf | Michael Hanselmann | OP_PRIO_SUBMIT_VALID = compat.UniqueFrozenset([ |
1672 | e71c8147 | Michael Hanselmann | OP_PRIO_LOW, |
1673 | e71c8147 | Michael Hanselmann | OP_PRIO_NORMAL, |
1674 | e71c8147 | Michael Hanselmann | OP_PRIO_HIGH, |
1675 | e71c8147 | Michael Hanselmann | ]) |
1676 | e71c8147 | Michael Hanselmann | |
1677 | e5d8774b | Michael Hanselmann | OP_PRIO_DEFAULT = OP_PRIO_NORMAL |
1678 | e5d8774b | Michael Hanselmann | |
1679 | 0b04b188 | Michael Hanselmann | # Lock recalculate mode
|
1680 | 0b04b188 | Michael Hanselmann | LOCKS_REPLACE = "replace"
|
1681 | 0b04b188 | Michael Hanselmann | LOCKS_APPEND = "append"
|
1682 | 0b04b188 | Michael Hanselmann | |
1683 | 0b04b188 | Michael Hanselmann | # Lock timeout (sum) before we should go into blocking acquire (still
|
1684 | 0b04b188 | Michael Hanselmann | # can be reset by priority change); computed as max time (10 hours)
|
1685 | 0b04b188 | Michael Hanselmann | # before we should actually go into blocking acquire given that we
|
1686 | 0b04b188 | Michael Hanselmann | # start from default priority level; in seconds
|
1687 | 0b04b188 | Michael Hanselmann | # TODO
|
1688 | 0b04b188 | Michael Hanselmann | LOCK_ATTEMPTS_TIMEOUT = 10 * 3600 / (OP_PRIO_DEFAULT - OP_PRIO_HIGHEST) |
1689 | 0b04b188 | Michael Hanselmann | LOCK_ATTEMPTS_MAXWAIT = 15.0
|
1690 | 0b04b188 | Michael Hanselmann | LOCK_ATTEMPTS_MINWAIT = 1.0
|
1691 | 0b04b188 | Michael Hanselmann | |
1692 | f1048938 | Iustin Pop | # Execution log types
|
1693 | f1048938 | Iustin Pop | ELOG_MESSAGE = "message"
|
1694 | 9bf56d77 | Michael Hanselmann | ELOG_REMOTE_IMPORT = "remote-import"
|
1695 | e58f87a9 | Michael Hanselmann | ELOG_JQUEUE_TEST = "jqueue-test"
|
1696 | e58f87a9 | Michael Hanselmann | |
1697 | 19ddc57a | René Nussbaumer | # /etc/hosts modification
|
1698 | 19ddc57a | René Nussbaumer | ETC_HOSTS_ADD = "add"
|
1699 | 19ddc57a | René Nussbaumer | ETC_HOSTS_REMOVE = "remove"
|
1700 | 19ddc57a | René Nussbaumer | |
1701 | e58f87a9 | Michael Hanselmann | # Job queue test
|
1702 | e58f87a9 | Michael Hanselmann | JQT_MSGPREFIX = "TESTMSG="
|
1703 | e58f87a9 | Michael Hanselmann | JQT_EXPANDNAMES = "expandnames"
|
1704 | e58f87a9 | Michael Hanselmann | JQT_EXEC = "exec"
|
1705 | e58f87a9 | Michael Hanselmann | JQT_LOGMSG = "logmsg"
|
1706 | f99010b2 | Michael Hanselmann | JQT_STARTMSG = "startmsg"
|
1707 | b8028dcf | Michael Hanselmann | JQT_ALL = compat.UniqueFrozenset([ |
1708 | e58f87a9 | Michael Hanselmann | JQT_EXPANDNAMES, |
1709 | e58f87a9 | Michael Hanselmann | JQT_EXEC, |
1710 | e58f87a9 | Michael Hanselmann | JQT_LOGMSG, |
1711 | f99010b2 | Michael Hanselmann | JQT_STARTMSG, |
1712 | e58f87a9 | Michael Hanselmann | ]) |
1713 | d4104181 | Iustin Pop | |
1714 | 4a917de6 | Michael Hanselmann | # Query resources
|
1715 | dff5f600 | Michael Hanselmann | QR_CLUSTER = "cluster"
|
1716 | 4a917de6 | Michael Hanselmann | QR_INSTANCE = "instance"
|
1717 | 4a917de6 | Michael Hanselmann | QR_NODE = "node"
|
1718 | 24d16f76 | Michael Hanselmann | QR_LOCK = "lock"
|
1719 | e070c663 | Adeodato Simo | QR_GROUP = "group"
|
1720 | be3a4b14 | Michael Hanselmann | QR_OS = "os"
|
1721 | 9665bb3a | Michael Hanselmann | QR_JOB = "job"
|
1722 | 0fdf247d | Michael Hanselmann | QR_EXPORT = "export"
|
1723 | eaa4c57c | Dimitris Aragiorgis | QR_NETWORK = "network"
|
1724 | 4a917de6 | Michael Hanselmann | |
1725 | 4a917de6 | Michael Hanselmann | #: List of resources which can be queried using L{opcodes.OpQuery}
|
1726 | b8028dcf | Michael Hanselmann | QR_VIA_OP = compat.UniqueFrozenset([ |
1727 | dff5f600 | Michael Hanselmann | QR_CLUSTER, |
1728 | 0fdf247d | Michael Hanselmann | QR_INSTANCE, |
1729 | 0fdf247d | Michael Hanselmann | QR_NODE, |
1730 | 0fdf247d | Michael Hanselmann | QR_GROUP, |
1731 | 0fdf247d | Michael Hanselmann | QR_OS, |
1732 | 0fdf247d | Michael Hanselmann | QR_EXPORT, |
1733 | eaa4c57c | Dimitris Aragiorgis | QR_NETWORK, |
1734 | 0fdf247d | Michael Hanselmann | ]) |
1735 | 4a917de6 | Michael Hanselmann | |
1736 | 3d5ebbf0 | Stephen Shirley | #: List of resources which can be queried using Local UniX Interface
|
1737 | abd66bf8 | Michael Hanselmann | QR_VIA_LUXI = QR_VIA_OP.union([ |
1738 | 24d16f76 | Michael Hanselmann | QR_LOCK, |
1739 | 9665bb3a | Michael Hanselmann | QR_JOB, |
1740 | 28b71a76 | Michael Hanselmann | ]) |
1741 | 28b71a76 | Michael Hanselmann | |
1742 | abd66bf8 | Michael Hanselmann | #: List of resources which can be queried using RAPI
|
1743 | abd66bf8 | Michael Hanselmann | QR_VIA_RAPI = QR_VIA_LUXI |
1744 | abd66bf8 | Michael Hanselmann | |
1745 | 4a917de6 | Michael Hanselmann | # Query field types
|
1746 | 4a917de6 | Michael Hanselmann | QFT_UNKNOWN = "unknown"
|
1747 | 4a917de6 | Michael Hanselmann | QFT_TEXT = "text"
|
1748 | 4a917de6 | Michael Hanselmann | QFT_BOOL = "bool"
|
1749 | 4a917de6 | Michael Hanselmann | QFT_NUMBER = "number"
|
1750 | 4a917de6 | Michael Hanselmann | QFT_UNIT = "unit"
|
1751 | 4a917de6 | Michael Hanselmann | QFT_TIMESTAMP = "timestamp"
|
1752 | 4a917de6 | Michael Hanselmann | QFT_OTHER = "other"
|
1753 | 4a917de6 | Michael Hanselmann | |
1754 | 4a917de6 | Michael Hanselmann | #: All query field types
|
1755 | b8028dcf | Michael Hanselmann | QFT_ALL = compat.UniqueFrozenset([ |
1756 | 4a917de6 | Michael Hanselmann | QFT_UNKNOWN, |
1757 | 4a917de6 | Michael Hanselmann | QFT_TEXT, |
1758 | 4a917de6 | Michael Hanselmann | QFT_BOOL, |
1759 | 4a917de6 | Michael Hanselmann | QFT_NUMBER, |
1760 | 4a917de6 | Michael Hanselmann | QFT_UNIT, |
1761 | 4a917de6 | Michael Hanselmann | QFT_TIMESTAMP, |
1762 | 4a917de6 | Michael Hanselmann | QFT_OTHER, |
1763 | 4a917de6 | Michael Hanselmann | ]) |
1764 | 4a917de6 | Michael Hanselmann | |
1765 | a6070ef7 | Michael Hanselmann | # Query result field status (don't change or reuse values as they're used by
|
1766 | a6070ef7 | Michael Hanselmann | # clients)
|
1767 | 4a917de6 | Michael Hanselmann | #: Normal field status
|
1768 | cfb084ae | René Nussbaumer | RS_NORMAL = 0
|
1769 | 4a917de6 | Michael Hanselmann | #: Unknown field
|
1770 | cfb084ae | René Nussbaumer | RS_UNKNOWN = 1
|
1771 | cfb084ae | René Nussbaumer | #: No data (e.g. RPC error), can be used instead of L{RS_OFFLINE}
|
1772 | cfb084ae | René Nussbaumer | RS_NODATA = 2
|
1773 | dcb9946c | Iustin Pop | #: Value unavailable/unsupported for item; if this field is supported
|
1774 | e18c6c47 | Iustin Pop | #: but we cannot get the data for the moment, RS_NODATA or
|
1775 | e18c6c47 | Iustin Pop | #: RS_OFFLINE should be used
|
1776 | cfb084ae | René Nussbaumer | RS_UNAVAIL = 3
|
1777 | a6070ef7 | Michael Hanselmann | #: Resource marked offline
|
1778 | cfb084ae | René Nussbaumer | RS_OFFLINE = 4
|
1779 | cfb084ae | René Nussbaumer | |
1780 | b8028dcf | Michael Hanselmann | RS_ALL = compat.UniqueFrozenset([ |
1781 | cfb084ae | René Nussbaumer | RS_NORMAL, |
1782 | cfb084ae | René Nussbaumer | RS_UNKNOWN, |
1783 | cfb084ae | René Nussbaumer | RS_NODATA, |
1784 | cfb084ae | René Nussbaumer | RS_UNAVAIL, |
1785 | cfb084ae | René Nussbaumer | RS_OFFLINE, |
1786 | ee3aedff | Michael Hanselmann | ]) |
1787 | ee3aedff | Michael Hanselmann | |
1788 | f0b1bafe | Iustin Pop | #: Dictionary with special field cases and their verbose/terse formatting
|
1789 | f0b1bafe | Iustin Pop | RSS_DESCRIPTION = { |
1790 | f0b1bafe | Iustin Pop | RS_UNKNOWN: ("(unknown)", "??"), |
1791 | e687ec01 | Michael Hanselmann | RS_NODATA: ("(nodata)", "?"), |
1792 | f0b1bafe | Iustin Pop | RS_OFFLINE: ("(offline)", "*"), |
1793 | f0b1bafe | Iustin Pop | RS_UNAVAIL: ("(unavail)", "-"), |
1794 | f0b1bafe | Iustin Pop | } |
1795 | f0b1bafe | Iustin Pop | |
1796 | c5e489f7 | Iustin Pop | # max dynamic devices
|
1797 | 24991749 | Iustin Pop | MAX_NICS = 8
|
1798 | 24991749 | Iustin Pop | MAX_DISKS = 16
|
1799 | 24991749 | Iustin Pop | |
1800 | c09254c2 | Iustin Pop | # SSCONF file prefix
|
1801 | c09254c2 | Iustin Pop | SSCONF_FILEPREFIX = "ssconf_"
|
1802 | 93384844 | Iustin Pop | # SSCONF keys
|
1803 | 93384844 | Iustin Pop | SS_CLUSTER_NAME = "cluster_name"
|
1804 | 5d60b3bd | Iustin Pop | SS_CLUSTER_TAGS = "cluster_tags"
|
1805 | 93384844 | Iustin Pop | SS_FILE_STORAGE_DIR = "file_storage_dir"
|
1806 | 4b97f902 | Apollon Oikonomopoulos | SS_SHARED_FILE_STORAGE_DIR = "shared_file_storage_dir"
|
1807 | f56618e0 | Iustin Pop | SS_MASTER_CANDIDATES = "master_candidates"
|
1808 | 8113a52e | Luca Bigliardi | SS_MASTER_CANDIDATES_IPS = "master_candidates_ips"
|
1809 | 93384844 | Iustin Pop | SS_MASTER_IP = "master_ip"
|
1810 | 93384844 | Iustin Pop | SS_MASTER_NETDEV = "master_netdev"
|
1811 | 5a8648eb | Andrea Spadaccini | SS_MASTER_NETMASK = "master_netmask"
|
1812 | 93384844 | Iustin Pop | SS_MASTER_NODE = "master_node"
|
1813 | 93384844 | Iustin Pop | SS_NODE_LIST = "node_list"
|
1814 | f9780ccd | Luca Bigliardi | SS_NODE_PRIMARY_IPS = "node_primary_ips"
|
1815 | f9780ccd | Luca Bigliardi | SS_NODE_SECONDARY_IPS = "node_secondary_ips"
|
1816 | a3316e4a | Iustin Pop | SS_OFFLINE_NODES = "offline_nodes"
|
1817 | 81a49123 | Iustin Pop | SS_ONLINE_NODES = "online_nodes"
|
1818 | 868a98ca | Manuel Franceschini | SS_PRIMARY_IP_FAMILY = "primary_ip_family"
|
1819 | 81a49123 | Iustin Pop | SS_INSTANCE_LIST = "instance_list"
|
1820 | 8a113c7a | Iustin Pop | SS_RELEASE_VERSION = "release_version"
|
1821 | 4f7a6a10 | Iustin Pop | SS_HYPERVISOR_LIST = "hypervisor_list"
|
1822 | 5c465a95 | Iustin Pop | SS_MAINTAIN_NODE_HEALTH = "maintain_node_health"
|
1823 | 0fbae49a | Balazs Lecz | SS_UID_POOL = "uid_pool"
|
1824 | 6f076453 | Guido Trotter | SS_NODEGROUPS = "nodegroups"
|
1825 | eaa4c57c | Dimitris Aragiorgis | SS_NETWORKS = "networks"
|
1826 | 93384844 | Iustin Pop | |
1827 | cd57bab6 | Michael Hanselmann | SS_FILE_PERMS = 0444
|
1828 | cd57bab6 | Michael Hanselmann | |
1829 | 7888a614 | Alexander Schreiber | # cluster wide default parameters
|
1830 | 7888a614 | Alexander Schreiber | DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM |
1831 | 7888a614 | Alexander Schreiber | |
1832 | 7888a614 | Alexander Schreiber | HVC_DEFAULTS = { |
1833 | bd0ff7c2 | Iustin Pop | HT_XEN_PVM: { |
1834 | 2f2dbb4b | Jun Futagawa | HV_USE_BOOTLOADER: False,
|
1835 | 2f2dbb4b | Jun Futagawa | HV_BOOTLOADER_PATH: XEN_BOOTLOADER, |
1836 | d0c8c01d | Iustin Pop | HV_BOOTLOADER_ARGS: "",
|
1837 | 3c4afa2e | Iustin Pop | HV_KERNEL_PATH: XEN_KERNEL, |
1838 | d0c8c01d | Iustin Pop | HV_INITRD_PATH: "",
|
1839 | d0c8c01d | Iustin Pop | HV_ROOT_PATH: "/dev/sda1",
|
1840 | d0c8c01d | Iustin Pop | HV_KERNEL_ARGS: "ro",
|
1841 | 78411c60 | Iustin Pop | HV_MIGRATION_PORT: 8002,
|
1842 | 783a6c0b | Iustin Pop | HV_MIGRATION_MODE: HT_MIGRATION_LIVE, |
1843 | 525011bc | Maciej Bliziński | HV_BLOCKDEV_PREFIX: "sd",
|
1844 | 990ade2d | Stephen Shirley | HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED, |
1845 | 7e7629c6 | Tsachy Shacham | HV_CPU_MASK: CPU_PINNING_ALL, |
1846 | 8bd977e9 | Sébastien Bocahu | HV_CPU_CAP: 0,
|
1847 | 8bd977e9 | Sébastien Bocahu | HV_CPU_WEIGHT: 256,
|
1848 | bd0ff7c2 | Iustin Pop | }, |
1849 | bd0ff7c2 | Iustin Pop | HT_XEN_HVM: { |
1850 | bd0ff7c2 | Iustin Pop | HV_BOOT_ORDER: "cd",
|
1851 | d0c8c01d | Iustin Pop | HV_CDROM_IMAGE_PATH: "",
|
1852 | d08f6067 | Guido Trotter | HV_NIC_TYPE: HT_NIC_RTL8139, |
1853 | 43440815 | Guido Trotter | HV_DISK_TYPE: HT_DISK_PARAVIRTUAL, |
1854 | 9769bb78 | Manuel Franceschini | HV_VNC_BIND_ADDRESS: IP4_ADDRESS_ANY, |
1855 | 9f2265bc | Michael Hanselmann | HV_VNC_PASSWORD_FILE: pathutils.VNC_PASSWORD_FILE, |
1856 | bd0ff7c2 | Iustin Pop | HV_ACPI: True,
|
1857 | bd0ff7c2 | Iustin Pop | HV_PAE: True,
|
1858 | e2ee1cea | Iustin Pop | HV_KERNEL_PATH: "/usr/lib/xen/boot/hvmloader",
|
1859 | 09ea8710 | Iustin Pop | HV_DEVICE_MODEL: "/usr/lib/xen/bin/qemu-dm",
|
1860 | 78411c60 | Iustin Pop | HV_MIGRATION_PORT: 8002,
|
1861 | 783a6c0b | Iustin Pop | HV_MIGRATION_MODE: HT_MIGRATION_NONLIVE, |
1862 | 6b970cef | Jun Futagawa | HV_USE_LOCALTIME: False,
|
1863 | 525011bc | Maciej Bliziński | HV_BLOCKDEV_PREFIX: "hd",
|
1864 | 87f0aa48 | Jack | HV_PASSTHROUGH: "",
|
1865 | 990ade2d | Stephen Shirley | HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED, |
1866 | 7e7629c6 | Tsachy Shacham | HV_CPU_MASK: CPU_PINNING_ALL, |
1867 | 8bd977e9 | Sébastien Bocahu | HV_CPU_CAP: 0,
|
1868 | 8bd977e9 | Sébastien Bocahu | HV_CPU_WEIGHT: 256,
|
1869 | bd0ff7c2 | Iustin Pop | }, |
1870 | bd0ff7c2 | Iustin Pop | HT_KVM: { |
1871 | b8203e1e | Iustin Pop | HV_KERNEL_PATH: KVM_KERNEL, |
1872 | d0c8c01d | Iustin Pop | HV_INITRD_PATH: "",
|
1873 | d0c8c01d | Iustin Pop | HV_KERNEL_ARGS: "ro",
|
1874 | d0c8c01d | Iustin Pop | HV_ROOT_PATH: "/dev/vda1",
|
1875 | bd0ff7c2 | Iustin Pop | HV_ACPI: True,
|
1876 | bd0ff7c2 | Iustin Pop | HV_SERIAL_CONSOLE: True,
|
1877 | d0c8c01d | Iustin Pop | HV_VNC_BIND_ADDRESS: "",
|
1878 | 8b2d1013 | Guido Trotter | HV_VNC_TLS: False,
|
1879 | d0c8c01d | Iustin Pop | HV_VNC_X509: "",
|
1880 | 8b2d1013 | Guido Trotter | HV_VNC_X509_VERIFY: False,
|
1881 | d0c8c01d | Iustin Pop | HV_VNC_PASSWORD_FILE: "",
|
1882 | b1cb62bd | Andrea Spadaccini | HV_KVM_SPICE_BIND: "",
|
1883 | b1cb62bd | Andrea Spadaccini | HV_KVM_SPICE_IP_VERSION: IFACE_NO_IP_VERSION_SPECIFIED, |
1884 | b451c4c7 | Andrea Spadaccini | HV_KVM_SPICE_PASSWORD_FILE: "",
|
1885 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_LOSSLESS_IMG_COMPR: "",
|
1886 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_JPEG_IMG_COMPR: "",
|
1887 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR: "",
|
1888 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_STREAMING_VIDEO_DETECTION: "",
|
1889 | ea064d24 | Andrea Spadaccini | HV_KVM_SPICE_AUDIO_COMPR: True,
|
1890 | bfe86c76 | Andrea Spadaccini | HV_KVM_SPICE_USE_TLS: False,
|
1891 | 3e40b587 | Andrea Spadaccini | HV_KVM_SPICE_TLS_CIPHERS: OPENSSL_CIPHERS, |
1892 | 3e40b587 | Andrea Spadaccini | HV_KVM_SPICE_USE_VDAGENT: True,
|
1893 | d0c8c01d | Iustin Pop | HV_KVM_FLOPPY_IMAGE_PATH: "",
|
1894 | d0c8c01d | Iustin Pop | HV_CDROM_IMAGE_PATH: "",
|
1895 | d0c8c01d | Iustin Pop | HV_KVM_CDROM2_IMAGE_PATH: "",
|
1896 | 835528af | Iustin Pop | HV_BOOT_ORDER: HT_BO_DISK, |
1897 | 43440815 | Guido Trotter | HV_NIC_TYPE: HT_NIC_PARAVIRTUAL, |
1898 | 43440815 | Guido Trotter | HV_DISK_TYPE: HT_DISK_PARAVIRTUAL, |
1899 | d0c8c01d | Iustin Pop | HV_KVM_CDROM_DISK_TYPE: "",
|
1900 | d0c8c01d | Iustin Pop | HV_USB_MOUSE: "",
|
1901 | 4f580fef | Sébastien Bocahu | HV_KEYMAP: "",
|
1902 | 3c075436 | Iustin Pop | HV_MIGRATION_PORT: 8102,
|
1903 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_BANDWIDTH: 32, # MiB/s |
1904 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_DOWNTIME: 30, # ms |
1905 | 783a6c0b | Iustin Pop | HV_MIGRATION_MODE: HT_MIGRATION_LIVE, |
1906 | 6b970cef | Jun Futagawa | HV_USE_LOCALTIME: False,
|
1907 | ea0f3d7a | Iustin Pop | HV_DISK_CACHE: HT_CACHE_DEFAULT, |
1908 | d19d94db | Guido Trotter | HV_SECURITY_MODEL: HT_SM_NONE, |
1909 | d0c8c01d | Iustin Pop | HV_SECURITY_DOMAIN: "",
|
1910 | 7ba594c0 | Guido Trotter | HV_KVM_FLAG: "",
|
1911 | fbe27e2b | Guido Trotter | HV_VHOST_NET: False,
|
1912 | 84c08e4e | Balazs Lecz | HV_KVM_USE_CHROOT: False,
|
1913 | 4f958b0b | Miguel Di Ciurcio Filho | HV_MEM_PATH: "",
|
1914 | 990ade2d | Stephen Shirley | HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED, |
1915 | 7e7629c6 | Tsachy Shacham | HV_CPU_MASK: CPU_PINNING_ALL, |
1916 | 7cb42171 | Nikita Staroverov | HV_CPU_TYPE: "",
|
1917 | bd0ff7c2 | Iustin Pop | }, |
1918 | 5ae4945a | Iustin Pop | HT_FAKE: {}, |
1919 | 48297fa2 | Iustin Pop | HT_CHROOT: { |
1920 | 48297fa2 | Iustin Pop | HV_INIT_SCRIPT: "/ganeti-chroot",
|
1921 | 48297fa2 | Iustin Pop | }, |
1922 | 4b5e40a5 | Iustin Pop | HT_LXC: { |
1923 | e3ed5316 | Balazs Lecz | HV_CPU_MASK: "",
|
1924 | 4b5e40a5 | Iustin Pop | }, |
1925 | bd0ff7c2 | Iustin Pop | } |
1926 | 7888a614 | Alexander Schreiber | |
1927 | b8028dcf | Michael Hanselmann | HVC_GLOBALS = compat.UniqueFrozenset([ |
1928 | 7736a5f2 | Iustin Pop | HV_MIGRATION_PORT, |
1929 | e43d4f9f | Apollon Oikonomopoulos | HV_MIGRATION_BANDWIDTH, |
1930 | 783a6c0b | Iustin Pop | HV_MIGRATION_MODE, |
1931 | 7736a5f2 | Iustin Pop | ]) |
1932 | 7736a5f2 | Iustin Pop | |
1933 | 7888a614 | Alexander Schreiber | BEC_DEFAULTS = { |
1934 | 8c72ab2b | Guido Trotter | BE_MINMEM: 128,
|
1935 | 8c72ab2b | Guido Trotter | BE_MAXMEM: 128,
|
1936 | bd0ff7c2 | Iustin Pop | BE_VCPUS: 1,
|
1937 | bd0ff7c2 | Iustin Pop | BE_AUTO_BALANCE: True,
|
1938 | 11dc66f3 | Bernardo Dal Seno | BE_ALWAYS_FAILOVER: False,
|
1939 | 34700f5b | René Nussbaumer | BE_SPINDLE_USE: 1,
|
1940 | bd0ff7c2 | Iustin Pop | } |
1941 | c3e618cc | Guido Trotter | |
1942 | 095e71aa | René Nussbaumer | NDC_DEFAULTS = { |
1943 | 1df4d430 | Iustin Pop | ND_OOB_PROGRAM: "",
|
1944 | 432e8e2f | Iustin Pop | ND_SPINDLE_COUNT: 1,
|
1945 | 0ea11dcb | Bernardo Dal Seno | ND_EXCLUSIVE_STORAGE: False,
|
1946 | 095e71aa | René Nussbaumer | } |
1947 | 095e71aa | René Nussbaumer | |
1948 | bc5d0215 | Andrea Spadaccini | DISK_LD_DEFAULTS = { |
1949 | bc5d0215 | Andrea Spadaccini | LD_DRBD8: { |
1950 | ac00bf1b | Andrea Spadaccini | LDP_RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED, |
1951 | ac00bf1b | Andrea Spadaccini | LDP_BARRIERS: _autoconf.DRBD_BARRIERS, |
1952 | ac00bf1b | Andrea Spadaccini | LDP_NO_META_FLUSH: _autoconf.DRBD_NO_META_FLUSH, |
1953 | 8002e46b | Andrea Spadaccini | LDP_DEFAULT_METAVG: DEFAULT_VG, |
1954 | ad1dd4c7 | Andrea Spadaccini | LDP_DISK_CUSTOM: "",
|
1955 | ad1dd4c7 | Andrea Spadaccini | LDP_NET_CUSTOM: "",
|
1956 | f2f57b6e | Andrea Spadaccini | LDP_DYNAMIC_RESYNC: False,
|
1957 | 8584e922 | Andrea Spadaccini | |
1958 | 8584e922 | Andrea Spadaccini | # The default values for the DRBD dynamic resync speed algorithm are taken
|
1959 | 8584e922 | Andrea Spadaccini | # from the drbsetup 8.3.11 man page, except for c-plan-ahead (that we
|
1960 | 8584e922 | Andrea Spadaccini | # don't need to set to 0, because we have a separate option to enable it)
|
1961 | 8584e922 | Andrea Spadaccini | # and for c-max-rate, that we cap to the default value for the static resync
|
1962 | 8584e922 | Andrea Spadaccini | # rate.
|
1963 | 8584e922 | Andrea Spadaccini | LDP_PLAN_AHEAD: 20, # ds |
1964 | 8584e922 | Andrea Spadaccini | LDP_FILL_TARGET: 0, # sectors |
1965 | 8584e922 | Andrea Spadaccini | LDP_DELAY_TARGET: 1, # ds |
1966 | 8584e922 | Andrea Spadaccini | LDP_MAX_RATE: CLASSIC_DRBD_SYNC_SPEED, # KiB/s
|
1967 | 8584e922 | Andrea Spadaccini | LDP_MIN_RATE: 4 * 1024, # KiB/s |
1968 | bc5d0215 | Andrea Spadaccini | }, |
1969 | bc5d0215 | Andrea Spadaccini | LD_LV: { |
1970 | ac00bf1b | Andrea Spadaccini | LDP_STRIPES: _autoconf.LVM_STRIPECOUNT |
1971 | bc5d0215 | Andrea Spadaccini | }, |
1972 | 5ae4945a | Iustin Pop | LD_FILE: {}, |
1973 | 5ae4945a | Iustin Pop | LD_BLOCKDEV: {}, |
1974 | 7181fba0 | Constantinos Venetsanopoulos | LD_RBD: { |
1975 | 7181fba0 | Constantinos Venetsanopoulos | LDP_POOL: "rbd"
|
1976 | 7181fba0 | Constantinos Venetsanopoulos | }, |
1977 | 376631d1 | Constantinos Venetsanopoulos | LD_EXT: {}, |
1978 | bc5d0215 | Andrea Spadaccini | } |
1979 | bc5d0215 | Andrea Spadaccini | |
1980 | 8584e922 | Andrea Spadaccini | # readability shortcuts
|
1981 | 8584e922 | Andrea Spadaccini | _LV_DEFAULTS = DISK_LD_DEFAULTS[LD_LV] |
1982 | 8584e922 | Andrea Spadaccini | _DRBD_DEFAULTS = DISK_LD_DEFAULTS[LD_DRBD8] |
1983 | 8584e922 | Andrea Spadaccini | |
1984 | bc5d0215 | Andrea Spadaccini | DISK_DT_DEFAULTS = { |
1985 | bc5d0215 | Andrea Spadaccini | DT_PLAIN: { |
1986 | ac00bf1b | Andrea Spadaccini | LV_STRIPES: DISK_LD_DEFAULTS[LD_LV][LDP_STRIPES], |
1987 | bc5d0215 | Andrea Spadaccini | }, |
1988 | bc5d0215 | Andrea Spadaccini | DT_DRBD8: { |
1989 | 8584e922 | Andrea Spadaccini | DRBD_RESYNC_RATE: _DRBD_DEFAULTS[LDP_RESYNC_RATE], |
1990 | 8584e922 | Andrea Spadaccini | DRBD_DATA_STRIPES: _LV_DEFAULTS[LDP_STRIPES], |
1991 | 8584e922 | Andrea Spadaccini | DRBD_META_STRIPES: _LV_DEFAULTS[LDP_STRIPES], |
1992 | 8584e922 | Andrea Spadaccini | DRBD_DISK_BARRIERS: _DRBD_DEFAULTS[LDP_BARRIERS], |
1993 | 8584e922 | Andrea Spadaccini | DRBD_META_BARRIERS: _DRBD_DEFAULTS[LDP_NO_META_FLUSH], |
1994 | 8584e922 | Andrea Spadaccini | DRBD_DEFAULT_METAVG: _DRBD_DEFAULTS[LDP_DEFAULT_METAVG], |
1995 | 8584e922 | Andrea Spadaccini | DRBD_DISK_CUSTOM: _DRBD_DEFAULTS[LDP_DISK_CUSTOM], |
1996 | 8584e922 | Andrea Spadaccini | DRBD_NET_CUSTOM: _DRBD_DEFAULTS[LDP_NET_CUSTOM], |
1997 | 8584e922 | Andrea Spadaccini | DRBD_DYNAMIC_RESYNC: _DRBD_DEFAULTS[LDP_DYNAMIC_RESYNC], |
1998 | 8584e922 | Andrea Spadaccini | DRBD_PLAN_AHEAD: _DRBD_DEFAULTS[LDP_PLAN_AHEAD], |
1999 | 8584e922 | Andrea Spadaccini | DRBD_FILL_TARGET: _DRBD_DEFAULTS[LDP_FILL_TARGET], |
2000 | 8584e922 | Andrea Spadaccini | DRBD_DELAY_TARGET: _DRBD_DEFAULTS[LDP_DELAY_TARGET], |
2001 | 8584e922 | Andrea Spadaccini | DRBD_MAX_RATE: _DRBD_DEFAULTS[LDP_MAX_RATE], |
2002 | 8584e922 | Andrea Spadaccini | DRBD_MIN_RATE: _DRBD_DEFAULTS[LDP_MIN_RATE], |
2003 | bc5d0215 | Andrea Spadaccini | }, |
2004 | 5ae4945a | Iustin Pop | DT_DISKLESS: {}, |
2005 | 5ae4945a | Iustin Pop | DT_FILE: {}, |
2006 | 5ae4945a | Iustin Pop | DT_SHARED_FILE: {}, |
2007 | 5ae4945a | Iustin Pop | DT_BLOCK: {}, |
2008 | 7181fba0 | Constantinos Venetsanopoulos | DT_RBD: { |
2009 | 7181fba0 | Constantinos Venetsanopoulos | RBD_POOL: DISK_LD_DEFAULTS[LD_RBD][LDP_POOL] |
2010 | 7181fba0 | Constantinos Venetsanopoulos | }, |
2011 | 376631d1 | Constantinos Venetsanopoulos | DT_EXT: {}, |
2012 | bc5d0215 | Andrea Spadaccini | } |
2013 | bc5d0215 | Andrea Spadaccini | |
2014 | 8584e922 | Andrea Spadaccini | # we don't want to export the shortcuts
|
2015 | 8584e922 | Andrea Spadaccini | del _LV_DEFAULTS, _DRBD_DEFAULTS
|
2016 | 8584e922 | Andrea Spadaccini | |
2017 | ac061be9 | Guido Trotter | NICC_DEFAULTS = { |
2018 | ac061be9 | Guido Trotter | NIC_MODE: NIC_MODE_BRIDGED, |
2019 | ac061be9 | Guido Trotter | NIC_LINK: DEFAULT_BRIDGE, |
2020 | ac061be9 | Guido Trotter | } |
2021 | ac061be9 | Guido Trotter | |
2022 | a194dc28 | Iustin Pop | # All of the following values are quite arbitrarily - there are no
|
2023 | a194dc28 | Iustin Pop | # "good" defaults, these must be customised per-site
|
2024 | 918eb80b | Agata Murawska | IPOLICY_DEFAULTS = { |
2025 | 4f725341 | Agata Murawska | ISPECS_MIN: { |
2026 | 4f725341 | Agata Murawska | ISPEC_MEM_SIZE: 128,
|
2027 | 4f725341 | Agata Murawska | ISPEC_CPU_COUNT: 1,
|
2028 | 4f725341 | Agata Murawska | ISPEC_DISK_COUNT: 1,
|
2029 | 4f725341 | Agata Murawska | ISPEC_DISK_SIZE: 1024,
|
2030 | 4f725341 | Agata Murawska | ISPEC_NIC_COUNT: 1,
|
2031 | 553cb5f7 | René Nussbaumer | ISPEC_SPINDLE_USE: 1,
|
2032 | 918eb80b | Agata Murawska | }, |
2033 | 4f725341 | Agata Murawska | ISPECS_MAX: { |
2034 | b32f3c0c | Iustin Pop | ISPEC_MEM_SIZE: 32768,
|
2035 | b32f3c0c | Iustin Pop | ISPEC_CPU_COUNT: 8,
|
2036 | b32f3c0c | Iustin Pop | ISPEC_DISK_COUNT: MAX_DISKS, |
2037 | b32f3c0c | Iustin Pop | ISPEC_DISK_SIZE: 1024 * 1024, |
2038 | b32f3c0c | Iustin Pop | ISPEC_NIC_COUNT: MAX_NICS, |
2039 | 553cb5f7 | René Nussbaumer | ISPEC_SPINDLE_USE: 12,
|
2040 | 918eb80b | Agata Murawska | }, |
2041 | 4f725341 | Agata Murawska | ISPECS_STD: { |
2042 | 4f725341 | Agata Murawska | ISPEC_MEM_SIZE: 128,
|
2043 | 4f725341 | Agata Murawska | ISPEC_CPU_COUNT: 1,
|
2044 | 4f725341 | Agata Murawska | ISPEC_DISK_COUNT: 1,
|
2045 | 4f725341 | Agata Murawska | ISPEC_DISK_SIZE: 1024,
|
2046 | 4f725341 | Agata Murawska | ISPEC_NIC_COUNT: 1,
|
2047 | 553cb5f7 | René Nussbaumer | ISPEC_SPINDLE_USE: 1,
|
2048 | 2cc673a3 | Iustin Pop | }, |
2049 | d04c9d45 | Iustin Pop | IPOLICY_DTS: DISK_TEMPLATES, |
2050 | ff6c5e55 | Iustin Pop | IPOLICY_VCPU_RATIO: 4.0,
|
2051 | a194dc28 | Iustin Pop | IPOLICY_SPINDLE_RATIO: 32.0,
|
2052 | 918eb80b | Agata Murawska | } |
2053 | 918eb80b | Agata Murawska | |
2054 | c3e618cc | Guido Trotter | MASTER_POOL_SIZE_DEFAULT = 10
|
2055 | ea1518af | Guido Trotter | |
2056 | 63c73073 | Bernardo Dal Seno | # Exclusive storage:
|
2057 | 63c73073 | Bernardo Dal Seno | # Error margin used to compare physical disks
|
2058 | 63c73073 | Bernardo Dal Seno | PART_MARGIN = .01
|
2059 | 63c73073 | Bernardo Dal Seno | # Space reserved when creating instance disks
|
2060 | 63c73073 | Bernardo Dal Seno | PART_RESERVED = .02
|
2061 | 63c73073 | Bernardo Dal Seno | |
2062 | ea1518af | Guido Trotter | CONFD_PROTOCOL_VERSION = 1
|
2063 | ea1518af | Guido Trotter | |
2064 | 09444532 | Guido Trotter | CONFD_REQ_PING = 0
|
2065 | ea1518af | Guido Trotter | CONFD_REQ_NODE_ROLE_BYNAME = 1
|
2066 | ea1518af | Guido Trotter | CONFD_REQ_NODE_PIP_BY_INSTANCE_IP = 2
|
2067 | 48166551 | Guido Trotter | CONFD_REQ_CLUSTER_MASTER = 3
|
2068 | efbb4fd2 | Luca Bigliardi | CONFD_REQ_NODE_PIP_LIST = 4
|
2069 | efbb4fd2 | Luca Bigliardi | CONFD_REQ_MC_PIP_LIST = 5
|
2070 | d01ae714 | Luca Bigliardi | CONFD_REQ_INSTANCES_IPS_LIST = 6
|
2071 | 792f8e55 | Iustin Pop | CONFD_REQ_NODE_DRBD = 7
|
2072 | ea1518af | Guido Trotter | |
2073 | 19351457 | Guido Trotter | # Confd request query fields. These are used to narrow down queries.
|
2074 | 19351457 | Guido Trotter | # These must be strings rather than integers, because json-encoding
|
2075 | 19351457 | Guido Trotter | # converts them to strings anyway, as they're used as dict-keys.
|
2076 | 19351457 | Guido Trotter | CONFD_REQQ_LINK = "0"
|
2077 | 19351457 | Guido Trotter | CONFD_REQQ_IP = "1"
|
2078 | 19351457 | Guido Trotter | CONFD_REQQ_IPLIST = "2"
|
2079 | 250554a9 | Guido Trotter | CONFD_REQQ_FIELDS = "3"
|
2080 | 250554a9 | Guido Trotter | |
2081 | 250554a9 | Guido Trotter | CONFD_REQFIELD_NAME = "0"
|
2082 | 250554a9 | Guido Trotter | CONFD_REQFIELD_IP = "1"
|
2083 | 43dc8496 | Guido Trotter | CONFD_REQFIELD_MNODE_PIP = "2"
|
2084 | 19351457 | Guido Trotter | |
2085 | b8028dcf | Michael Hanselmann | CONFD_REQS = compat.UniqueFrozenset([ |
2086 | 09444532 | Guido Trotter | CONFD_REQ_PING, |
2087 | ea1518af | Guido Trotter | CONFD_REQ_NODE_ROLE_BYNAME, |
2088 | ea1518af | Guido Trotter | CONFD_REQ_NODE_PIP_BY_INSTANCE_IP, |
2089 | 48166551 | Guido Trotter | CONFD_REQ_CLUSTER_MASTER, |
2090 | efbb4fd2 | Luca Bigliardi | CONFD_REQ_NODE_PIP_LIST, |
2091 | efbb4fd2 | Luca Bigliardi | CONFD_REQ_MC_PIP_LIST, |
2092 | d01ae714 | Luca Bigliardi | CONFD_REQ_INSTANCES_IPS_LIST, |
2093 | 792f8e55 | Iustin Pop | CONFD_REQ_NODE_DRBD, |
2094 | ea1518af | Guido Trotter | ]) |
2095 | ea1518af | Guido Trotter | |
2096 | 31c2a99e | Guido Trotter | CONFD_REPL_STATUS_OK = 0
|
2097 | 31c2a99e | Guido Trotter | CONFD_REPL_STATUS_ERROR = 1
|
2098 | 31c2a99e | Guido Trotter | CONFD_REPL_STATUS_NOTIMPLEMENTED = 2
|
2099 | 31c2a99e | Guido Trotter | |
2100 | b8028dcf | Michael Hanselmann | CONFD_REPL_STATUSES = compat.UniqueFrozenset([ |
2101 | 31c2a99e | Guido Trotter | CONFD_REPL_STATUS_OK, |
2102 | 31c2a99e | Guido Trotter | CONFD_REPL_STATUS_ERROR, |
2103 | 31c2a99e | Guido Trotter | CONFD_REPL_STATUS_NOTIMPLEMENTED, |
2104 | 31c2a99e | Guido Trotter | ]) |
2105 | 31c2a99e | Guido Trotter | |
2106 | 89c52785 | Guido Trotter | (CONFD_NODE_ROLE_MASTER, |
2107 | 89c52785 | Guido Trotter | CONFD_NODE_ROLE_CANDIDATE, |
2108 | 89c52785 | Guido Trotter | CONFD_NODE_ROLE_OFFLINE, |
2109 | 197b0f5d | Guido Trotter | CONFD_NODE_ROLE_DRAINED, |
2110 | 197b0f5d | Guido Trotter | CONFD_NODE_ROLE_REGULAR, |
2111 | 197b0f5d | Guido Trotter | ) = range(5) |
2112 | 89c52785 | Guido Trotter | |
2113 | ca2a5b13 | Guido Trotter | # A few common errors for confd
|
2114 | ca2a5b13 | Guido Trotter | CONFD_ERROR_UNKNOWN_ENTRY = 1
|
2115 | 7189e790 | Guido Trotter | CONFD_ERROR_INTERNAL = 2
|
2116 | 19351457 | Guido Trotter | CONFD_ERROR_ARGUMENT = 3
|
2117 | ca2a5b13 | Guido Trotter | |
2118 | 71f27d19 | Guido Trotter | # Each request is "salted" by the current timestamp.
|
2119 | 71f27d19 | Guido Trotter | # This constants decides how many seconds of skew to accept.
|
2120 | 71f27d19 | Guido Trotter | # TODO: make this a default and allow the value to be more configurable
|
2121 | 313b2dd4 | Michael Hanselmann | CONFD_MAX_CLOCK_SKEW = 2 * NODE_MAX_CLOCK_SKEW
|
2122 | 84c3ab28 | Guido Trotter | |
2123 | 84c3ab28 | Guido Trotter | # When we haven't reloaded the config for more than this amount of seconds, we
|
2124 | 84c3ab28 | Guido Trotter | # force a test to see if inotify is betraying us.
|
2125 | 84c3ab28 | Guido Trotter | CONFD_CONFIG_RELOAD_TIMEOUT = 60
|
2126 | 84c3ab28 | Guido Trotter | |
2127 | 84c3ab28 | Guido Trotter | # If we receive more than one update in this amount of seconds, we move to
|
2128 | 84c3ab28 | Guido Trotter | # polling every RATELIMIT seconds, rather than relying on inotify, to be able
|
2129 | 84c3ab28 | Guido Trotter | # to serve more requests.
|
2130 | 84c3ab28 | Guido Trotter | CONFD_CONFIG_RELOAD_RATELIMIT = 2
|
2131 | c8eded0b | Guido Trotter | |
2132 | a3758ab2 | Guido Trotter | # Magic number prepended to all confd queries.
|
2133 | a3758ab2 | Guido Trotter | # This allows us to distinguish different types of confd protocols and handle
|
2134 | a3758ab2 | Guido Trotter | # them. For example by changing this we can move the whole payload to be
|
2135 | a3758ab2 | Guido Trotter | # compressed, or move away from json.
|
2136 | d0c8c01d | Iustin Pop | CONFD_MAGIC_FOURCC = "plj0"
|
2137 | a3758ab2 | Guido Trotter | |
2138 | e4ccf6cd | Guido Trotter | # By default a confd request is sent to the minimum between this number and all
|
2139 | e4ccf6cd | Guido Trotter | # MCs. 6 was chosen because even in the case of a disastrous 50% response rate,
|
2140 | e4ccf6cd | Guido Trotter | # we should have enough answers to be able to compare more than one.
|
2141 | e4ccf6cd | Guido Trotter | CONFD_DEFAULT_REQ_COVERAGE = 6
|
2142 | e4ccf6cd | Guido Trotter | |
2143 | e4ccf6cd | Guido Trotter | # Timeout in seconds to expire pending query request in the confd client
|
2144 | e4ccf6cd | Guido Trotter | # library. We don't actually expect any answer more than 10 seconds after we
|
2145 | e4ccf6cd | Guido Trotter | # sent a request.
|
2146 | e4ccf6cd | Guido Trotter | CONFD_CLIENT_EXPIRE_TIMEOUT = 10
|
2147 | e4ccf6cd | Guido Trotter | |
2148 | c8eded0b | Guido Trotter | # Maximum UDP datagram size.
|
2149 | c8eded0b | Guido Trotter | # On IPv4: 64K - 20 (ip header size) - 8 (udp header size) = 65507
|
2150 | c8eded0b | Guido Trotter | # On IPv6: 64K - 40 (ip6 header size) - 8 (udp header size) = 65487
|
2151 | c8eded0b | Guido Trotter | # (assuming we can't use jumbo frames)
|
2152 | c8eded0b | Guido Trotter | # We just set this to 60K, which should be enough
|
2153 | c8eded0b | Guido Trotter | MAX_UDP_DATA_SIZE = 61440
|
2154 | 6d127406 | Balazs Lecz | |
2155 | 6d127406 | Balazs Lecz | # User-id pool minimum/maximum acceptable user-ids.
|
2156 | 6d127406 | Balazs Lecz | UIDPOOL_UID_MIN = 0
|
2157 | e687ec01 | Michael Hanselmann | UIDPOOL_UID_MAX = 2 ** 32 - 1 # Assuming 32 bit user-ids |
2158 | 649bcdd8 | Balazs Lecz | |
2159 | 649bcdd8 | Balazs Lecz | # Name or path of the pgrep command
|
2160 | 649bcdd8 | Balazs Lecz | PGREP = "pgrep"
|
2161 | 75cf411a | Adeodato Simo | |
2162 | 75cf411a | Adeodato Simo | # Name of the node group that gets created at cluster init or upgrade
|
2163 | 75cf411a | Adeodato Simo | INITIAL_NODE_GROUP_NAME = "default"
|
2164 | 90e99856 | Adeodato Simo | |
2165 | 90e99856 | Adeodato Simo | # Possible values for NodeGroup.alloc_policy
|
2166 | 90e99856 | Adeodato Simo | ALLOC_POLICY_PREFERRED = "preferred"
|
2167 | 90e99856 | Adeodato Simo | ALLOC_POLICY_LAST_RESORT = "last_resort"
|
2168 | 90e99856 | Adeodato Simo | ALLOC_POLICY_UNALLOCABLE = "unallocable"
|
2169 | 90e99856 | Adeodato Simo | VALID_ALLOC_POLICIES = [ |
2170 | 90e99856 | Adeodato Simo | ALLOC_POLICY_PREFERRED, |
2171 | 90e99856 | Adeodato Simo | ALLOC_POLICY_LAST_RESORT, |
2172 | 90e99856 | Adeodato Simo | ALLOC_POLICY_UNALLOCABLE, |
2173 | 90e99856 | Adeodato Simo | ] |
2174 | b6135bbc | Apollon Oikonomopoulos | |
2175 | b6135bbc | Apollon Oikonomopoulos | # Temporary external/shared storage parameters
|
2176 | b6135bbc | Apollon Oikonomopoulos | BLOCKDEV_DRIVER_MANUAL = "manual"
|
2177 | e5395072 | Iustin Pop | |
2178 | a002ed79 | Agata Murawska | # qemu-img path, required for ovfconverter
|
2179 | a002ed79 | Agata Murawska | QEMUIMG_PATH = _autoconf.QEMUIMG_PATH |
2180 | a002ed79 | Agata Murawska | |
2181 | e5395072 | Iustin Pop | # Whether htools was enabled at compilation time
|
2182 | e5395072 | Iustin Pop | HTOOLS = _autoconf.HTOOLS |
2183 | e5395072 | Iustin Pop | # The hail iallocator
|
2184 | e5395072 | Iustin Pop | IALLOC_HAIL = "hail"
|
2185 | b8d51bb2 | Michael Hanselmann | |
2186 | 2d88fdd3 | Andrea Spadaccini | # Fake opcodes for functions that have hooks attached to them via
|
2187 | 2d88fdd3 | Andrea Spadaccini | # backend.RunLocalHooks
|
2188 | 2d88fdd3 | Andrea Spadaccini | FAKE_OP_MASTER_TURNUP = "OP_CLUSTER_IP_TURNUP"
|
2189 | 2d88fdd3 | Andrea Spadaccini | FAKE_OP_MASTER_TURNDOWN = "OP_CLUSTER_IP_TURNDOWN"
|
2190 | 2d88fdd3 | Andrea Spadaccini | |
2191 | 8a3c9e8a | Michael Hanselmann | # SSH key types
|
2192 | 8a3c9e8a | Michael Hanselmann | SSHK_RSA = "rsa"
|
2193 | 8a3c9e8a | Michael Hanselmann | SSHK_DSA = "dsa"
|
2194 | b8028dcf | Michael Hanselmann | SSHK_ALL = compat.UniqueFrozenset([SSHK_RSA, SSHK_DSA]) |
2195 | 8a3c9e8a | Michael Hanselmann | |
2196 | d12b9f66 | Michael Hanselmann | # SSH authorized key types
|
2197 | d12b9f66 | Michael Hanselmann | SSHAK_RSA = "ssh-rsa"
|
2198 | d12b9f66 | Michael Hanselmann | SSHAK_DSS = "ssh-dss"
|
2199 | b8028dcf | Michael Hanselmann | SSHAK_ALL = compat.UniqueFrozenset([SSHAK_RSA, SSHAK_DSS]) |
2200 | d12b9f66 | Michael Hanselmann | |
2201 | d12b9f66 | Michael Hanselmann | # SSH setup
|
2202 | d12b9f66 | Michael Hanselmann | SSHS_CLUSTER_NAME = "cluster_name"
|
2203 | d12b9f66 | Michael Hanselmann | SSHS_SSH_HOST_KEY = "ssh_host_key"
|
2204 | d12b9f66 | Michael Hanselmann | SSHS_SSH_ROOT_KEY = "ssh_root_key"
|
2205 | d12b9f66 | Michael Hanselmann | SSHS_NODE_DAEMON_CERTIFICATE = "node_daemon_certificate"
|
2206 | d12b9f66 | Michael Hanselmann | |
2207 | ebae9e37 | Michael Hanselmann | #: Key files for SSH daemon
|
2208 | ebae9e37 | Michael Hanselmann | SSH_DAEMON_KEYFILES = { |
2209 | ebae9e37 | Michael Hanselmann | SSHK_RSA: (pathutils.SSH_HOST_RSA_PRIV, pathutils.SSH_HOST_RSA_PUB), |
2210 | ebae9e37 | Michael Hanselmann | SSHK_DSA: (pathutils.SSH_HOST_DSA_PRIV, pathutils.SSH_HOST_DSA_PUB), |
2211 | ebae9e37 | Michael Hanselmann | } |
2212 | ebae9e37 | Michael Hanselmann | |
2213 | 69e5fefc | Michael Hanselmann | # Node daemon setup
|
2214 | 69e5fefc | Michael Hanselmann | NDS_CLUSTER_NAME = "cluster_name"
|
2215 | 69e5fefc | Michael Hanselmann | NDS_NODE_DAEMON_CERTIFICATE = "node_daemon_certificate"
|
2216 | 69e5fefc | Michael Hanselmann | NDS_SSCONF = "ssconf"
|
2217 | 69e5fefc | Michael Hanselmann | NDS_START_NODE_DAEMON = "start_node_daemon"
|
2218 | 69e5fefc | Michael Hanselmann | |
2219 | 80a0546b | Michele Tartara | # Path generating random UUID
|
2220 | 80a0546b | Michele Tartara | RANDOM_UUID_FILE = "/proc/sys/kernel/random/uuid"
|
2221 | 80a0546b | Michele Tartara | |
2222 | 80a0546b | Michele Tartara | # Regex string for verifying a UUID
|
2223 | 80a0546b | Michele Tartara | UUID_REGEX = "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
|
2224 | 80a0546b | Michele Tartara | |
2225 | b8d51bb2 | Michael Hanselmann | # Do not re-export imported modules
|
2226 | b8028dcf | Michael Hanselmann | del re, _vcsversion, _autoconf, socket, pathutils, compat |