Statistics
| Branch: | Tag: | Revision:

root / src / Ganeti / HsConstants.hs @ ae858516

History | View | Annotate | Download (108.4 kB)

1 6b0d45b7 Jose A. Lopes
{-# OPTIONS -fno-warn-type-defaults #-}
2 1b2adaa6 Jose A. Lopes
{-| HsConstants contains the Haskell constants
3 1b2adaa6 Jose A. Lopes
4 1b2adaa6 Jose A. Lopes
This is a transitional module complementary to 'Ganeti.Constants'.  It
5 1b2adaa6 Jose A. Lopes
is intended to contain the Haskell constants that are meant to be
6 1b2adaa6 Jose A. Lopes
generated in Python.
7 1b2adaa6 Jose A. Lopes
8 c93041a5 Jose A. Lopes
Do not write any definitions in this file other than constants.  Do
9 c93041a5 Jose A. Lopes
not even write helper functions.  The definitions in this module are
10 c93041a5 Jose A. Lopes
automatically stripped to build the Makefile.am target
11 c93041a5 Jose A. Lopes
'ListConstants.hs'.  If there are helper functions in this module,
12 c93041a5 Jose A. Lopes
they will also be dragged and it will cause compilation to fail.
13 c93041a5 Jose A. Lopes
Therefore, all helper functions should go to a separate module and
14 c93041a5 Jose A. Lopes
imported.
15 c93041a5 Jose A. Lopes
16 1b2adaa6 Jose A. Lopes
-}
17 1b2adaa6 Jose A. Lopes
18 1b2adaa6 Jose A. Lopes
{-
19 1b2adaa6 Jose A. Lopes
20 1b2adaa6 Jose A. Lopes
Copyright (C) 2013 Google Inc.
21 1b2adaa6 Jose A. Lopes
22 1b2adaa6 Jose A. Lopes
This program is free software; you can redistribute it and/or modify
23 1b2adaa6 Jose A. Lopes
it under the terms of the GNU General Public License as published by
24 1b2adaa6 Jose A. Lopes
the Free Software Foundation; either version 2 of the License, or
25 1b2adaa6 Jose A. Lopes
(at your option) any later version.
26 1b2adaa6 Jose A. Lopes
27 1b2adaa6 Jose A. Lopes
This program is distributed in the hope that it will be useful, but
28 1b2adaa6 Jose A. Lopes
WITHOUT ANY WARRANTY; without even the implied warranty of
29 1b2adaa6 Jose A. Lopes
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
30 1b2adaa6 Jose A. Lopes
General Public License for more details.
31 1b2adaa6 Jose A. Lopes
32 1b2adaa6 Jose A. Lopes
You should have received a copy of the GNU General Public License
33 1b2adaa6 Jose A. Lopes
along with this program; if not, write to the Free Software
34 1b2adaa6 Jose A. Lopes
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
35 1b2adaa6 Jose A. Lopes
02110-1301, USA.
36 1b2adaa6 Jose A. Lopes
37 1b2adaa6 Jose A. Lopes
-}
38 1b2adaa6 Jose A. Lopes
module Ganeti.HsConstants where
39 1b2adaa6 Jose A. Lopes
40 9be1ff8c Jose A. Lopes
import Control.Arrow ((***))
41 cdac0552 Jose A. Lopes
import Data.List ((\\))
42 6dc0cb59 Jose A. Lopes
import Data.Map (Map)
43 93e2e44e Jose A. Lopes
import qualified Data.Map as Map (empty, fromList, keys, insert)
44 6dc0cb59 Jose A. Lopes
45 b998e7f6 Jose A. Lopes
import qualified AutoConf
46 a2b55ccd Jose A. Lopes
import Ganeti.ConstantUtils (PythonChar(..), PythonNone(..), FrozenSet,
47 a2b55ccd Jose A. Lopes
                             Protocol(..), buildVersion)
48 df726590 Jose A. Lopes
import qualified Ganeti.ConstantUtils as ConstantUtils
49 8397ffde Jose A. Lopes
import Ganeti.HTools.Types (AutoRepairResult(..), AutoRepairType(..))
50 8397ffde Jose A. Lopes
import qualified Ganeti.HTools.Types as Types
51 df726590 Jose A. Lopes
import Ganeti.Logging (SyslogUsage(..))
52 df726590 Jose A. Lopes
import qualified Ganeti.Logging as Logging (syslogUsageToRaw)
53 1c31b263 Jose A. Lopes
import qualified Ganeti.Runtime as Runtime
54 6dab85ff Jose A. Lopes
import Ganeti.Runtime (GanetiDaemon(..), MiscGroup(..), GanetiGroup(..),
55 6dab85ff Jose A. Lopes
                       ExtraLogReason(..))
56 47ea2344 Jose A. Lopes
import Ganeti.THH (PyValueEx(..))
57 85c48fbb Jose A. Lopes
import Ganeti.Types
58 85c48fbb Jose A. Lopes
import qualified Ganeti.Types as Types
59 cdac0552 Jose A. Lopes
import Ganeti.Confd.Types (ConfdRequestType(..), ConfdReqField(..),
60 cdac0552 Jose A. Lopes
                           ConfdReplyStatus(..), ConfdNodeRole(..),
61 cdac0552 Jose A. Lopes
                           ConfdErrorType(..))
62 cdac0552 Jose A. Lopes
import qualified Ganeti.Confd.Types as Types
63 85c48fbb Jose A. Lopes
64 c03224f6 Jose A. Lopes
{-# ANN module "HLint: ignore Use camelCase" #-}
65 c03224f6 Jose A. Lopes
66 1c9e817d Jose A. Lopes
-- * 'autoconf' constants for Python only ('autotools/build-bash-completion')
67 1c9e817d Jose A. Lopes
68 1c9e817d Jose A. Lopes
htoolsProgs :: [String]
69 1c9e817d Jose A. Lopes
htoolsProgs = AutoConf.htoolsProgs
70 1c9e817d Jose A. Lopes
71 1c9e817d Jose A. Lopes
-- * 'autoconf' constants for Python only ('lib/constants.py')
72 3b170ad4 Jose A. Lopes
73 3b170ad4 Jose A. Lopes
drbdBarriers :: String
74 3b170ad4 Jose A. Lopes
drbdBarriers = AutoConf.drbdBarriers
75 3b170ad4 Jose A. Lopes
76 3b170ad4 Jose A. Lopes
drbdNoMetaFlush :: Bool
77 3b170ad4 Jose A. Lopes
drbdNoMetaFlush = AutoConf.drbdNoMetaFlush
78 3b170ad4 Jose A. Lopes
79 3b170ad4 Jose A. Lopes
lvmStripecount :: Int
80 3b170ad4 Jose A. Lopes
lvmStripecount = AutoConf.lvmStripecount
81 3b170ad4 Jose A. Lopes
82 d250bc5d Klaus Aehlig
hasGnuLn :: Bool
83 d250bc5d Klaus Aehlig
hasGnuLn = AutoConf.hasGnuLn
84 d250bc5d Klaus Aehlig
85 1c9e817d Jose A. Lopes
-- * 'autoconf' constants for Python only ('lib/pathutils.py')
86 1c9e817d Jose A. Lopes
87 1c9e817d Jose A. Lopes
-- ** Build-time constants
88 1c9e817d Jose A. Lopes
89 1c9e817d Jose A. Lopes
exportDir :: String
90 1c9e817d Jose A. Lopes
exportDir = AutoConf.exportDir
91 1c9e817d Jose A. Lopes
92 1c9e817d Jose A. Lopes
osSearchPath :: [String]
93 1c9e817d Jose A. Lopes
osSearchPath = AutoConf.osSearchPath
94 1c9e817d Jose A. Lopes
95 1c9e817d Jose A. Lopes
esSearchPath :: [String]
96 1c9e817d Jose A. Lopes
esSearchPath = AutoConf.esSearchPath
97 1c9e817d Jose A. Lopes
98 1c9e817d Jose A. Lopes
sshConfigDir :: String
99 1c9e817d Jose A. Lopes
sshConfigDir = AutoConf.sshConfigDir
100 1c9e817d Jose A. Lopes
101 1c9e817d Jose A. Lopes
xenConfigDir :: String
102 1c9e817d Jose A. Lopes
xenConfigDir = AutoConf.xenConfigDir
103 1c9e817d Jose A. Lopes
104 1c9e817d Jose A. Lopes
sysconfdir :: String
105 1c9e817d Jose A. Lopes
sysconfdir = AutoConf.sysconfdir
106 1c9e817d Jose A. Lopes
107 1c9e817d Jose A. Lopes
toolsdir :: String
108 1c9e817d Jose A. Lopes
toolsdir = AutoConf.toolsdir
109 1c9e817d Jose A. Lopes
110 1c9e817d Jose A. Lopes
localstatedir :: String
111 1c9e817d Jose A. Lopes
localstatedir = AutoConf.localstatedir
112 1c9e817d Jose A. Lopes
113 1c9e817d Jose A. Lopes
-- ** Paths which don't change for a virtual cluster
114 1c9e817d Jose A. Lopes
115 1c9e817d Jose A. Lopes
pkglibdir :: String
116 1c9e817d Jose A. Lopes
pkglibdir = AutoConf.pkglibdir
117 1c9e817d Jose A. Lopes
118 9bfcf2e9 Klaus Aehlig
sharedir :: String
119 9bfcf2e9 Klaus Aehlig
sharedir = AutoConf.sharedir
120 9bfcf2e9 Klaus Aehlig
121 1c9e817d Jose A. Lopes
-- * 'autoconf' constants for Python only ('lib/build/sphinx_ext.py')
122 1c9e817d Jose A. Lopes
123 1c9e817d Jose A. Lopes
manPages :: Map String Int
124 1c9e817d Jose A. Lopes
manPages = Map.fromList AutoConf.manPages
125 1c9e817d Jose A. Lopes
126 1c9e817d Jose A. Lopes
-- * 'autoconf' constants for QA cluster only ('qa/qa_cluster.py')
127 1c9e817d Jose A. Lopes
128 1c9e817d Jose A. Lopes
versionedsharedir :: String
129 1c9e817d Jose A. Lopes
versionedsharedir = AutoConf.versionedsharedir
130 1c9e817d Jose A. Lopes
131 1c9e817d Jose A. Lopes
-- * 'autoconf' constants for Python only ('tests/py/docs_unittest.py')
132 1c9e817d Jose A. Lopes
133 1c9e817d Jose A. Lopes
gntScripts :: [String]
134 1c9e817d Jose A. Lopes
gntScripts = AutoConf.gntScripts
135 1c9e817d Jose A. Lopes
136 3b170ad4 Jose A. Lopes
-- * Various versions
137 3b170ad4 Jose A. Lopes
138 3b170ad4 Jose A. Lopes
releaseVersion :: String
139 3b170ad4 Jose A. Lopes
releaseVersion = AutoConf.packageVersion
140 3b170ad4 Jose A. Lopes
141 8c44d5b3 Klaus Aehlig
versionMajor :: Int
142 8c44d5b3 Klaus Aehlig
versionMajor = AutoConf.versionMajor
143 8c44d5b3 Klaus Aehlig
144 8c44d5b3 Klaus Aehlig
versionMinor :: Int
145 8c44d5b3 Klaus Aehlig
versionMinor = AutoConf.versionMinor
146 8c44d5b3 Klaus Aehlig
147 8c44d5b3 Klaus Aehlig
versionRevision :: Int
148 8c44d5b3 Klaus Aehlig
versionRevision = AutoConf.versionRevision
149 8c44d5b3 Klaus Aehlig
150 9b20010b Klaus Aehlig
dirVersion :: String
151 9b20010b Klaus Aehlig
dirVersion = AutoConf.dirVersion
152 9b20010b Klaus Aehlig
153 c87997d2 Jose A. Lopes
osApiV10 :: Int
154 c87997d2 Jose A. Lopes
osApiV10 = 10
155 c87997d2 Jose A. Lopes
156 c87997d2 Jose A. Lopes
osApiV15 :: Int
157 c87997d2 Jose A. Lopes
osApiV15 = 15
158 c87997d2 Jose A. Lopes
159 c87997d2 Jose A. Lopes
osApiV20 :: Int
160 c87997d2 Jose A. Lopes
osApiV20 = 20
161 c87997d2 Jose A. Lopes
162 c87997d2 Jose A. Lopes
osApiVersions :: FrozenSet Int
163 c87997d2 Jose A. Lopes
osApiVersions = ConstantUtils.mkSet [osApiV10, osApiV15, osApiV20]
164 c87997d2 Jose A. Lopes
165 14795b58 Jose A. Lopes
exportVersion :: Int
166 14795b58 Jose A. Lopes
exportVersion = 0
167 14795b58 Jose A. Lopes
168 14795b58 Jose A. Lopes
rapiVersion :: Int
169 14795b58 Jose A. Lopes
rapiVersion = 2
170 14795b58 Jose A. Lopes
171 3b170ad4 Jose A. Lopes
configMajor :: Int
172 3b170ad4 Jose A. Lopes
configMajor = AutoConf.versionMajor
173 3b170ad4 Jose A. Lopes
174 3b170ad4 Jose A. Lopes
configMinor :: Int
175 3b170ad4 Jose A. Lopes
configMinor = AutoConf.versionMinor
176 3b170ad4 Jose A. Lopes
177 3b170ad4 Jose A. Lopes
-- | The configuration is supposed to remain stable across
178 3b170ad4 Jose A. Lopes
-- revisions. Therefore, the revision number is cleared to '0'.
179 3b170ad4 Jose A. Lopes
configRevision :: Int
180 3b170ad4 Jose A. Lopes
configRevision = 0
181 3b170ad4 Jose A. Lopes
182 3b170ad4 Jose A. Lopes
configVersion :: Int
183 3b170ad4 Jose A. Lopes
configVersion = buildVersion configMajor configMinor configRevision
184 3b170ad4 Jose A. Lopes
185 3b170ad4 Jose A. Lopes
-- | Similarly to the configuration (see 'configRevision'), the
186 3b170ad4 Jose A. Lopes
-- protocols are supposed to remain stable across revisions.
187 3b170ad4 Jose A. Lopes
protocolVersion :: Int
188 3b170ad4 Jose A. Lopes
protocolVersion = buildVersion configMajor configMinor configRevision
189 3b170ad4 Jose A. Lopes
190 c890f66a Jose A. Lopes
-- * User separation
191 cdac0552 Jose A. Lopes
192 c890f66a Jose A. Lopes
daemonsGroup :: String
193 c890f66a Jose A. Lopes
daemonsGroup = Runtime.daemonGroup (ExtraGroup DaemonsGroup)
194 85c48fbb Jose A. Lopes
195 c890f66a Jose A. Lopes
adminGroup :: String
196 c890f66a Jose A. Lopes
adminGroup = Runtime.daemonGroup (ExtraGroup AdminGroup)
197 85c48fbb Jose A. Lopes
198 c890f66a Jose A. Lopes
masterdUser :: String
199 c890f66a Jose A. Lopes
masterdUser = Runtime.daemonUser GanetiMasterd
200 85c48fbb Jose A. Lopes
201 c890f66a Jose A. Lopes
masterdGroup :: String
202 c890f66a Jose A. Lopes
masterdGroup = Runtime.daemonGroup (DaemonGroup GanetiMasterd)
203 85c48fbb Jose A. Lopes
204 c890f66a Jose A. Lopes
rapiUser :: String
205 c890f66a Jose A. Lopes
rapiUser = Runtime.daemonUser GanetiRapi
206 85c48fbb Jose A. Lopes
207 c890f66a Jose A. Lopes
rapiGroup :: String
208 c890f66a Jose A. Lopes
rapiGroup = Runtime.daemonGroup (DaemonGroup GanetiRapi)
209 85c48fbb Jose A. Lopes
210 c890f66a Jose A. Lopes
confdUser :: String
211 c890f66a Jose A. Lopes
confdUser = Runtime.daemonUser GanetiConfd
212 85c48fbb Jose A. Lopes
213 c890f66a Jose A. Lopes
confdGroup :: String
214 c890f66a Jose A. Lopes
confdGroup = Runtime.daemonGroup (DaemonGroup GanetiConfd)
215 85c48fbb Jose A. Lopes
216 c890f66a Jose A. Lopes
luxidUser :: String
217 c890f66a Jose A. Lopes
luxidUser = Runtime.daemonUser GanetiLuxid
218 85c48fbb Jose A. Lopes
219 c890f66a Jose A. Lopes
luxidGroup :: String
220 c890f66a Jose A. Lopes
luxidGroup = Runtime.daemonGroup (DaemonGroup GanetiLuxid)
221 85c48fbb Jose A. Lopes
222 c890f66a Jose A. Lopes
nodedUser :: String
223 c890f66a Jose A. Lopes
nodedUser = Runtime.daemonUser GanetiNoded
224 85c48fbb Jose A. Lopes
225 c890f66a Jose A. Lopes
nodedGroup :: String
226 c890f66a Jose A. Lopes
nodedGroup = Runtime.daemonGroup (DaemonGroup GanetiNoded)
227 85c48fbb Jose A. Lopes
228 c890f66a Jose A. Lopes
mondUser :: String
229 c890f66a Jose A. Lopes
mondUser = Runtime.daemonUser GanetiMond
230 85c48fbb Jose A. Lopes
231 c890f66a Jose A. Lopes
mondGroup :: String
232 c890f66a Jose A. Lopes
mondGroup = Runtime.daemonGroup (DaemonGroup GanetiMond)
233 85c48fbb Jose A. Lopes
234 c890f66a Jose A. Lopes
sshLoginUser :: String
235 c890f66a Jose A. Lopes
sshLoginUser = AutoConf.sshLoginUser
236 85c48fbb Jose A. Lopes
237 c890f66a Jose A. Lopes
sshConsoleUser :: String
238 c890f66a Jose A. Lopes
sshConsoleUser = AutoConf.sshConsoleUser
239 85c48fbb Jose A. Lopes
240 e0cd6f5d Jose A. Lopes
-- * Cpu pinning separators and constants
241 e0cd6f5d Jose A. Lopes
242 e0cd6f5d Jose A. Lopes
cpuPinningSep :: String
243 e0cd6f5d Jose A. Lopes
cpuPinningSep = ":"
244 e0cd6f5d Jose A. Lopes
245 e0cd6f5d Jose A. Lopes
cpuPinningAll :: String
246 e0cd6f5d Jose A. Lopes
cpuPinningAll = "all"
247 e0cd6f5d Jose A. Lopes
248 e0cd6f5d Jose A. Lopes
-- | Internal representation of "all"
249 e0cd6f5d Jose A. Lopes
cpuPinningAllVal :: Int
250 e0cd6f5d Jose A. Lopes
cpuPinningAllVal = -1
251 e0cd6f5d Jose A. Lopes
252 e0cd6f5d Jose A. Lopes
-- | One "all" entry in a CPU list means CPU pinning is off
253 e0cd6f5d Jose A. Lopes
cpuPinningOff :: [Int]
254 e0cd6f5d Jose A. Lopes
cpuPinningOff = [cpuPinningAllVal]
255 e0cd6f5d Jose A. Lopes
256 e0cd6f5d Jose A. Lopes
-- | A Xen-specific implementation detail is that there is no way to
257 e0cd6f5d Jose A. Lopes
-- actually say "use any cpu for pinning" in a Xen configuration file,
258 e0cd6f5d Jose A. Lopes
-- as opposed to the command line, where you can say
259 e0cd6f5d Jose A. Lopes
-- @
260 e0cd6f5d Jose A. Lopes
-- xm vcpu-pin <domain> <vcpu> all
261 e0cd6f5d Jose A. Lopes
-- @
262 e0cd6f5d Jose A. Lopes
--
263 e0cd6f5d Jose A. Lopes
-- The workaround used in Xen is "0-63" (see source code function
264 e0cd6f5d Jose A. Lopes
-- "xm_vcpu_pin" in @<xen-source>/tools/python/xen/xm/main.py@).
265 e0cd6f5d Jose A. Lopes
--
266 e0cd6f5d Jose A. Lopes
-- To support future changes, the following constant is treated as a
267 e0cd6f5d Jose A. Lopes
-- blackbox string that simply means "use any cpu for pinning under
268 e0cd6f5d Jose A. Lopes
-- xen".
269 e0cd6f5d Jose A. Lopes
cpuPinningAllXen :: String
270 e0cd6f5d Jose A. Lopes
cpuPinningAllXen = "0-63"
271 e0cd6f5d Jose A. Lopes
272 e0cd6f5d Jose A. Lopes
-- | A KVM-specific implementation detail - the following value is
273 e0cd6f5d Jose A. Lopes
-- used to set CPU affinity to all processors (--0 through --31), per
274 e0cd6f5d Jose A. Lopes
-- taskset man page.
275 e0cd6f5d Jose A. Lopes
--
276 e0cd6f5d Jose A. Lopes
-- FIXME: This only works for machines with up to 32 CPU cores
277 e0cd6f5d Jose A. Lopes
cpuPinningAllKvm :: Int
278 e0cd6f5d Jose A. Lopes
cpuPinningAllKvm = 0xFFFFFFFF
279 e0cd6f5d Jose A. Lopes
280 74129b52 Jose A. Lopes
-- * Wipe
281 74129b52 Jose A. Lopes
282 74129b52 Jose A. Lopes
ddCmd :: String
283 74129b52 Jose A. Lopes
ddCmd = "dd"
284 74129b52 Jose A. Lopes
285 74129b52 Jose A. Lopes
-- | 1GB
286 74129b52 Jose A. Lopes
maxWipeChunk :: Int
287 74129b52 Jose A. Lopes
maxWipeChunk = 1024
288 74129b52 Jose A. Lopes
289 74129b52 Jose A. Lopes
minWipeChunkPercent :: Int
290 74129b52 Jose A. Lopes
minWipeChunkPercent = 10
291 74129b52 Jose A. Lopes
292 74129b52 Jose A. Lopes
-- * Directories
293 74129b52 Jose A. Lopes
294 74129b52 Jose A. Lopes
runDirsMode :: Int
295 74129b52 Jose A. Lopes
runDirsMode = 0o775
296 74129b52 Jose A. Lopes
297 74129b52 Jose A. Lopes
secureDirMode :: Int
298 74129b52 Jose A. Lopes
secureDirMode = 0o700
299 74129b52 Jose A. Lopes
300 74129b52 Jose A. Lopes
secureFileMode :: Int
301 74129b52 Jose A. Lopes
secureFileMode = 0o600
302 74129b52 Jose A. Lopes
303 74129b52 Jose A. Lopes
adoptableBlockdevRoot :: String
304 74129b52 Jose A. Lopes
adoptableBlockdevRoot = "/dev/disk/"
305 74129b52 Jose A. Lopes
306 3b170ad4 Jose A. Lopes
-- * 'autoconf' enable/disable
307 3b170ad4 Jose A. Lopes
308 3b170ad4 Jose A. Lopes
enableConfd :: Bool
309 3b170ad4 Jose A. Lopes
enableConfd = AutoConf.enableConfd
310 3b170ad4 Jose A. Lopes
311 3b170ad4 Jose A. Lopes
enableMond :: Bool
312 3b170ad4 Jose A. Lopes
enableMond = AutoConf.enableMond
313 3b170ad4 Jose A. Lopes
314 3b170ad4 Jose A. Lopes
enableRestrictedCommands :: Bool
315 3b170ad4 Jose A. Lopes
enableRestrictedCommands = AutoConf.enableRestrictedCommands
316 3b170ad4 Jose A. Lopes
317 3b170ad4 Jose A. Lopes
enableSplitQuery :: Bool
318 3b170ad4 Jose A. Lopes
enableSplitQuery = AutoConf.enableSplitQuery
319 3b170ad4 Jose A. Lopes
320 c890f66a Jose A. Lopes
-- * SSH constants
321 85c48fbb Jose A. Lopes
322 c890f66a Jose A. Lopes
ssh :: String
323 c890f66a Jose A. Lopes
ssh = "ssh"
324 85c48fbb Jose A. Lopes
325 c890f66a Jose A. Lopes
scp :: String
326 c890f66a Jose A. Lopes
scp = "scp"
327 85c48fbb Jose A. Lopes
328 c890f66a Jose A. Lopes
-- * Daemons
329 85c48fbb Jose A. Lopes
330 c890f66a Jose A. Lopes
confd :: String
331 c890f66a Jose A. Lopes
confd = Runtime.daemonName GanetiConfd
332 85c48fbb Jose A. Lopes
333 c890f66a Jose A. Lopes
masterd :: String
334 c890f66a Jose A. Lopes
masterd = Runtime.daemonName GanetiMasterd
335 85c48fbb Jose A. Lopes
336 c890f66a Jose A. Lopes
mond :: String
337 c890f66a Jose A. Lopes
mond = Runtime.daemonName GanetiMond
338 85c48fbb Jose A. Lopes
339 c890f66a Jose A. Lopes
noded :: String
340 c890f66a Jose A. Lopes
noded = Runtime.daemonName GanetiNoded
341 85c48fbb Jose A. Lopes
342 c890f66a Jose A. Lopes
luxid :: String
343 c890f66a Jose A. Lopes
luxid = Runtime.daemonName GanetiLuxid
344 85c48fbb Jose A. Lopes
345 c890f66a Jose A. Lopes
rapi :: String
346 c890f66a Jose A. Lopes
rapi = Runtime.daemonName GanetiRapi
347 85c48fbb Jose A. Lopes
348 c890f66a Jose A. Lopes
daemons :: FrozenSet String
349 c890f66a Jose A. Lopes
daemons =
350 c890f66a Jose A. Lopes
  ConstantUtils.mkSet [confd,
351 c890f66a Jose A. Lopes
                       luxid,
352 c890f66a Jose A. Lopes
                       masterd,
353 c890f66a Jose A. Lopes
                       mond,
354 c890f66a Jose A. Lopes
                       noded,
355 c890f66a Jose A. Lopes
                       rapi]
356 85c48fbb Jose A. Lopes
357 c890f66a Jose A. Lopes
defaultConfdPort :: Int
358 c890f66a Jose A. Lopes
defaultConfdPort = 1814
359 85c48fbb Jose A. Lopes
360 c890f66a Jose A. Lopes
defaultMondPort :: Int
361 c890f66a Jose A. Lopes
defaultMondPort = 1815
362 85c48fbb Jose A. Lopes
363 c890f66a Jose A. Lopes
defaultNodedPort :: Int
364 c890f66a Jose A. Lopes
defaultNodedPort = 1811
365 85c48fbb Jose A. Lopes
366 c890f66a Jose A. Lopes
defaultRapiPort :: Int
367 c890f66a Jose A. Lopes
defaultRapiPort = 5080
368 85c48fbb Jose A. Lopes
369 c890f66a Jose A. Lopes
daemonsPorts :: Map String (Protocol, Int)
370 c890f66a Jose A. Lopes
daemonsPorts =
371 c890f66a Jose A. Lopes
  Map.fromList [(confd, (Udp, defaultConfdPort)),
372 c890f66a Jose A. Lopes
                (mond, (Tcp, defaultMondPort)),
373 c890f66a Jose A. Lopes
                (noded, (Tcp, defaultNodedPort)),
374 c890f66a Jose A. Lopes
                (rapi, (Tcp, defaultRapiPort)),
375 c890f66a Jose A. Lopes
                (ssh, (Tcp, 22))]
376 85c48fbb Jose A. Lopes
377 74129b52 Jose A. Lopes
firstDrbdPort :: Int
378 74129b52 Jose A. Lopes
firstDrbdPort = 11000
379 74129b52 Jose A. Lopes
380 74129b52 Jose A. Lopes
lastDrbdPort :: Int
381 74129b52 Jose A. Lopes
lastDrbdPort = 14999
382 74129b52 Jose A. Lopes
383 c890f66a Jose A. Lopes
daemonsLogbase :: Map String String
384 c890f66a Jose A. Lopes
daemonsLogbase =
385 c890f66a Jose A. Lopes
  Map.fromList
386 c890f66a Jose A. Lopes
  [ (Runtime.daemonName d, Runtime.daemonLogBase d) | d <- [minBound..] ]
387 85c48fbb Jose A. Lopes
388 e0007cf1 Jose A. Lopes
daemonsExtraLogbase :: Map String (Map String String)
389 e0007cf1 Jose A. Lopes
daemonsExtraLogbase =
390 e0007cf1 Jose A. Lopes
  Map.fromList $
391 e0007cf1 Jose A. Lopes
  map (Runtime.daemonName *** id)
392 e0007cf1 Jose A. Lopes
  [ (GanetiMond, Map.fromList
393 e0007cf1 Jose A. Lopes
                 [ ("access", Runtime.daemonsExtraLogbase GanetiMond AccessLog)
394 e0007cf1 Jose A. Lopes
                 , ("error", Runtime.daemonsExtraLogbase GanetiMond ErrorLog)
395 e0007cf1 Jose A. Lopes
                 ])
396 e0007cf1 Jose A. Lopes
  ]
397 e0007cf1 Jose A. Lopes
398 c890f66a Jose A. Lopes
extraLogreasonAccess :: String
399 c890f66a Jose A. Lopes
extraLogreasonAccess = Runtime.daemonsExtraLogbase GanetiMond AccessLog
400 85c48fbb Jose A. Lopes
401 c890f66a Jose A. Lopes
extraLogreasonError :: String
402 c890f66a Jose A. Lopes
extraLogreasonError = Runtime.daemonsExtraLogbase GanetiMond ErrorLog
403 85c48fbb Jose A. Lopes
404 c890f66a Jose A. Lopes
devConsole :: String
405 c890f66a Jose A. Lopes
devConsole = ConstantUtils.devConsole
406 85c48fbb Jose A. Lopes
407 0412a686 Jose A. Lopes
procMounts :: String
408 0412a686 Jose A. Lopes
procMounts = "/proc/mounts"
409 0412a686 Jose A. Lopes
410 5d4e1402 Jose A. Lopes
-- * Luxi (Local UniX Interface) related constants
411 5d4e1402 Jose A. Lopes
412 5d4e1402 Jose A. Lopes
luxiEom :: PythonChar
413 5d4e1402 Jose A. Lopes
luxiEom = PythonChar '\x03'
414 5d4e1402 Jose A. Lopes
415 5d4e1402 Jose A. Lopes
-- | Environment variable for the luxi override socket
416 5d4e1402 Jose A. Lopes
luxiOverride :: String
417 5d4e1402 Jose A. Lopes
luxiOverride = "FORCE_LUXI_SOCKET"
418 5d4e1402 Jose A. Lopes
419 5d4e1402 Jose A. Lopes
luxiOverrideMaster :: String
420 5d4e1402 Jose A. Lopes
luxiOverrideMaster = "master"
421 5d4e1402 Jose A. Lopes
422 5d4e1402 Jose A. Lopes
luxiOverrideQuery :: String
423 5d4e1402 Jose A. Lopes
luxiOverrideQuery = "query"
424 5d4e1402 Jose A. Lopes
425 5d4e1402 Jose A. Lopes
luxiVersion :: Int
426 5d4e1402 Jose A. Lopes
luxiVersion = configVersion
427 5d4e1402 Jose A. Lopes
428 c890f66a Jose A. Lopes
-- * Syslog
429 85c48fbb Jose A. Lopes
430 c890f66a Jose A. Lopes
syslogUsage :: String
431 c890f66a Jose A. Lopes
syslogUsage = AutoConf.syslogUsage
432 85c48fbb Jose A. Lopes
433 c890f66a Jose A. Lopes
syslogNo :: String
434 c890f66a Jose A. Lopes
syslogNo = Logging.syslogUsageToRaw SyslogNo
435 85c48fbb Jose A. Lopes
436 c890f66a Jose A. Lopes
syslogYes :: String
437 c890f66a Jose A. Lopes
syslogYes = Logging.syslogUsageToRaw SyslogYes
438 85c48fbb Jose A. Lopes
439 c890f66a Jose A. Lopes
syslogOnly :: String
440 c890f66a Jose A. Lopes
syslogOnly = Logging.syslogUsageToRaw SyslogOnly
441 85c48fbb Jose A. Lopes
442 c890f66a Jose A. Lopes
syslogSocket :: String
443 c890f66a Jose A. Lopes
syslogSocket = "/dev/log"
444 85c48fbb Jose A. Lopes
445 0412a686 Jose A. Lopes
exportConfFile :: String
446 0412a686 Jose A. Lopes
exportConfFile = "config.ini"
447 0412a686 Jose A. Lopes
448 c890f66a Jose A. Lopes
-- * Xen
449 85c48fbb Jose A. Lopes
450 c890f66a Jose A. Lopes
xenBootloader :: String
451 c890f66a Jose A. Lopes
xenBootloader = AutoConf.xenBootloader
452 85c48fbb Jose A. Lopes
453 c890f66a Jose A. Lopes
xenCmdXl :: String
454 c890f66a Jose A. Lopes
xenCmdXl = "xl"
455 85c48fbb Jose A. Lopes
456 c890f66a Jose A. Lopes
xenCmdXm :: String
457 c890f66a Jose A. Lopes
xenCmdXm = "xm"
458 85c48fbb Jose A. Lopes
459 c890f66a Jose A. Lopes
xenInitrd :: String
460 c890f66a Jose A. Lopes
xenInitrd = AutoConf.xenInitrd
461 85c48fbb Jose A. Lopes
462 c890f66a Jose A. Lopes
xenKernel :: String
463 c890f66a Jose A. Lopes
xenKernel = AutoConf.xenKernel
464 85c48fbb Jose A. Lopes
465 c890f66a Jose A. Lopes
-- FIXME: perhaps rename to 'validXenCommands' for consistency with
466 c890f66a Jose A. Lopes
-- other constants
467 c890f66a Jose A. Lopes
knownXenCommands :: FrozenSet String
468 c890f66a Jose A. Lopes
knownXenCommands = ConstantUtils.mkSet [xenCmdXl, xenCmdXm]
469 85c48fbb Jose A. Lopes
470 3b170ad4 Jose A. Lopes
-- * KVM and socat
471 3b170ad4 Jose A. Lopes
472 3b170ad4 Jose A. Lopes
kvmPath :: String
473 3b170ad4 Jose A. Lopes
kvmPath = AutoConf.kvmPath
474 3b170ad4 Jose A. Lopes
475 3b170ad4 Jose A. Lopes
kvmKernel :: String
476 3b170ad4 Jose A. Lopes
kvmKernel = AutoConf.kvmKernel
477 3b170ad4 Jose A. Lopes
478 3b170ad4 Jose A. Lopes
socatEscapeCode :: String
479 3b170ad4 Jose A. Lopes
socatEscapeCode = "0x1d"
480 3b170ad4 Jose A. Lopes
481 3b170ad4 Jose A. Lopes
socatPath :: String
482 3b170ad4 Jose A. Lopes
socatPath = AutoConf.socatPath
483 3b170ad4 Jose A. Lopes
484 3b170ad4 Jose A. Lopes
socatUseCompress :: Bool
485 3b170ad4 Jose A. Lopes
socatUseCompress = AutoConf.socatUseCompress
486 3b170ad4 Jose A. Lopes
487 3b170ad4 Jose A. Lopes
socatUseEscape :: Bool
488 3b170ad4 Jose A. Lopes
socatUseEscape = AutoConf.socatUseEscape
489 3b170ad4 Jose A. Lopes
490 3f5fd161 Jose A. Lopes
-- * Console types
491 3f5fd161 Jose A. Lopes
492 3f5fd161 Jose A. Lopes
-- | Display a message for console access
493 3f5fd161 Jose A. Lopes
consMessage :: String
494 3f5fd161 Jose A. Lopes
consMessage = "msg"
495 3f5fd161 Jose A. Lopes
496 3f5fd161 Jose A. Lopes
-- | Console as SPICE server
497 3f5fd161 Jose A. Lopes
consSpice :: String
498 3f5fd161 Jose A. Lopes
consSpice = "spice"
499 3f5fd161 Jose A. Lopes
500 3f5fd161 Jose A. Lopes
-- | Console as SSH command
501 3f5fd161 Jose A. Lopes
consSsh :: String
502 3f5fd161 Jose A. Lopes
consSsh = "ssh"
503 3f5fd161 Jose A. Lopes
504 3f5fd161 Jose A. Lopes
-- | Console as VNC server
505 3f5fd161 Jose A. Lopes
consVnc :: String
506 3f5fd161 Jose A. Lopes
consVnc = "vnc"
507 3f5fd161 Jose A. Lopes
508 3f5fd161 Jose A. Lopes
consAll :: FrozenSet String
509 3f5fd161 Jose A. Lopes
consAll = ConstantUtils.mkSet [consMessage, consSpice, consSsh, consVnc]
510 3f5fd161 Jose A. Lopes
511 3f5fd161 Jose A. Lopes
-- | RSA key bit length
512 3f5fd161 Jose A. Lopes
--
513 3f5fd161 Jose A. Lopes
-- For RSA keys more bits are better, but they also make operations
514 3f5fd161 Jose A. Lopes
-- more expensive. NIST SP 800-131 recommends a minimum of 2048 bits
515 3f5fd161 Jose A. Lopes
-- from the year 2010 on.
516 3f5fd161 Jose A. Lopes
rsaKeyBits :: Int
517 3f5fd161 Jose A. Lopes
rsaKeyBits = 2048
518 3f5fd161 Jose A. Lopes
519 3f5fd161 Jose A. Lopes
-- | Ciphers allowed for SSL connections.
520 3f5fd161 Jose A. Lopes
--
521 3f5fd161 Jose A. Lopes
-- For the format, see ciphers(1). A better way to disable ciphers
522 3f5fd161 Jose A. Lopes
-- would be to use the exclamation mark (!), but socat versions below
523 3f5fd161 Jose A. Lopes
-- 1.5 can't parse exclamation marks in options properly. When
524 3f5fd161 Jose A. Lopes
-- modifying the ciphers, ensure not to accidentially add something
525 3f5fd161 Jose A. Lopes
-- after it's been removed. Use the "openssl" utility to check the
526 3f5fd161 Jose A. Lopes
-- allowed ciphers, e.g.  "openssl ciphers -v HIGH:-DES".
527 3f5fd161 Jose A. Lopes
opensslCiphers :: String
528 3f5fd161 Jose A. Lopes
opensslCiphers = "HIGH:-DES:-3DES:-EXPORT:-ADH"
529 3f5fd161 Jose A. Lopes
530 3f5fd161 Jose A. Lopes
-- * X509
531 3f5fd161 Jose A. Lopes
532 3f5fd161 Jose A. Lopes
-- | commonName (CN) used in certificates
533 3f5fd161 Jose A. Lopes
x509CertCn :: String
534 3f5fd161 Jose A. Lopes
x509CertCn = "ganeti.example.com"
535 3f5fd161 Jose A. Lopes
536 3f5fd161 Jose A. Lopes
-- | Default validity of certificates in days
537 3f5fd161 Jose A. Lopes
x509CertDefaultValidity :: Int
538 3f5fd161 Jose A. Lopes
x509CertDefaultValidity = 365 * 5
539 3f5fd161 Jose A. Lopes
540 3f5fd161 Jose A. Lopes
x509CertSignatureHeader :: String
541 3f5fd161 Jose A. Lopes
x509CertSignatureHeader = "X-Ganeti-Signature"
542 3f5fd161 Jose A. Lopes
543 3f5fd161 Jose A. Lopes
-- | Digest used to sign certificates ("openssl x509" uses SHA1 by default)
544 3f5fd161 Jose A. Lopes
x509CertSignDigest :: String
545 3f5fd161 Jose A. Lopes
x509CertSignDigest = "SHA1"
546 3f5fd161 Jose A. Lopes
547 3f5fd161 Jose A. Lopes
-- * Import/export daemon mode
548 3f5fd161 Jose A. Lopes
549 3f5fd161 Jose A. Lopes
iemExport :: String
550 3f5fd161 Jose A. Lopes
iemExport = "export"
551 3f5fd161 Jose A. Lopes
552 3f5fd161 Jose A. Lopes
iemImport :: String
553 3f5fd161 Jose A. Lopes
iemImport = "import"
554 3f5fd161 Jose A. Lopes
555 3f5fd161 Jose A. Lopes
-- * Import/export transport compression
556 3f5fd161 Jose A. Lopes
557 3f5fd161 Jose A. Lopes
iecGzip :: String
558 f198cf91 Thomas Thrainer
iecGzip = Types.importExportCompressionToRaw GZip
559 3f5fd161 Jose A. Lopes
560 3f5fd161 Jose A. Lopes
iecNone :: String
561 f198cf91 Thomas Thrainer
iecNone = Types.importExportCompressionToRaw None
562 3f5fd161 Jose A. Lopes
563 f198cf91 Thomas Thrainer
iecAll :: FrozenSet String
564 f198cf91 Thomas Thrainer
iecAll =
565 f198cf91 Thomas Thrainer
  ConstantUtils.mkSet $ map Types.importExportCompressionToRaw [minBound..]
566 3f5fd161 Jose A. Lopes
567 3f5fd161 Jose A. Lopes
ieCustomSize :: String
568 3f5fd161 Jose A. Lopes
ieCustomSize = "fd"
569 3f5fd161 Jose A. Lopes
570 3f5fd161 Jose A. Lopes
-- * Import/export I/O
571 3f5fd161 Jose A. Lopes
572 3f5fd161 Jose A. Lopes
-- | Direct file I/O, equivalent to a shell's I/O redirection using
573 3f5fd161 Jose A. Lopes
-- '<' or '>'
574 3f5fd161 Jose A. Lopes
ieioFile :: String
575 3f5fd161 Jose A. Lopes
ieioFile = "file"
576 3f5fd161 Jose A. Lopes
577 3f5fd161 Jose A. Lopes
-- | Raw block device I/O using "dd"
578 3f5fd161 Jose A. Lopes
ieioRawDisk :: String
579 3f5fd161 Jose A. Lopes
ieioRawDisk = "raw"
580 3f5fd161 Jose A. Lopes
581 3f5fd161 Jose A. Lopes
-- | OS definition import/export script
582 3f5fd161 Jose A. Lopes
ieioScript :: String
583 3f5fd161 Jose A. Lopes
ieioScript = "script"
584 3f5fd161 Jose A. Lopes
585 a2b55ccd Jose A. Lopes
-- * Values
586 a2b55ccd Jose A. Lopes
587 a2b55ccd Jose A. Lopes
valueDefault :: String
588 a2b55ccd Jose A. Lopes
valueDefault = "default"
589 a2b55ccd Jose A. Lopes
590 a2b55ccd Jose A. Lopes
valueAuto :: String
591 a2b55ccd Jose A. Lopes
valueAuto = "auto"
592 a2b55ccd Jose A. Lopes
593 a2b55ccd Jose A. Lopes
valueGenerate :: String
594 a2b55ccd Jose A. Lopes
valueGenerate = "generate"
595 a2b55ccd Jose A. Lopes
596 a2b55ccd Jose A. Lopes
valueNone :: String
597 a2b55ccd Jose A. Lopes
valueNone = "none"
598 a2b55ccd Jose A. Lopes
599 a2b55ccd Jose A. Lopes
valueTrue :: String
600 a2b55ccd Jose A. Lopes
valueTrue = "true"
601 a2b55ccd Jose A. Lopes
602 a2b55ccd Jose A. Lopes
valueFalse :: String
603 a2b55ccd Jose A. Lopes
valueFalse = "false"
604 a2b55ccd Jose A. Lopes
605 a2b55ccd Jose A. Lopes
valueHsNothing :: Map String PythonNone
606 a2b55ccd Jose A. Lopes
valueHsNothing = Map.fromList [("Nothing", PythonNone)]
607 a2b55ccd Jose A. Lopes
608 3f5fd161 Jose A. Lopes
-- * Hooks
609 3f5fd161 Jose A. Lopes
610 3f5fd161 Jose A. Lopes
hooksNameCfgupdate :: String
611 3f5fd161 Jose A. Lopes
hooksNameCfgupdate = "config-update"
612 3f5fd161 Jose A. Lopes
613 3f5fd161 Jose A. Lopes
hooksNameWatcher :: String
614 3f5fd161 Jose A. Lopes
hooksNameWatcher = "watcher"
615 3f5fd161 Jose A. Lopes
616 3f5fd161 Jose A. Lopes
hooksPath :: String
617 3f5fd161 Jose A. Lopes
hooksPath = "/sbin:/bin:/usr/sbin:/usr/bin"
618 3f5fd161 Jose A. Lopes
619 3f5fd161 Jose A. Lopes
hooksPhasePost :: String
620 3f5fd161 Jose A. Lopes
hooksPhasePost = "post"
621 3f5fd161 Jose A. Lopes
622 3f5fd161 Jose A. Lopes
hooksPhasePre :: String
623 3f5fd161 Jose A. Lopes
hooksPhasePre = "pre"
624 3f5fd161 Jose A. Lopes
625 3f5fd161 Jose A. Lopes
hooksVersion :: Int
626 3f5fd161 Jose A. Lopes
hooksVersion = 2
627 3f5fd161 Jose A. Lopes
628 3f5fd161 Jose A. Lopes
-- * Hooks subject type (what object type does the LU deal with)
629 3f5fd161 Jose A. Lopes
630 3f5fd161 Jose A. Lopes
htypeCluster :: String
631 3f5fd161 Jose A. Lopes
htypeCluster = "CLUSTER"
632 3f5fd161 Jose A. Lopes
633 3f5fd161 Jose A. Lopes
htypeGroup :: String
634 3f5fd161 Jose A. Lopes
htypeGroup = "GROUP"
635 3f5fd161 Jose A. Lopes
636 3f5fd161 Jose A. Lopes
htypeInstance :: String
637 3f5fd161 Jose A. Lopes
htypeInstance = "INSTANCE"
638 3f5fd161 Jose A. Lopes
639 3f5fd161 Jose A. Lopes
htypeNetwork :: String
640 3f5fd161 Jose A. Lopes
htypeNetwork = "NETWORK"
641 3f5fd161 Jose A. Lopes
642 3f5fd161 Jose A. Lopes
htypeNode :: String
643 3f5fd161 Jose A. Lopes
htypeNode = "NODE"
644 3f5fd161 Jose A. Lopes
645 3f5fd161 Jose A. Lopes
-- * Hkr
646 3f5fd161 Jose A. Lopes
647 3f5fd161 Jose A. Lopes
hkrSkip :: Int
648 3f5fd161 Jose A. Lopes
hkrSkip = 0
649 3f5fd161 Jose A. Lopes
650 3f5fd161 Jose A. Lopes
hkrFail :: Int
651 3f5fd161 Jose A. Lopes
hkrFail = 1
652 3f5fd161 Jose A. Lopes
653 3f5fd161 Jose A. Lopes
hkrSuccess :: Int
654 3f5fd161 Jose A. Lopes
hkrSuccess = 2
655 3f5fd161 Jose A. Lopes
656 c890f66a Jose A. Lopes
-- * Storage types
657 85c48fbb Jose A. Lopes
658 c890f66a Jose A. Lopes
stBlock :: String
659 c890f66a Jose A. Lopes
stBlock = Types.storageTypeToRaw StorageBlock
660 85c48fbb Jose A. Lopes
661 c890f66a Jose A. Lopes
stDiskless :: String
662 c890f66a Jose A. Lopes
stDiskless = Types.storageTypeToRaw StorageDiskless
663 85c48fbb Jose A. Lopes
664 c890f66a Jose A. Lopes
stExt :: String
665 c890f66a Jose A. Lopes
stExt = Types.storageTypeToRaw StorageExt
666 85c48fbb Jose A. Lopes
667 c890f66a Jose A. Lopes
stFile :: String
668 c890f66a Jose A. Lopes
stFile = Types.storageTypeToRaw StorageFile
669 85c48fbb Jose A. Lopes
670 c890f66a Jose A. Lopes
stLvmPv :: String
671 c890f66a Jose A. Lopes
stLvmPv = Types.storageTypeToRaw StorageLvmPv
672 85c48fbb Jose A. Lopes
673 c890f66a Jose A. Lopes
stLvmVg :: String
674 c890f66a Jose A. Lopes
stLvmVg = Types.storageTypeToRaw StorageLvmVg
675 85c48fbb Jose A. Lopes
676 c890f66a Jose A. Lopes
stRados :: String
677 c890f66a Jose A. Lopes
stRados = Types.storageTypeToRaw StorageRados
678 85c48fbb Jose A. Lopes
679 c890f66a Jose A. Lopes
storageTypes :: FrozenSet String
680 c890f66a Jose A. Lopes
storageTypes = ConstantUtils.mkSet $ map Types.storageTypeToRaw [minBound..]
681 85c48fbb Jose A. Lopes
682 9be1ff8c Jose A. Lopes
-- | The set of storage types for which storage reporting is available
683 9be1ff8c Jose A. Lopes
--
684 9be1ff8c Jose A. Lopes
-- FIXME: Remove this, once storage reporting is available for all
685 9be1ff8c Jose A. Lopes
-- types.
686 9be1ff8c Jose A. Lopes
stsReport :: FrozenSet String
687 9be1ff8c Jose A. Lopes
stsReport = ConstantUtils.mkSet [stFile, stLvmPv, stLvmVg]
688 9be1ff8c Jose A. Lopes
689 c890f66a Jose A. Lopes
-- * Storage fields
690 c890f66a Jose A. Lopes
-- ** First two are valid in LU context only, not passed to backend
691 85c48fbb Jose A. Lopes
692 c890f66a Jose A. Lopes
sfNode :: String
693 c890f66a Jose A. Lopes
sfNode = "node"
694 85c48fbb Jose A. Lopes
695 c890f66a Jose A. Lopes
sfType :: String
696 c890f66a Jose A. Lopes
sfType = "type"
697 85c48fbb Jose A. Lopes
698 c890f66a Jose A. Lopes
-- ** and the rest are valid in backend
699 85c48fbb Jose A. Lopes
700 c890f66a Jose A. Lopes
sfAllocatable :: String
701 c890f66a Jose A. Lopes
sfAllocatable = Types.storageFieldToRaw SFAllocatable
702 85c48fbb Jose A. Lopes
703 c890f66a Jose A. Lopes
sfFree :: String
704 c890f66a Jose A. Lopes
sfFree = Types.storageFieldToRaw SFFree
705 85c48fbb Jose A. Lopes
706 c890f66a Jose A. Lopes
sfName :: String
707 c890f66a Jose A. Lopes
sfName = Types.storageFieldToRaw SFName
708 85c48fbb Jose A. Lopes
709 c890f66a Jose A. Lopes
sfSize :: String
710 c890f66a Jose A. Lopes
sfSize = Types.storageFieldToRaw SFSize
711 85c48fbb Jose A. Lopes
712 c890f66a Jose A. Lopes
sfUsed :: String
713 c890f66a Jose A. Lopes
sfUsed = Types.storageFieldToRaw SFUsed
714 85c48fbb Jose A. Lopes
715 9be1ff8c Jose A. Lopes
validStorageFields :: FrozenSet String
716 9be1ff8c Jose A. Lopes
validStorageFields =
717 9be1ff8c Jose A. Lopes
  ConstantUtils.mkSet $ map Types.storageFieldToRaw [minBound..] ++
718 9be1ff8c Jose A. Lopes
                        [sfNode, sfType]
719 9be1ff8c Jose A. Lopes
720 9be1ff8c Jose A. Lopes
modifiableStorageFields :: Map String (FrozenSet String)
721 9be1ff8c Jose A. Lopes
modifiableStorageFields =
722 9be1ff8c Jose A. Lopes
  Map.fromList [(Types.storageTypeToRaw StorageLvmPv,
723 9be1ff8c Jose A. Lopes
                 ConstantUtils.mkSet [sfAllocatable])]
724 9be1ff8c Jose A. Lopes
725 9be1ff8c Jose A. Lopes
-- * Storage operations
726 9be1ff8c Jose A. Lopes
727 9be1ff8c Jose A. Lopes
soFixConsistency :: String
728 9be1ff8c Jose A. Lopes
soFixConsistency = "fix-consistency"
729 9be1ff8c Jose A. Lopes
730 9be1ff8c Jose A. Lopes
validStorageOperations :: Map String (FrozenSet String)
731 9be1ff8c Jose A. Lopes
validStorageOperations =
732 9be1ff8c Jose A. Lopes
  Map.fromList [(Types.storageTypeToRaw StorageLvmVg,
733 9be1ff8c Jose A. Lopes
                 ConstantUtils.mkSet [soFixConsistency])]
734 9be1ff8c Jose A. Lopes
735 9be1ff8c Jose A. Lopes
-- * Volume fields
736 9be1ff8c Jose A. Lopes
737 9be1ff8c Jose A. Lopes
vfDev :: String
738 9be1ff8c Jose A. Lopes
vfDev = "dev"
739 9be1ff8c Jose A. Lopes
740 9be1ff8c Jose A. Lopes
vfInstance :: String
741 9be1ff8c Jose A. Lopes
vfInstance = "instance"
742 9be1ff8c Jose A. Lopes
743 9be1ff8c Jose A. Lopes
vfName :: String
744 9be1ff8c Jose A. Lopes
vfName = "name"
745 9be1ff8c Jose A. Lopes
746 9be1ff8c Jose A. Lopes
vfNode :: String
747 9be1ff8c Jose A. Lopes
vfNode = "node"
748 9be1ff8c Jose A. Lopes
749 9be1ff8c Jose A. Lopes
vfPhys :: String
750 9be1ff8c Jose A. Lopes
vfPhys = "phys"
751 9be1ff8c Jose A. Lopes
752 9be1ff8c Jose A. Lopes
vfSize :: String
753 9be1ff8c Jose A. Lopes
vfSize = "size"
754 9be1ff8c Jose A. Lopes
755 9be1ff8c Jose A. Lopes
vfVg :: String
756 9be1ff8c Jose A. Lopes
vfVg = "vg"
757 9be1ff8c Jose A. Lopes
758 59bcd180 Jose A. Lopes
-- * Local disk status
759 59bcd180 Jose A. Lopes
760 59bcd180 Jose A. Lopes
ldsFaulty :: Int
761 59bcd180 Jose A. Lopes
ldsFaulty = Types.localDiskStatusToRaw DiskStatusFaulty
762 59bcd180 Jose A. Lopes
763 59bcd180 Jose A. Lopes
ldsOkay :: Int
764 59bcd180 Jose A. Lopes
ldsOkay = Types.localDiskStatusToRaw DiskStatusOk
765 59bcd180 Jose A. Lopes
766 59bcd180 Jose A. Lopes
ldsUnknown :: Int
767 59bcd180 Jose A. Lopes
ldsUnknown = Types.localDiskStatusToRaw DiskStatusUnknown
768 59bcd180 Jose A. Lopes
769 59bcd180 Jose A. Lopes
ldsNames :: Map Int String
770 59bcd180 Jose A. Lopes
ldsNames =
771 59bcd180 Jose A. Lopes
  Map.fromList [ (Types.localDiskStatusToRaw ds,
772 59bcd180 Jose A. Lopes
                  localDiskStatusName ds) | ds <- [minBound..] ]
773 59bcd180 Jose A. Lopes
774 c890f66a Jose A. Lopes
-- * Disk template types
775 85c48fbb Jose A. Lopes
776 c890f66a Jose A. Lopes
dtDiskless :: String
777 c890f66a Jose A. Lopes
dtDiskless = Types.diskTemplateToRaw DTDiskless
778 85c48fbb Jose A. Lopes
779 c890f66a Jose A. Lopes
dtFile :: String
780 c890f66a Jose A. Lopes
dtFile = Types.diskTemplateToRaw DTFile
781 85c48fbb Jose A. Lopes
782 c890f66a Jose A. Lopes
dtSharedFile :: String
783 c890f66a Jose A. Lopes
dtSharedFile = Types.diskTemplateToRaw DTSharedFile
784 85c48fbb Jose A. Lopes
785 c890f66a Jose A. Lopes
dtPlain :: String
786 c890f66a Jose A. Lopes
dtPlain = Types.diskTemplateToRaw DTPlain
787 85c48fbb Jose A. Lopes
788 c890f66a Jose A. Lopes
dtBlock :: String
789 c890f66a Jose A. Lopes
dtBlock = Types.diskTemplateToRaw DTBlock
790 85c48fbb Jose A. Lopes
791 c890f66a Jose A. Lopes
dtDrbd8 :: String
792 c890f66a Jose A. Lopes
dtDrbd8 = Types.diskTemplateToRaw DTDrbd8
793 85c48fbb Jose A. Lopes
794 c890f66a Jose A. Lopes
dtRbd :: String
795 c890f66a Jose A. Lopes
dtRbd = Types.diskTemplateToRaw DTRbd
796 85c48fbb Jose A. Lopes
797 c890f66a Jose A. Lopes
dtExt :: String
798 c890f66a Jose A. Lopes
dtExt = Types.diskTemplateToRaw DTExt
799 85c48fbb Jose A. Lopes
800 c890f66a Jose A. Lopes
-- | This is used to order determine the default disk template when
801 c890f66a Jose A. Lopes
-- the list of enabled disk templates is inferred from the current
802 c890f66a Jose A. Lopes
-- state of the cluster.  This only happens on an upgrade from a
803 c890f66a Jose A. Lopes
-- version of Ganeti that did not support the 'enabled_disk_templates'
804 c890f66a Jose A. Lopes
-- so far.
805 c890f66a Jose A. Lopes
diskTemplatePreference :: [String]
806 c890f66a Jose A. Lopes
diskTemplatePreference =
807 c890f66a Jose A. Lopes
  map Types.diskTemplateToRaw
808 c890f66a Jose A. Lopes
  [DTBlock, DTDiskless, DTDrbd8, DTExt, DTFile, DTPlain, DTRbd, DTSharedFile]
809 85c48fbb Jose A. Lopes
810 c890f66a Jose A. Lopes
diskTemplates :: FrozenSet String
811 c890f66a Jose A. Lopes
diskTemplates = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [minBound..]
812 85c48fbb Jose A. Lopes
813 c890f66a Jose A. Lopes
-- | Disk templates that are enabled by default
814 c890f66a Jose A. Lopes
defaultEnabledDiskTemplates :: [String]
815 c890f66a Jose A. Lopes
defaultEnabledDiskTemplates = map Types.diskTemplateToRaw [DTDrbd8, DTPlain]
816 85c48fbb Jose A. Lopes
817 9be1ff8c Jose A. Lopes
-- | Mapping of disk templates to storage types
818 9be1ff8c Jose A. Lopes
mapDiskTemplateStorageType :: Map String String
819 9be1ff8c Jose A. Lopes
mapDiskTemplateStorageType =
820 9be1ff8c Jose A. Lopes
  Map.fromList $
821 9be1ff8c Jose A. Lopes
  map (Types.diskTemplateToRaw *** Types.storageTypeToRaw)
822 9be1ff8c Jose A. Lopes
  [(DTBlock, StorageBlock),
823 9be1ff8c Jose A. Lopes
   (DTDrbd8, StorageLvmVg),
824 9be1ff8c Jose A. Lopes
   (DTExt, StorageExt),
825 9be1ff8c Jose A. Lopes
   (DTSharedFile, StorageFile),
826 9be1ff8c Jose A. Lopes
   (DTFile, StorageFile),
827 9be1ff8c Jose A. Lopes
   (DTDiskless, StorageDiskless),
828 9be1ff8c Jose A. Lopes
   (DTPlain, StorageLvmVg),
829 9be1ff8c Jose A. Lopes
   (DTRbd, StorageRados)]
830 9be1ff8c Jose A. Lopes
831 4c1275f9 Jose A. Lopes
-- | The set of network-mirrored disk templates
832 4c1275f9 Jose A. Lopes
dtsIntMirror :: FrozenSet String
833 4c1275f9 Jose A. Lopes
dtsIntMirror = ConstantUtils.mkSet [dtDrbd8]
834 4c1275f9 Jose A. Lopes
835 4c1275f9 Jose A. Lopes
-- | 'DTDiskless' is 'trivially' externally mirrored
836 4c1275f9 Jose A. Lopes
dtsExtMirror :: FrozenSet String
837 4c1275f9 Jose A. Lopes
dtsExtMirror =
838 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $
839 4c1275f9 Jose A. Lopes
  map Types.diskTemplateToRaw [DTDiskless, DTBlock, DTExt, DTSharedFile, DTRbd]
840 4c1275f9 Jose A. Lopes
841 4c1275f9 Jose A. Lopes
-- | The set of non-lvm-based disk templates
842 4c1275f9 Jose A. Lopes
dtsNotLvm :: FrozenSet String
843 4c1275f9 Jose A. Lopes
dtsNotLvm =
844 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $
845 4c1275f9 Jose A. Lopes
  map Types.diskTemplateToRaw
846 4c1275f9 Jose A. Lopes
  [DTSharedFile, DTDiskless, DTBlock, DTExt, DTFile, DTRbd]
847 4c1275f9 Jose A. Lopes
848 4c1275f9 Jose A. Lopes
-- | The set of disk templates which can be grown
849 4c1275f9 Jose A. Lopes
dtsGrowable :: FrozenSet String
850 4c1275f9 Jose A. Lopes
dtsGrowable =
851 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $
852 4c1275f9 Jose A. Lopes
  map Types.diskTemplateToRaw
853 4c1275f9 Jose A. Lopes
  [DTSharedFile, DTDrbd8, DTPlain, DTExt, DTFile, DTRbd]
854 4c1275f9 Jose A. Lopes
855 4c1275f9 Jose A. Lopes
-- | The set of disk templates that allow adoption
856 4c1275f9 Jose A. Lopes
dtsMayAdopt :: FrozenSet String
857 4c1275f9 Jose A. Lopes
dtsMayAdopt =
858 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTBlock, DTPlain]
859 4c1275f9 Jose A. Lopes
860 4c1275f9 Jose A. Lopes
-- | The set of disk templates that *must* use adoption
861 4c1275f9 Jose A. Lopes
dtsMustAdopt :: FrozenSet String
862 4c1275f9 Jose A. Lopes
dtsMustAdopt = ConstantUtils.mkSet [Types.diskTemplateToRaw DTBlock]
863 4c1275f9 Jose A. Lopes
864 4c1275f9 Jose A. Lopes
-- | The set of disk templates that allow migrations
865 4c1275f9 Jose A. Lopes
dtsMirrored :: FrozenSet String
866 4c1275f9 Jose A. Lopes
dtsMirrored = dtsIntMirror `ConstantUtils.union` dtsExtMirror
867 4c1275f9 Jose A. Lopes
868 4c1275f9 Jose A. Lopes
-- | The set of file based disk templates
869 4c1275f9 Jose A. Lopes
dtsFilebased :: FrozenSet String
870 4c1275f9 Jose A. Lopes
dtsFilebased =
871 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTSharedFile, DTFile]
872 4c1275f9 Jose A. Lopes
873 4c1275f9 Jose A. Lopes
-- | The set of disk templates that can be moved by copying
874 4c1275f9 Jose A. Lopes
--
875 4c1275f9 Jose A. Lopes
-- Note: a requirement is that they're not accessed externally or
876 4c1275f9 Jose A. Lopes
-- shared between nodes; in particular, sharedfile is not suitable.
877 4c1275f9 Jose A. Lopes
dtsCopyable :: FrozenSet String
878 4c1275f9 Jose A. Lopes
dtsCopyable =
879 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain, DTFile]
880 4c1275f9 Jose A. Lopes
881 4c1275f9 Jose A. Lopes
-- | The set of disk templates that are supported by exclusive_storage
882 4c1275f9 Jose A. Lopes
dtsExclStorage :: FrozenSet String
883 4c1275f9 Jose A. Lopes
dtsExclStorage = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain]
884 4c1275f9 Jose A. Lopes
885 4c1275f9 Jose A. Lopes
-- | Templates for which we don't perform checks on free space
886 4c1275f9 Jose A. Lopes
dtsNoFreeSpaceCheck :: FrozenSet String
887 4c1275f9 Jose A. Lopes
dtsNoFreeSpaceCheck =
888 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $
889 4c1275f9 Jose A. Lopes
  map Types.diskTemplateToRaw [DTExt, DTSharedFile, DTFile, DTRbd]
890 4c1275f9 Jose A. Lopes
891 4c1275f9 Jose A. Lopes
dtsBlock :: FrozenSet String
892 4c1275f9 Jose A. Lopes
dtsBlock =
893 4c1275f9 Jose A. Lopes
  ConstantUtils.mkSet $
894 4c1275f9 Jose A. Lopes
  map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt]
895 4c1275f9 Jose A. Lopes
896 fa8d6aa7 Jose A. Lopes
-- | The set of lvm-based disk templates
897 fa8d6aa7 Jose A. Lopes
dtsLvm :: FrozenSet String
898 fa8d6aa7 Jose A. Lopes
dtsLvm = diskTemplates `ConstantUtils.difference` dtsNotLvm
899 fa8d6aa7 Jose A. Lopes
900 c5539592 Jose A. Lopes
-- * Drbd
901 c5539592 Jose A. Lopes
902 c5539592 Jose A. Lopes
drbdHmacAlg :: String
903 c5539592 Jose A. Lopes
drbdHmacAlg = "md5"
904 c5539592 Jose A. Lopes
905 c5539592 Jose A. Lopes
drbdDefaultNetProtocol :: String
906 c5539592 Jose A. Lopes
drbdDefaultNetProtocol = "C"
907 c5539592 Jose A. Lopes
908 c5539592 Jose A. Lopes
drbdMigrationNetProtocol :: String
909 c5539592 Jose A. Lopes
drbdMigrationNetProtocol = "C"
910 c5539592 Jose A. Lopes
911 c5539592 Jose A. Lopes
drbdStatusFile :: String
912 c5539592 Jose A. Lopes
drbdStatusFile = "/proc/drbd"
913 c5539592 Jose A. Lopes
914 c5539592 Jose A. Lopes
-- | Size of DRBD meta block device
915 c5539592 Jose A. Lopes
drbdMetaSize :: Int
916 c5539592 Jose A. Lopes
drbdMetaSize = 128
917 c5539592 Jose A. Lopes
918 c5539592 Jose A. Lopes
-- * Drbd barrier types
919 c5539592 Jose A. Lopes
920 c5539592 Jose A. Lopes
drbdBDiskBarriers :: String
921 c5539592 Jose A. Lopes
drbdBDiskBarriers = "b"
922 c5539592 Jose A. Lopes
923 c5539592 Jose A. Lopes
drbdBDiskDrain :: String
924 c5539592 Jose A. Lopes
drbdBDiskDrain = "d"
925 c5539592 Jose A. Lopes
926 c5539592 Jose A. Lopes
drbdBDiskFlush :: String
927 c5539592 Jose A. Lopes
drbdBDiskFlush = "f"
928 c5539592 Jose A. Lopes
929 c5539592 Jose A. Lopes
drbdBNone :: String
930 c5539592 Jose A. Lopes
drbdBNone = "n"
931 c5539592 Jose A. Lopes
932 3a715da0 Jose A. Lopes
-- | Valid barrier combinations: "n" or any non-null subset of "bfd"
933 3a715da0 Jose A. Lopes
drbdValidBarrierOpt :: FrozenSet (FrozenSet String)
934 3a715da0 Jose A. Lopes
drbdValidBarrierOpt =
935 3a715da0 Jose A. Lopes
  ConstantUtils.mkSet
936 3a715da0 Jose A. Lopes
  [ ConstantUtils.mkSet [drbdBNone]
937 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskBarriers]
938 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskDrain]
939 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskFlush]
940 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskDrain, drbdBDiskFlush]
941 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskBarriers, drbdBDiskDrain]
942 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskBarriers, drbdBDiskFlush]
943 3a715da0 Jose A. Lopes
  , ConstantUtils.mkSet [drbdBDiskBarriers, drbdBDiskFlush, drbdBDiskDrain]
944 3a715da0 Jose A. Lopes
  ]
945 3a715da0 Jose A. Lopes
946 c5539592 Jose A. Lopes
-- | Rbd tool command
947 c5539592 Jose A. Lopes
rbdCmd :: String
948 c5539592 Jose A. Lopes
rbdCmd = "rbd"
949 c5539592 Jose A. Lopes
950 c890f66a Jose A. Lopes
-- * File backend driver
951 85c48fbb Jose A. Lopes
952 c890f66a Jose A. Lopes
fdBlktap :: String
953 c890f66a Jose A. Lopes
fdBlktap = Types.fileDriverToRaw FileBlktap
954 85c48fbb Jose A. Lopes
955 c890f66a Jose A. Lopes
fdLoop :: String
956 c890f66a Jose A. Lopes
fdLoop = Types.fileDriverToRaw FileLoop
957 85c48fbb Jose A. Lopes
958 ad6f2bf3 Jose A. Lopes
fileDriver :: FrozenSet String
959 ad6f2bf3 Jose A. Lopes
fileDriver =
960 ad6f2bf3 Jose A. Lopes
  ConstantUtils.mkSet $
961 ad6f2bf3 Jose A. Lopes
  map Types.fileDriverToRaw [minBound..]
962 ad6f2bf3 Jose A. Lopes
963 59bcd180 Jose A. Lopes
-- | The set of drbd-like disk types
964 e8c86ab1 Klaus Aehlig
dtsDrbd :: FrozenSet String
965 e8c86ab1 Klaus Aehlig
dtsDrbd = ConstantUtils.mkSet [Types.diskTemplateToRaw DTDrbd8]
966 59bcd180 Jose A. Lopes
967 c890f66a Jose A. Lopes
-- * Disk access mode
968 85c48fbb Jose A. Lopes
969 c890f66a Jose A. Lopes
diskRdonly :: String
970 c890f66a Jose A. Lopes
diskRdonly = Types.diskModeToRaw DiskRdOnly
971 85c48fbb Jose A. Lopes
972 c890f66a Jose A. Lopes
diskRdwr :: String
973 c890f66a Jose A. Lopes
diskRdwr = Types.diskModeToRaw DiskRdWr
974 85c48fbb Jose A. Lopes
975 c890f66a Jose A. Lopes
diskAccessSet :: FrozenSet String
976 c890f66a Jose A. Lopes
diskAccessSet = ConstantUtils.mkSet $ map Types.diskModeToRaw [minBound..]
977 85c48fbb Jose A. Lopes
978 a5450d2a Jose A. Lopes
-- * Disk replacement mode
979 a5450d2a Jose A. Lopes
980 a5450d2a Jose A. Lopes
replaceDiskAuto :: String
981 a5450d2a Jose A. Lopes
replaceDiskAuto = Types.replaceDisksModeToRaw ReplaceAuto
982 a5450d2a Jose A. Lopes
983 a5450d2a Jose A. Lopes
replaceDiskChg :: String
984 a5450d2a Jose A. Lopes
replaceDiskChg = Types.replaceDisksModeToRaw ReplaceNewSecondary
985 a5450d2a Jose A. Lopes
986 a5450d2a Jose A. Lopes
replaceDiskPri :: String
987 a5450d2a Jose A. Lopes
replaceDiskPri = Types.replaceDisksModeToRaw ReplaceOnPrimary
988 a5450d2a Jose A. Lopes
989 a5450d2a Jose A. Lopes
replaceDiskSec :: String
990 a5450d2a Jose A. Lopes
replaceDiskSec = Types.replaceDisksModeToRaw ReplaceOnSecondary
991 a5450d2a Jose A. Lopes
992 a5450d2a Jose A. Lopes
replaceModes :: FrozenSet String
993 a5450d2a Jose A. Lopes
replaceModes =
994 a5450d2a Jose A. Lopes
  ConstantUtils.mkSet $ map Types.replaceDisksModeToRaw [minBound..]
995 a5450d2a Jose A. Lopes
996 c890f66a Jose A. Lopes
-- * Instance export mode
997 85c48fbb Jose A. Lopes
998 c890f66a Jose A. Lopes
exportModeLocal :: String
999 c890f66a Jose A. Lopes
exportModeLocal = Types.exportModeToRaw ExportModeLocal
1000 85c48fbb Jose A. Lopes
1001 c890f66a Jose A. Lopes
exportModeRemote :: String
1002 c890f66a Jose A. Lopes
exportModeRemote = Types.exportModeToRaw ExportModeRemote
1003 85c48fbb Jose A. Lopes
1004 c890f66a Jose A. Lopes
exportModes :: FrozenSet String
1005 c890f66a Jose A. Lopes
exportModes = ConstantUtils.mkSet $ map Types.exportModeToRaw [minBound..]
1006 85c48fbb Jose A. Lopes
1007 c890f66a Jose A. Lopes
-- * Instance creation modes
1008 85c48fbb Jose A. Lopes
1009 c890f66a Jose A. Lopes
instanceCreate :: String
1010 c890f66a Jose A. Lopes
instanceCreate = Types.instCreateModeToRaw InstCreate
1011 85c48fbb Jose A. Lopes
1012 c890f66a Jose A. Lopes
instanceImport :: String
1013 c890f66a Jose A. Lopes
instanceImport = Types.instCreateModeToRaw InstImport
1014 85c48fbb Jose A. Lopes
1015 c890f66a Jose A. Lopes
instanceRemoteImport :: String
1016 c890f66a Jose A. Lopes
instanceRemoteImport = Types.instCreateModeToRaw InstRemoteImport
1017 85c48fbb Jose A. Lopes
1018 c890f66a Jose A. Lopes
instanceCreateModes :: FrozenSet String
1019 c890f66a Jose A. Lopes
instanceCreateModes =
1020 c890f66a Jose A. Lopes
  ConstantUtils.mkSet $ map Types.instCreateModeToRaw [minBound..]
1021 9413ef24 Jose A. Lopes
1022 6e18cc0d Jose A. Lopes
-- * Remote import/export handshake message and version
1023 6e18cc0d Jose A. Lopes
1024 6e18cc0d Jose A. Lopes
rieHandshake :: String
1025 6e18cc0d Jose A. Lopes
rieHandshake = "Hi, I'm Ganeti"
1026 6e18cc0d Jose A. Lopes
1027 6e18cc0d Jose A. Lopes
rieVersion :: Int
1028 6e18cc0d Jose A. Lopes
rieVersion = 0
1029 6e18cc0d Jose A. Lopes
1030 4c5cb91e Jose A. Lopes
-- | Remote import/export certificate validity (seconds)
1031 6e18cc0d Jose A. Lopes
rieCertValidity :: Int
1032 6e18cc0d Jose A. Lopes
rieCertValidity = 24 * 60 * 60
1033 6e18cc0d Jose A. Lopes
1034 6e18cc0d Jose A. Lopes
-- | Export only: how long to wait per connection attempt (seconds)
1035 6e18cc0d Jose A. Lopes
rieConnectAttemptTimeout :: Int
1036 6e18cc0d Jose A. Lopes
rieConnectAttemptTimeout = 20
1037 6e18cc0d Jose A. Lopes
1038 6e18cc0d Jose A. Lopes
-- | Export only: number of attempts to connect
1039 6e18cc0d Jose A. Lopes
rieConnectRetries :: Int
1040 6e18cc0d Jose A. Lopes
rieConnectRetries = 10
1041 6e18cc0d Jose A. Lopes
1042 6e18cc0d Jose A. Lopes
-- | Overall timeout for establishing connection
1043 6e18cc0d Jose A. Lopes
rieConnectTimeout :: Int
1044 6e18cc0d Jose A. Lopes
rieConnectTimeout = 180
1045 6e18cc0d Jose A. Lopes
1046 6e18cc0d Jose A. Lopes
-- | Give child process up to 5 seconds to exit after sending a signal
1047 6e18cc0d Jose A. Lopes
childLingerTimeout :: Double
1048 6e18cc0d Jose A. Lopes
childLingerTimeout = 5.0
1049 6e18cc0d Jose A. Lopes
1050 343dcda8 Jose A. Lopes
-- * Import/export config options
1051 343dcda8 Jose A. Lopes
1052 343dcda8 Jose A. Lopes
inisectBep :: String
1053 343dcda8 Jose A. Lopes
inisectBep = "backend"
1054 343dcda8 Jose A. Lopes
1055 343dcda8 Jose A. Lopes
inisectExp :: String
1056 343dcda8 Jose A. Lopes
inisectExp = "export"
1057 343dcda8 Jose A. Lopes
1058 343dcda8 Jose A. Lopes
inisectHyp :: String
1059 343dcda8 Jose A. Lopes
inisectHyp = "hypervisor"
1060 343dcda8 Jose A. Lopes
1061 343dcda8 Jose A. Lopes
inisectIns :: String
1062 343dcda8 Jose A. Lopes
inisectIns = "instance"
1063 343dcda8 Jose A. Lopes
1064 343dcda8 Jose A. Lopes
inisectOsp :: String
1065 343dcda8 Jose A. Lopes
inisectOsp = "os"
1066 343dcda8 Jose A. Lopes
1067 c890f66a Jose A. Lopes
-- * Dynamic device modification
1068 9413ef24 Jose A. Lopes
1069 c890f66a Jose A. Lopes
ddmAdd :: String
1070 c890f66a Jose A. Lopes
ddmAdd = Types.ddmFullToRaw DdmFullAdd
1071 1b2adaa6 Jose A. Lopes
1072 c890f66a Jose A. Lopes
ddmModify :: String
1073 c890f66a Jose A. Lopes
ddmModify = Types.ddmFullToRaw DdmFullModify
1074 1b2adaa6 Jose A. Lopes
1075 c890f66a Jose A. Lopes
ddmRemove :: String
1076 c890f66a Jose A. Lopes
ddmRemove = Types.ddmFullToRaw DdmFullRemove
1077 9413ef24 Jose A. Lopes
1078 c890f66a Jose A. Lopes
ddmsValues :: FrozenSet String
1079 c890f66a Jose A. Lopes
ddmsValues = ConstantUtils.mkSet [ddmAdd, ddmRemove]
1080 5867e439 Jose A. Lopes
1081 c890f66a Jose A. Lopes
ddmsValuesWithModify :: FrozenSet String
1082 c890f66a Jose A. Lopes
ddmsValuesWithModify = ConstantUtils.mkSet $ map Types.ddmFullToRaw [minBound..]
1083 5867e439 Jose A. Lopes
1084 c890f66a Jose A. Lopes
-- * Common exit codes
1085 5867e439 Jose A. Lopes
1086 c890f66a Jose A. Lopes
exitSuccess :: Int
1087 c890f66a Jose A. Lopes
exitSuccess = 0
1088 5867e439 Jose A. Lopes
1089 c890f66a Jose A. Lopes
exitFailure :: Int
1090 c890f66a Jose A. Lopes
exitFailure = ConstantUtils.exitFailure
1091 5867e439 Jose A. Lopes
1092 c890f66a Jose A. Lopes
exitNotcluster :: Int
1093 c890f66a Jose A. Lopes
exitNotcluster = 5
1094 5867e439 Jose A. Lopes
1095 c890f66a Jose A. Lopes
exitNotmaster :: Int
1096 c890f66a Jose A. Lopes
exitNotmaster = 11
1097 5867e439 Jose A. Lopes
1098 c890f66a Jose A. Lopes
exitNodesetupError :: Int
1099 c890f66a Jose A. Lopes
exitNodesetupError = 12
1100 26eca119 Jose A. Lopes
1101 c890f66a Jose A. Lopes
-- | Need user confirmation
1102 c890f66a Jose A. Lopes
exitConfirmation :: Int
1103 c890f66a Jose A. Lopes
exitConfirmation = 13
1104 85c48fbb Jose A. Lopes
1105 c890f66a Jose A. Lopes
-- | Exit code for query operations with unknown fields
1106 c890f66a Jose A. Lopes
exitUnknownField :: Int
1107 c890f66a Jose A. Lopes
exitUnknownField = 14
1108 85c48fbb Jose A. Lopes
1109 c890f66a Jose A. Lopes
-- * Tags
1110 85c48fbb Jose A. Lopes
1111 c890f66a Jose A. Lopes
tagCluster :: String
1112 c890f66a Jose A. Lopes
tagCluster = Types.tagKindToRaw TagKindCluster
1113 85c48fbb Jose A. Lopes
1114 c890f66a Jose A. Lopes
tagInstance :: String
1115 c890f66a Jose A. Lopes
tagInstance = Types.tagKindToRaw TagKindInstance
1116 85c48fbb Jose A. Lopes
1117 c890f66a Jose A. Lopes
tagNetwork :: String
1118 c890f66a Jose A. Lopes
tagNetwork = Types.tagKindToRaw TagKindNetwork
1119 85c48fbb Jose A. Lopes
1120 c890f66a Jose A. Lopes
tagNode :: String
1121 c890f66a Jose A. Lopes
tagNode = Types.tagKindToRaw TagKindNode
1122 85c48fbb Jose A. Lopes
1123 c890f66a Jose A. Lopes
tagNodegroup :: String
1124 c890f66a Jose A. Lopes
tagNodegroup = Types.tagKindToRaw TagKindGroup
1125 85c48fbb Jose A. Lopes
1126 c890f66a Jose A. Lopes
validTagTypes :: FrozenSet String
1127 c890f66a Jose A. Lopes
validTagTypes = ConstantUtils.mkSet $ map Types.tagKindToRaw [minBound..]
1128 85c48fbb Jose A. Lopes
1129 c890f66a Jose A. Lopes
maxTagLen :: Int
1130 c890f66a Jose A. Lopes
maxTagLen = 128
1131 85c48fbb Jose A. Lopes
1132 c890f66a Jose A. Lopes
maxTagsPerObj :: Int
1133 c890f66a Jose A. Lopes
maxTagsPerObj = 4096
1134 85c48fbb Jose A. Lopes
1135 b7b8ff87 Jose A. Lopes
-- * Others
1136 b7b8ff87 Jose A. Lopes
1137 b7b8ff87 Jose A. Lopes
defaultBridge :: String
1138 b7b8ff87 Jose A. Lopes
defaultBridge = "xen-br0"
1139 b7b8ff87 Jose A. Lopes
1140 b7b8ff87 Jose A. Lopes
defaultOvs :: String
1141 b7b8ff87 Jose A. Lopes
defaultOvs = "switch1"
1142 b7b8ff87 Jose A. Lopes
1143 413434a5 Jose A. Lopes
-- | 60 MiB/s, expressed in KiB/s
1144 b7b8ff87 Jose A. Lopes
classicDrbdSyncSpeed :: Int
1145 b7b8ff87 Jose A. Lopes
classicDrbdSyncSpeed = 60 * 1024
1146 b7b8ff87 Jose A. Lopes
1147 b7b8ff87 Jose A. Lopes
ip4AddressAny :: String
1148 b7b8ff87 Jose A. Lopes
ip4AddressAny = "0.0.0.0"
1149 b7b8ff87 Jose A. Lopes
1150 b7b8ff87 Jose A. Lopes
ip4AddressLocalhost :: String
1151 b7b8ff87 Jose A. Lopes
ip4AddressLocalhost = "127.0.0.1"
1152 b7b8ff87 Jose A. Lopes
1153 b7b8ff87 Jose A. Lopes
ip6AddressAny :: String
1154 b7b8ff87 Jose A. Lopes
ip6AddressAny = "::"
1155 b7b8ff87 Jose A. Lopes
1156 b7b8ff87 Jose A. Lopes
ip6AddressLocalhost :: String
1157 b7b8ff87 Jose A. Lopes
ip6AddressLocalhost = "::1"
1158 b7b8ff87 Jose A. Lopes
1159 b7b8ff87 Jose A. Lopes
ip4Version :: Int
1160 b7b8ff87 Jose A. Lopes
ip4Version = 4
1161 b7b8ff87 Jose A. Lopes
1162 b7b8ff87 Jose A. Lopes
ip6Version :: Int
1163 b7b8ff87 Jose A. Lopes
ip6Version = 6
1164 b7b8ff87 Jose A. Lopes
1165 b7b8ff87 Jose A. Lopes
validIpVersions :: FrozenSet Int
1166 b7b8ff87 Jose A. Lopes
validIpVersions = ConstantUtils.mkSet [ip4Version, ip6Version]
1167 b7b8ff87 Jose A. Lopes
1168 b7b8ff87 Jose A. Lopes
tcpPingTimeout :: Int
1169 b7b8ff87 Jose A. Lopes
tcpPingTimeout = 10
1170 b7b8ff87 Jose A. Lopes
1171 b7b8ff87 Jose A. Lopes
defaultVg :: String
1172 b7b8ff87 Jose A. Lopes
defaultVg = "xenvg"
1173 b7b8ff87 Jose A. Lopes
1174 b7b8ff87 Jose A. Lopes
defaultDrbdHelper :: String
1175 b7b8ff87 Jose A. Lopes
defaultDrbdHelper = "/bin/true"
1176 b7b8ff87 Jose A. Lopes
1177 b7b8ff87 Jose A. Lopes
minVgSize :: Int
1178 b7b8ff87 Jose A. Lopes
minVgSize = 20480
1179 b7b8ff87 Jose A. Lopes
1180 b7b8ff87 Jose A. Lopes
defaultMacPrefix :: String
1181 b7b8ff87 Jose A. Lopes
defaultMacPrefix = "aa:00:00"
1182 b7b8ff87 Jose A. Lopes
1183 4c5cb91e Jose A. Lopes
-- | Default maximum instance wait time (seconds)
1184 b7b8ff87 Jose A. Lopes
defaultShutdownTimeout :: Int
1185 b7b8ff87 Jose A. Lopes
defaultShutdownTimeout = 120
1186 b7b8ff87 Jose A. Lopes
1187 4c5cb91e Jose A. Lopes
-- | Node clock skew (seconds)
1188 61e32567 Jose A. Lopes
nodeMaxClockSkew :: Int
1189 61e32567 Jose A. Lopes
nodeMaxClockSkew = 150
1190 61e32567 Jose A. Lopes
1191 52d4f735 Jose A. Lopes
-- | Time for an intra-cluster disk transfer to wait for a connection
1192 52d4f735 Jose A. Lopes
diskTransferConnectTimeout :: Int
1193 52d4f735 Jose A. Lopes
diskTransferConnectTimeout = 60
1194 52d4f735 Jose A. Lopes
1195 3b170ad4 Jose A. Lopes
-- | Disk index separator
1196 3b170ad4 Jose A. Lopes
diskSeparator :: String
1197 3b170ad4 Jose A. Lopes
diskSeparator = AutoConf.diskSeparator
1198 3b170ad4 Jose A. Lopes
1199 cf96e711 Jose A. Lopes
ipCommandPath :: String
1200 cf96e711 Jose A. Lopes
ipCommandPath = AutoConf.ipPath
1201 cf96e711 Jose A. Lopes
1202 d7754dad Jose A. Lopes
-- | Key for job IDs in opcode result
1203 d7754dad Jose A. Lopes
jobIdsKey :: String
1204 d7754dad Jose A. Lopes
jobIdsKey = "jobs"
1205 d7754dad Jose A. Lopes
1206 d7754dad Jose A. Lopes
-- * Runparts results
1207 d7754dad Jose A. Lopes
1208 d7754dad Jose A. Lopes
runpartsErr :: Int
1209 d7754dad Jose A. Lopes
runpartsErr = 2
1210 d7754dad Jose A. Lopes
1211 d7754dad Jose A. Lopes
runpartsRun :: Int
1212 d7754dad Jose A. Lopes
runpartsRun = 1
1213 d7754dad Jose A. Lopes
1214 d7754dad Jose A. Lopes
runpartsSkip :: Int
1215 d7754dad Jose A. Lopes
runpartsSkip = 0
1216 d7754dad Jose A. Lopes
1217 d7754dad Jose A. Lopes
runpartsStatus :: [Int]
1218 d7754dad Jose A. Lopes
runpartsStatus = [runpartsErr, runpartsRun, runpartsSkip]
1219 d7754dad Jose A. Lopes
1220 d7754dad Jose A. Lopes
-- * RPC
1221 d7754dad Jose A. Lopes
1222 d7754dad Jose A. Lopes
rpcEncodingNone :: Int
1223 d7754dad Jose A. Lopes
rpcEncodingNone = 0
1224 d7754dad Jose A. Lopes
1225 d7754dad Jose A. Lopes
rpcEncodingZlibBase64 :: Int
1226 d7754dad Jose A. Lopes
rpcEncodingZlibBase64 = 1
1227 d7754dad Jose A. Lopes
1228 c03224f6 Jose A. Lopes
-- * Timeout table
1229 c03224f6 Jose A. Lopes
--
1230 c03224f6 Jose A. Lopes
-- Various time constants for the timeout table
1231 c03224f6 Jose A. Lopes
1232 c03224f6 Jose A. Lopes
rpcTmoUrgent :: Int
1233 c03224f6 Jose A. Lopes
rpcTmoUrgent = Types.rpcTimeoutToRaw Urgent
1234 c03224f6 Jose A. Lopes
1235 c03224f6 Jose A. Lopes
rpcTmoFast :: Int
1236 c03224f6 Jose A. Lopes
rpcTmoFast = Types.rpcTimeoutToRaw Fast
1237 c03224f6 Jose A. Lopes
1238 c03224f6 Jose A. Lopes
rpcTmoNormal :: Int
1239 c03224f6 Jose A. Lopes
rpcTmoNormal = Types.rpcTimeoutToRaw Normal
1240 c03224f6 Jose A. Lopes
1241 c03224f6 Jose A. Lopes
rpcTmoSlow :: Int
1242 c03224f6 Jose A. Lopes
rpcTmoSlow = Types.rpcTimeoutToRaw Slow
1243 c03224f6 Jose A. Lopes
1244 c03224f6 Jose A. Lopes
-- | 'rpcTmo_4hrs' contains an underscore to circumvent a limitation
1245 c03224f6 Jose A. Lopes
-- in the 'Ganeti.THH.deCamelCase' function and generate the correct
1246 c03224f6 Jose A. Lopes
-- Python name.
1247 c03224f6 Jose A. Lopes
rpcTmo_4hrs :: Int
1248 c03224f6 Jose A. Lopes
rpcTmo_4hrs = Types.rpcTimeoutToRaw FourHours
1249 c03224f6 Jose A. Lopes
1250 c03224f6 Jose A. Lopes
-- | 'rpcTmo_1day' contains an underscore to circumvent a limitation
1251 c03224f6 Jose A. Lopes
-- in the 'Ganeti.THH.deCamelCase' function and generate the correct
1252 c03224f6 Jose A. Lopes
-- Python name.
1253 c03224f6 Jose A. Lopes
rpcTmo_1day :: Int
1254 c03224f6 Jose A. Lopes
rpcTmo_1day = Types.rpcTimeoutToRaw OneDay
1255 c03224f6 Jose A. Lopes
1256 c03224f6 Jose A. Lopes
-- | Timeout for connecting to nodes (seconds)
1257 c03224f6 Jose A. Lopes
rpcConnectTimeout :: Int
1258 c03224f6 Jose A. Lopes
rpcConnectTimeout = 5
1259 c03224f6 Jose A. Lopes
1260 e8d4d41e Jose A. Lopes
-- OS
1261 e8d4d41e Jose A. Lopes
1262 e8d4d41e Jose A. Lopes
osScriptCreate :: String
1263 e8d4d41e Jose A. Lopes
osScriptCreate = "create"
1264 e8d4d41e Jose A. Lopes
1265 e8d4d41e Jose A. Lopes
osScriptExport :: String
1266 e8d4d41e Jose A. Lopes
osScriptExport = "export"
1267 e8d4d41e Jose A. Lopes
1268 e8d4d41e Jose A. Lopes
osScriptImport :: String
1269 e8d4d41e Jose A. Lopes
osScriptImport = "import"
1270 e8d4d41e Jose A. Lopes
1271 e8d4d41e Jose A. Lopes
osScriptRename :: String
1272 e8d4d41e Jose A. Lopes
osScriptRename = "rename"
1273 e8d4d41e Jose A. Lopes
1274 e8d4d41e Jose A. Lopes
osScriptVerify :: String
1275 e8d4d41e Jose A. Lopes
osScriptVerify = "verify"
1276 e8d4d41e Jose A. Lopes
1277 e8d4d41e Jose A. Lopes
osScripts :: [String]
1278 e8d4d41e Jose A. Lopes
osScripts = [osScriptCreate, osScriptExport, osScriptImport, osScriptRename,
1279 e8d4d41e Jose A. Lopes
             osScriptVerify]
1280 e8d4d41e Jose A. Lopes
1281 e8d4d41e Jose A. Lopes
osApiFile :: String
1282 e8d4d41e Jose A. Lopes
osApiFile = "ganeti_api_version"
1283 e8d4d41e Jose A. Lopes
1284 e8d4d41e Jose A. Lopes
osVariantsFile :: String
1285 e8d4d41e Jose A. Lopes
osVariantsFile = "variants.list"
1286 e8d4d41e Jose A. Lopes
1287 e8d4d41e Jose A. Lopes
osParametersFile :: String
1288 e8d4d41e Jose A. Lopes
osParametersFile = "parameters.list"
1289 e8d4d41e Jose A. Lopes
1290 e8d4d41e Jose A. Lopes
osValidateParameters :: String
1291 e8d4d41e Jose A. Lopes
osValidateParameters = "parameters"
1292 e8d4d41e Jose A. Lopes
1293 e8d4d41e Jose A. Lopes
osValidateCalls :: FrozenSet String
1294 e8d4d41e Jose A. Lopes
osValidateCalls = ConstantUtils.mkSet [osValidateParameters]
1295 e8d4d41e Jose A. Lopes
1296 e8d4d41e Jose A. Lopes
-- | External Storage (ES) related constants
1297 e8d4d41e Jose A. Lopes
1298 e8d4d41e Jose A. Lopes
esActionAttach :: String
1299 e8d4d41e Jose A. Lopes
esActionAttach = "attach"
1300 e8d4d41e Jose A. Lopes
1301 e8d4d41e Jose A. Lopes
esActionCreate :: String
1302 e8d4d41e Jose A. Lopes
esActionCreate = "create"
1303 e8d4d41e Jose A. Lopes
1304 e8d4d41e Jose A. Lopes
esActionDetach :: String
1305 e8d4d41e Jose A. Lopes
esActionDetach = "detach"
1306 e8d4d41e Jose A. Lopes
1307 e8d4d41e Jose A. Lopes
esActionGrow :: String
1308 e8d4d41e Jose A. Lopes
esActionGrow = "grow"
1309 e8d4d41e Jose A. Lopes
1310 e8d4d41e Jose A. Lopes
esActionRemove :: String
1311 e8d4d41e Jose A. Lopes
esActionRemove = "remove"
1312 e8d4d41e Jose A. Lopes
1313 e8d4d41e Jose A. Lopes
esActionSetinfo :: String
1314 e8d4d41e Jose A. Lopes
esActionSetinfo = "setinfo"
1315 e8d4d41e Jose A. Lopes
1316 e8d4d41e Jose A. Lopes
esActionVerify :: String
1317 e8d4d41e Jose A. Lopes
esActionVerify = "verify"
1318 e8d4d41e Jose A. Lopes
1319 e8d4d41e Jose A. Lopes
esScriptCreate :: String
1320 e8d4d41e Jose A. Lopes
esScriptCreate = esActionCreate
1321 e8d4d41e Jose A. Lopes
1322 e8d4d41e Jose A. Lopes
esScriptRemove :: String
1323 e8d4d41e Jose A. Lopes
esScriptRemove = esActionRemove
1324 e8d4d41e Jose A. Lopes
1325 e8d4d41e Jose A. Lopes
esScriptGrow :: String
1326 e8d4d41e Jose A. Lopes
esScriptGrow = esActionGrow
1327 e8d4d41e Jose A. Lopes
1328 e8d4d41e Jose A. Lopes
esScriptAttach :: String
1329 e8d4d41e Jose A. Lopes
esScriptAttach = esActionAttach
1330 e8d4d41e Jose A. Lopes
1331 e8d4d41e Jose A. Lopes
esScriptDetach :: String
1332 e8d4d41e Jose A. Lopes
esScriptDetach = esActionDetach
1333 e8d4d41e Jose A. Lopes
1334 e8d4d41e Jose A. Lopes
esScriptSetinfo :: String
1335 e8d4d41e Jose A. Lopes
esScriptSetinfo = esActionSetinfo
1336 e8d4d41e Jose A. Lopes
1337 e8d4d41e Jose A. Lopes
esScriptVerify :: String
1338 e8d4d41e Jose A. Lopes
esScriptVerify = esActionVerify
1339 e8d4d41e Jose A. Lopes
1340 e8d4d41e Jose A. Lopes
esScripts :: FrozenSet String
1341 e8d4d41e Jose A. Lopes
esScripts =
1342 e8d4d41e Jose A. Lopes
  ConstantUtils.mkSet [esScriptAttach,
1343 e8d4d41e Jose A. Lopes
                       esScriptCreate,
1344 e8d4d41e Jose A. Lopes
                       esScriptDetach,
1345 e8d4d41e Jose A. Lopes
                       esScriptGrow,
1346 e8d4d41e Jose A. Lopes
                       esScriptRemove,
1347 e8d4d41e Jose A. Lopes
                       esScriptSetinfo,
1348 e8d4d41e Jose A. Lopes
                       esScriptVerify]
1349 e8d4d41e Jose A. Lopes
1350 e8d4d41e Jose A. Lopes
esParametersFile :: String
1351 e8d4d41e Jose A. Lopes
esParametersFile = "parameters.list"
1352 e8d4d41e Jose A. Lopes
1353 ae8e7986 Jose A. Lopes
-- * Reboot types
1354 ae8e7986 Jose A. Lopes
1355 ae8e7986 Jose A. Lopes
instanceRebootSoft :: String
1356 ae8e7986 Jose A. Lopes
instanceRebootSoft = Types.rebootTypeToRaw RebootSoft
1357 ae8e7986 Jose A. Lopes
1358 ae8e7986 Jose A. Lopes
instanceRebootHard :: String
1359 ae8e7986 Jose A. Lopes
instanceRebootHard = Types.rebootTypeToRaw RebootHard
1360 ae8e7986 Jose A. Lopes
1361 ae8e7986 Jose A. Lopes
instanceRebootFull :: String
1362 ae8e7986 Jose A. Lopes
instanceRebootFull = Types.rebootTypeToRaw RebootFull
1363 ae8e7986 Jose A. Lopes
1364 ae8e7986 Jose A. Lopes
rebootTypes :: FrozenSet String
1365 ae8e7986 Jose A. Lopes
rebootTypes = ConstantUtils.mkSet $ map Types.rebootTypeToRaw [minBound..]
1366 ae8e7986 Jose A. Lopes
1367 3c2abb61 Jose A. Lopes
-- * Instance reboot behaviors
1368 3c2abb61 Jose A. Lopes
1369 3c2abb61 Jose A. Lopes
instanceRebootAllowed :: String
1370 3c2abb61 Jose A. Lopes
instanceRebootAllowed = "reboot"
1371 3c2abb61 Jose A. Lopes
1372 3c2abb61 Jose A. Lopes
instanceRebootExit :: String
1373 3c2abb61 Jose A. Lopes
instanceRebootExit = "exit"
1374 3c2abb61 Jose A. Lopes
1375 3c2abb61 Jose A. Lopes
rebootBehaviors :: [String]
1376 3c2abb61 Jose A. Lopes
rebootBehaviors = [instanceRebootAllowed, instanceRebootExit]
1377 3c2abb61 Jose A. Lopes
1378 a91d6b30 Jose A. Lopes
-- * VTypes
1379 a91d6b30 Jose A. Lopes
1380 a91d6b30 Jose A. Lopes
vtypeBool :: VType
1381 a91d6b30 Jose A. Lopes
vtypeBool = VTypeBool
1382 a91d6b30 Jose A. Lopes
1383 a91d6b30 Jose A. Lopes
vtypeInt :: VType
1384 a91d6b30 Jose A. Lopes
vtypeInt = VTypeInt
1385 a91d6b30 Jose A. Lopes
1386 a91d6b30 Jose A. Lopes
vtypeMaybeString :: VType
1387 a91d6b30 Jose A. Lopes
vtypeMaybeString = VTypeMaybeString
1388 a91d6b30 Jose A. Lopes
1389 a91d6b30 Jose A. Lopes
-- | Size in MiBs
1390 a91d6b30 Jose A. Lopes
vtypeSize :: VType
1391 a91d6b30 Jose A. Lopes
vtypeSize = VTypeSize
1392 a91d6b30 Jose A. Lopes
1393 a91d6b30 Jose A. Lopes
vtypeString :: VType
1394 a91d6b30 Jose A. Lopes
vtypeString = VTypeString
1395 a91d6b30 Jose A. Lopes
1396 a91d6b30 Jose A. Lopes
enforceableTypes :: FrozenSet VType
1397 a91d6b30 Jose A. Lopes
enforceableTypes = ConstantUtils.mkSet [minBound..]
1398 8397ffde Jose A. Lopes
1399 5c8f186c Jose A. Lopes
-- | Constant representing that the user does not specify any IP version
1400 5c8f186c Jose A. Lopes
ifaceNoIpVersionSpecified :: Int
1401 5c8f186c Jose A. Lopes
ifaceNoIpVersionSpecified = 0
1402 5c8f186c Jose A. Lopes
1403 5c8f186c Jose A. Lopes
validSerialSpeeds :: [Int]
1404 5c8f186c Jose A. Lopes
validSerialSpeeds =
1405 5c8f186c Jose A. Lopes
  [75,
1406 5c8f186c Jose A. Lopes
   110,
1407 5c8f186c Jose A. Lopes
   300,
1408 5c8f186c Jose A. Lopes
   600,
1409 5c8f186c Jose A. Lopes
   1200,
1410 5c8f186c Jose A. Lopes
   1800,
1411 5c8f186c Jose A. Lopes
   2400,
1412 5c8f186c Jose A. Lopes
   4800,
1413 5c8f186c Jose A. Lopes
   9600,
1414 5c8f186c Jose A. Lopes
   14400,
1415 5c8f186c Jose A. Lopes
   19200,
1416 5c8f186c Jose A. Lopes
   28800,
1417 5c8f186c Jose A. Lopes
   38400,
1418 5c8f186c Jose A. Lopes
   57600,
1419 5c8f186c Jose A. Lopes
   115200,
1420 5c8f186c Jose A. Lopes
   230400,
1421 5c8f186c Jose A. Lopes
   345600,
1422 5c8f186c Jose A. Lopes
   460800]
1423 5c8f186c Jose A. Lopes
1424 5c8f186c Jose A. Lopes
-- * HV parameter names (global namespace)
1425 5c8f186c Jose A. Lopes
1426 5c8f186c Jose A. Lopes
hvAcpi :: String
1427 5c8f186c Jose A. Lopes
hvAcpi = "acpi"
1428 5c8f186c Jose A. Lopes
1429 5c8f186c Jose A. Lopes
hvBlockdevPrefix :: String
1430 5c8f186c Jose A. Lopes
hvBlockdevPrefix = "blockdev_prefix"
1431 5c8f186c Jose A. Lopes
1432 5c8f186c Jose A. Lopes
hvBootloaderArgs :: String
1433 5c8f186c Jose A. Lopes
hvBootloaderArgs = "bootloader_args"
1434 5c8f186c Jose A. Lopes
1435 5c8f186c Jose A. Lopes
hvBootloaderPath :: String
1436 5c8f186c Jose A. Lopes
hvBootloaderPath = "bootloader_path"
1437 5c8f186c Jose A. Lopes
1438 5c8f186c Jose A. Lopes
hvBootOrder :: String
1439 5c8f186c Jose A. Lopes
hvBootOrder = "boot_order"
1440 5c8f186c Jose A. Lopes
1441 5c8f186c Jose A. Lopes
hvCdromImagePath :: String
1442 5c8f186c Jose A. Lopes
hvCdromImagePath = "cdrom_image_path"
1443 5c8f186c Jose A. Lopes
1444 5c8f186c Jose A. Lopes
hvCpuCap :: String
1445 5c8f186c Jose A. Lopes
hvCpuCap = "cpu_cap"
1446 5c8f186c Jose A. Lopes
1447 5c8f186c Jose A. Lopes
hvCpuCores :: String
1448 5c8f186c Jose A. Lopes
hvCpuCores = "cpu_cores"
1449 5c8f186c Jose A. Lopes
1450 5c8f186c Jose A. Lopes
hvCpuMask :: String
1451 5c8f186c Jose A. Lopes
hvCpuMask = "cpu_mask"
1452 5c8f186c Jose A. Lopes
1453 5c8f186c Jose A. Lopes
hvCpuSockets :: String
1454 5c8f186c Jose A. Lopes
hvCpuSockets = "cpu_sockets"
1455 5c8f186c Jose A. Lopes
1456 5c8f186c Jose A. Lopes
hvCpuThreads :: String
1457 5c8f186c Jose A. Lopes
hvCpuThreads = "cpu_threads"
1458 5c8f186c Jose A. Lopes
1459 5c8f186c Jose A. Lopes
hvCpuType :: String
1460 5c8f186c Jose A. Lopes
hvCpuType = "cpu_type"
1461 5c8f186c Jose A. Lopes
1462 5c8f186c Jose A. Lopes
hvCpuWeight :: String
1463 5c8f186c Jose A. Lopes
hvCpuWeight = "cpu_weight"
1464 5c8f186c Jose A. Lopes
1465 5c8f186c Jose A. Lopes
hvDeviceModel :: String
1466 5c8f186c Jose A. Lopes
hvDeviceModel = "device_model"
1467 5c8f186c Jose A. Lopes
1468 5c8f186c Jose A. Lopes
hvDiskCache :: String
1469 5c8f186c Jose A. Lopes
hvDiskCache = "disk_cache"
1470 5c8f186c Jose A. Lopes
1471 5c8f186c Jose A. Lopes
hvDiskType :: String
1472 5c8f186c Jose A. Lopes
hvDiskType = "disk_type"
1473 5c8f186c Jose A. Lopes
1474 5c8f186c Jose A. Lopes
hvInitrdPath :: String
1475 5c8f186c Jose A. Lopes
hvInitrdPath = "initrd_path"
1476 5c8f186c Jose A. Lopes
1477 5c8f186c Jose A. Lopes
hvInitScript :: String
1478 5c8f186c Jose A. Lopes
hvInitScript = "init_script"
1479 5c8f186c Jose A. Lopes
1480 5c8f186c Jose A. Lopes
hvKernelArgs :: String
1481 5c8f186c Jose A. Lopes
hvKernelArgs = "kernel_args"
1482 5c8f186c Jose A. Lopes
1483 5c8f186c Jose A. Lopes
hvKernelPath :: String
1484 5c8f186c Jose A. Lopes
hvKernelPath = "kernel_path"
1485 5c8f186c Jose A. Lopes
1486 5c8f186c Jose A. Lopes
hvKeymap :: String
1487 5c8f186c Jose A. Lopes
hvKeymap = "keymap"
1488 5c8f186c Jose A. Lopes
1489 5c8f186c Jose A. Lopes
hvKvmCdrom2ImagePath :: String
1490 5c8f186c Jose A. Lopes
hvKvmCdrom2ImagePath = "cdrom2_image_path"
1491 5c8f186c Jose A. Lopes
1492 5c8f186c Jose A. Lopes
hvKvmCdromDiskType :: String
1493 5c8f186c Jose A. Lopes
hvKvmCdromDiskType = "cdrom_disk_type"
1494 5c8f186c Jose A. Lopes
1495 5c8f186c Jose A. Lopes
hvKvmExtra :: String
1496 5c8f186c Jose A. Lopes
hvKvmExtra = "kvm_extra"
1497 5c8f186c Jose A. Lopes
1498 5c8f186c Jose A. Lopes
hvKvmFlag :: String
1499 5c8f186c Jose A. Lopes
hvKvmFlag = "kvm_flag"
1500 5c8f186c Jose A. Lopes
1501 5c8f186c Jose A. Lopes
hvKvmFloppyImagePath :: String
1502 5c8f186c Jose A. Lopes
hvKvmFloppyImagePath = "floppy_image_path"
1503 5c8f186c Jose A. Lopes
1504 5c8f186c Jose A. Lopes
hvKvmMachineVersion :: String
1505 5c8f186c Jose A. Lopes
hvKvmMachineVersion = "machine_version"
1506 5c8f186c Jose A. Lopes
1507 5c8f186c Jose A. Lopes
hvKvmPath :: String
1508 5c8f186c Jose A. Lopes
hvKvmPath = "kvm_path"
1509 5c8f186c Jose A. Lopes
1510 5c8f186c Jose A. Lopes
hvKvmSpiceAudioCompr :: String
1511 5c8f186c Jose A. Lopes
hvKvmSpiceAudioCompr = "spice_playback_compression"
1512 5c8f186c Jose A. Lopes
1513 5c8f186c Jose A. Lopes
hvKvmSpiceBind :: String
1514 5c8f186c Jose A. Lopes
hvKvmSpiceBind = "spice_bind"
1515 5c8f186c Jose A. Lopes
1516 5c8f186c Jose A. Lopes
hvKvmSpiceIpVersion :: String
1517 5c8f186c Jose A. Lopes
hvKvmSpiceIpVersion = "spice_ip_version"
1518 5c8f186c Jose A. Lopes
1519 5c8f186c Jose A. Lopes
hvKvmSpiceJpegImgCompr :: String
1520 5c8f186c Jose A. Lopes
hvKvmSpiceJpegImgCompr = "spice_jpeg_wan_compression"
1521 5c8f186c Jose A. Lopes
1522 5c8f186c Jose A. Lopes
hvKvmSpiceLosslessImgCompr :: String
1523 5c8f186c Jose A. Lopes
hvKvmSpiceLosslessImgCompr = "spice_image_compression"
1524 5c8f186c Jose A. Lopes
1525 5c8f186c Jose A. Lopes
hvKvmSpicePasswordFile :: String
1526 5c8f186c Jose A. Lopes
hvKvmSpicePasswordFile = "spice_password_file"
1527 5c8f186c Jose A. Lopes
1528 5c8f186c Jose A. Lopes
hvKvmSpiceStreamingVideoDetection :: String
1529 5c8f186c Jose A. Lopes
hvKvmSpiceStreamingVideoDetection = "spice_streaming_video"
1530 5c8f186c Jose A. Lopes
1531 5c8f186c Jose A. Lopes
hvKvmSpiceTlsCiphers :: String
1532 5c8f186c Jose A. Lopes
hvKvmSpiceTlsCiphers = "spice_tls_ciphers"
1533 5c8f186c Jose A. Lopes
1534 5c8f186c Jose A. Lopes
hvKvmSpiceUseTls :: String
1535 5c8f186c Jose A. Lopes
hvKvmSpiceUseTls = "spice_use_tls"
1536 5c8f186c Jose A. Lopes
1537 5c8f186c Jose A. Lopes
hvKvmSpiceUseVdagent :: String
1538 5c8f186c Jose A. Lopes
hvKvmSpiceUseVdagent = "spice_use_vdagent"
1539 5c8f186c Jose A. Lopes
1540 5c8f186c Jose A. Lopes
hvKvmSpiceZlibGlzImgCompr :: String
1541 5c8f186c Jose A. Lopes
hvKvmSpiceZlibGlzImgCompr = "spice_zlib_glz_wan_compression"
1542 5c8f186c Jose A. Lopes
1543 5c8f186c Jose A. Lopes
hvKvmUseChroot :: String
1544 5c8f186c Jose A. Lopes
hvKvmUseChroot = "use_chroot"
1545 5c8f186c Jose A. Lopes
1546 5c8f186c Jose A. Lopes
hvMemPath :: String
1547 5c8f186c Jose A. Lopes
hvMemPath = "mem_path"
1548 5c8f186c Jose A. Lopes
1549 5c8f186c Jose A. Lopes
hvMigrationBandwidth :: String
1550 5c8f186c Jose A. Lopes
hvMigrationBandwidth = "migration_bandwidth"
1551 5c8f186c Jose A. Lopes
1552 5c8f186c Jose A. Lopes
hvMigrationDowntime :: String
1553 5c8f186c Jose A. Lopes
hvMigrationDowntime = "migration_downtime"
1554 5c8f186c Jose A. Lopes
1555 5c8f186c Jose A. Lopes
hvMigrationMode :: String
1556 5c8f186c Jose A. Lopes
hvMigrationMode = "migration_mode"
1557 5c8f186c Jose A. Lopes
1558 5c8f186c Jose A. Lopes
hvMigrationPort :: String
1559 5c8f186c Jose A. Lopes
hvMigrationPort = "migration_port"
1560 5c8f186c Jose A. Lopes
1561 5c8f186c Jose A. Lopes
hvNicType :: String
1562 5c8f186c Jose A. Lopes
hvNicType = "nic_type"
1563 5c8f186c Jose A. Lopes
1564 5c8f186c Jose A. Lopes
hvPae :: String
1565 5c8f186c Jose A. Lopes
hvPae = "pae"
1566 5c8f186c Jose A. Lopes
1567 5c8f186c Jose A. Lopes
hvPassthrough :: String
1568 5c8f186c Jose A. Lopes
hvPassthrough = "pci_pass"
1569 5c8f186c Jose A. Lopes
1570 5c8f186c Jose A. Lopes
hvRebootBehavior :: String
1571 5c8f186c Jose A. Lopes
hvRebootBehavior = "reboot_behavior"
1572 5c8f186c Jose A. Lopes
1573 5c8f186c Jose A. Lopes
hvRootPath :: String
1574 5c8f186c Jose A. Lopes
hvRootPath = "root_path"
1575 5c8f186c Jose A. Lopes
1576 5c8f186c Jose A. Lopes
hvSecurityDomain :: String
1577 5c8f186c Jose A. Lopes
hvSecurityDomain = "security_domain"
1578 5c8f186c Jose A. Lopes
1579 5c8f186c Jose A. Lopes
hvSecurityModel :: String
1580 5c8f186c Jose A. Lopes
hvSecurityModel = "security_model"
1581 5c8f186c Jose A. Lopes
1582 5c8f186c Jose A. Lopes
hvSerialConsole :: String
1583 5c8f186c Jose A. Lopes
hvSerialConsole = "serial_console"
1584 5c8f186c Jose A. Lopes
1585 5c8f186c Jose A. Lopes
hvSerialSpeed :: String
1586 5c8f186c Jose A. Lopes
hvSerialSpeed = "serial_speed"
1587 5c8f186c Jose A. Lopes
1588 5c8f186c Jose A. Lopes
hvSoundhw :: String
1589 5c8f186c Jose A. Lopes
hvSoundhw = "soundhw"
1590 5c8f186c Jose A. Lopes
1591 5c8f186c Jose A. Lopes
hvUsbDevices :: String
1592 5c8f186c Jose A. Lopes
hvUsbDevices = "usb_devices"
1593 5c8f186c Jose A. Lopes
1594 5c8f186c Jose A. Lopes
hvUsbMouse :: String
1595 5c8f186c Jose A. Lopes
hvUsbMouse = "usb_mouse"
1596 5c8f186c Jose A. Lopes
1597 5c8f186c Jose A. Lopes
hvUseBootloader :: String
1598 5c8f186c Jose A. Lopes
hvUseBootloader = "use_bootloader"
1599 5c8f186c Jose A. Lopes
1600 5c8f186c Jose A. Lopes
hvUseLocaltime :: String
1601 5c8f186c Jose A. Lopes
hvUseLocaltime = "use_localtime"
1602 5c8f186c Jose A. Lopes
1603 5c8f186c Jose A. Lopes
hvVga :: String
1604 5c8f186c Jose A. Lopes
hvVga = "vga"
1605 5c8f186c Jose A. Lopes
1606 5c8f186c Jose A. Lopes
hvVhostNet :: String
1607 5c8f186c Jose A. Lopes
hvVhostNet = "vhost_net"
1608 5c8f186c Jose A. Lopes
1609 5c8f186c Jose A. Lopes
hvVifScript :: String
1610 5c8f186c Jose A. Lopes
hvVifScript = "vif_script"
1611 5c8f186c Jose A. Lopes
1612 5c8f186c Jose A. Lopes
hvVifType :: String
1613 5c8f186c Jose A. Lopes
hvVifType = "vif_type"
1614 5c8f186c Jose A. Lopes
1615 5c8f186c Jose A. Lopes
hvViridian :: String
1616 5c8f186c Jose A. Lopes
hvViridian = "viridian"
1617 5c8f186c Jose A. Lopes
1618 5c8f186c Jose A. Lopes
hvVncBindAddress :: String
1619 5c8f186c Jose A. Lopes
hvVncBindAddress = "vnc_bind_address"
1620 5c8f186c Jose A. Lopes
1621 5c8f186c Jose A. Lopes
hvVncPasswordFile :: String
1622 5c8f186c Jose A. Lopes
hvVncPasswordFile = "vnc_password_file"
1623 5c8f186c Jose A. Lopes
1624 5c8f186c Jose A. Lopes
hvVncTls :: String
1625 5c8f186c Jose A. Lopes
hvVncTls = "vnc_tls"
1626 5c8f186c Jose A. Lopes
1627 5c8f186c Jose A. Lopes
hvVncX509 :: String
1628 5c8f186c Jose A. Lopes
hvVncX509 = "vnc_x509_path"
1629 5c8f186c Jose A. Lopes
1630 5c8f186c Jose A. Lopes
hvVncX509Verify :: String
1631 5c8f186c Jose A. Lopes
hvVncX509Verify = "vnc_x509_verify"
1632 5c8f186c Jose A. Lopes
1633 5c8f186c Jose A. Lopes
hvVnetHdr :: String
1634 5c8f186c Jose A. Lopes
hvVnetHdr = "vnet_hdr"
1635 5c8f186c Jose A. Lopes
1636 5c8f186c Jose A. Lopes
hvXenCmd :: String
1637 5c8f186c Jose A. Lopes
hvXenCmd = "xen_cmd"
1638 5c8f186c Jose A. Lopes
1639 5c8f186c Jose A. Lopes
hvXenCpuid :: String
1640 5c8f186c Jose A. Lopes
hvXenCpuid = "cpuid"
1641 5c8f186c Jose A. Lopes
1642 5c8f186c Jose A. Lopes
hvsParameterTitles :: Map String String
1643 5c8f186c Jose A. Lopes
hvsParameterTitles =
1644 5c8f186c Jose A. Lopes
  Map.fromList
1645 5c8f186c Jose A. Lopes
  [(hvAcpi, "ACPI"),
1646 5c8f186c Jose A. Lopes
   (hvBootOrder, "Boot_order"),
1647 5c8f186c Jose A. Lopes
   (hvCdromImagePath, "CDROM_image_path"),
1648 5c8f186c Jose A. Lopes
   (hvCpuType, "cpu_type"),
1649 5c8f186c Jose A. Lopes
   (hvDiskType, "Disk_type"),
1650 5c8f186c Jose A. Lopes
   (hvInitrdPath, "Initrd_path"),
1651 5c8f186c Jose A. Lopes
   (hvKernelPath, "Kernel_path"),
1652 5c8f186c Jose A. Lopes
   (hvNicType, "NIC_type"),
1653 5c8f186c Jose A. Lopes
   (hvPae, "PAE"),
1654 5c8f186c Jose A. Lopes
   (hvPassthrough, "pci_pass"),
1655 5c8f186c Jose A. Lopes
   (hvVncBindAddress, "VNC_bind_address")]
1656 5c8f186c Jose A. Lopes
1657 4e6f1cde Hrvoje Ribicic
hvsParameters :: FrozenSet String
1658 4e6f1cde Hrvoje Ribicic
hvsParameters = ConstantUtils.mkSet $ Map.keys hvsParameterTypes
1659 4e6f1cde Hrvoje Ribicic
1660 4e6f1cde Hrvoje Ribicic
hvsParameterTypes :: Map String VType
1661 4e6f1cde Hrvoje Ribicic
hvsParameterTypes = Map.fromList
1662 4e6f1cde Hrvoje Ribicic
  [ (hvAcpi,                            VTypeBool)
1663 4e6f1cde Hrvoje Ribicic
  , (hvBlockdevPrefix,                  VTypeString)
1664 4e6f1cde Hrvoje Ribicic
  , (hvBootloaderArgs,                  VTypeString)
1665 4e6f1cde Hrvoje Ribicic
  , (hvBootloaderPath,                  VTypeString)
1666 4e6f1cde Hrvoje Ribicic
  , (hvBootOrder,                       VTypeString)
1667 4e6f1cde Hrvoje Ribicic
  , (hvCdromImagePath,                  VTypeString)
1668 4e6f1cde Hrvoje Ribicic
  , (hvCpuCap,                          VTypeInt)
1669 4e6f1cde Hrvoje Ribicic
  , (hvCpuCores,                        VTypeInt)
1670 4e6f1cde Hrvoje Ribicic
  , (hvCpuMask,                         VTypeString)
1671 4e6f1cde Hrvoje Ribicic
  , (hvCpuSockets,                      VTypeInt)
1672 4e6f1cde Hrvoje Ribicic
  , (hvCpuThreads,                      VTypeInt)
1673 4e6f1cde Hrvoje Ribicic
  , (hvCpuType,                         VTypeString)
1674 4e6f1cde Hrvoje Ribicic
  , (hvCpuWeight,                       VTypeInt)
1675 4e6f1cde Hrvoje Ribicic
  , (hvDeviceModel,                     VTypeString)
1676 4e6f1cde Hrvoje Ribicic
  , (hvDiskCache,                       VTypeString)
1677 4e6f1cde Hrvoje Ribicic
  , (hvDiskType,                        VTypeString)
1678 4e6f1cde Hrvoje Ribicic
  , (hvInitrdPath,                      VTypeString)
1679 4e6f1cde Hrvoje Ribicic
  , (hvInitScript,                      VTypeString)
1680 4e6f1cde Hrvoje Ribicic
  , (hvKernelArgs,                      VTypeString)
1681 4e6f1cde Hrvoje Ribicic
  , (hvKernelPath,                      VTypeString)
1682 4e6f1cde Hrvoje Ribicic
  , (hvKeymap,                          VTypeString)
1683 4e6f1cde Hrvoje Ribicic
  , (hvKvmCdrom2ImagePath,              VTypeString)
1684 4e6f1cde Hrvoje Ribicic
  , (hvKvmCdromDiskType,                VTypeString)
1685 4e6f1cde Hrvoje Ribicic
  , (hvKvmExtra,                        VTypeString)
1686 4e6f1cde Hrvoje Ribicic
  , (hvKvmFlag,                         VTypeString)
1687 4e6f1cde Hrvoje Ribicic
  , (hvKvmFloppyImagePath,              VTypeString)
1688 4e6f1cde Hrvoje Ribicic
  , (hvKvmMachineVersion,               VTypeString)
1689 4e6f1cde Hrvoje Ribicic
  , (hvKvmPath,                         VTypeString)
1690 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceAudioCompr,              VTypeBool)
1691 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceBind,                    VTypeString)
1692 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceIpVersion,               VTypeInt)
1693 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceJpegImgCompr,            VTypeString)
1694 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceLosslessImgCompr,        VTypeString)
1695 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpicePasswordFile,            VTypeString)
1696 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceStreamingVideoDetection, VTypeString)
1697 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceTlsCiphers,              VTypeString)
1698 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceUseTls,                  VTypeBool)
1699 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceUseVdagent,              VTypeBool)
1700 4e6f1cde Hrvoje Ribicic
  , (hvKvmSpiceZlibGlzImgCompr,         VTypeString)
1701 4e6f1cde Hrvoje Ribicic
  , (hvKvmUseChroot,                    VTypeBool)
1702 4e6f1cde Hrvoje Ribicic
  , (hvMemPath,                         VTypeString)
1703 4e6f1cde Hrvoje Ribicic
  , (hvMigrationBandwidth,              VTypeInt)
1704 4e6f1cde Hrvoje Ribicic
  , (hvMigrationDowntime,               VTypeInt)
1705 4e6f1cde Hrvoje Ribicic
  , (hvMigrationMode,                   VTypeString)
1706 4e6f1cde Hrvoje Ribicic
  , (hvMigrationPort,                   VTypeInt)
1707 4e6f1cde Hrvoje Ribicic
  , (hvNicType,                         VTypeString)
1708 4e6f1cde Hrvoje Ribicic
  , (hvPae,                             VTypeBool)
1709 4e6f1cde Hrvoje Ribicic
  , (hvPassthrough,                     VTypeString)
1710 4e6f1cde Hrvoje Ribicic
  , (hvRebootBehavior,                  VTypeString)
1711 4e6f1cde Hrvoje Ribicic
  , (hvRootPath,                        VTypeMaybeString)
1712 4e6f1cde Hrvoje Ribicic
  , (hvSecurityDomain,                  VTypeString)
1713 4e6f1cde Hrvoje Ribicic
  , (hvSecurityModel,                   VTypeString)
1714 4e6f1cde Hrvoje Ribicic
  , (hvSerialConsole,                   VTypeBool)
1715 4e6f1cde Hrvoje Ribicic
  , (hvSerialSpeed,                     VTypeInt)
1716 4e6f1cde Hrvoje Ribicic
  , (hvSoundhw,                         VTypeString)
1717 4e6f1cde Hrvoje Ribicic
  , (hvUsbDevices,                      VTypeString)
1718 4e6f1cde Hrvoje Ribicic
  , (hvUsbMouse,                        VTypeString)
1719 4e6f1cde Hrvoje Ribicic
  , (hvUseBootloader,                   VTypeBool)
1720 4e6f1cde Hrvoje Ribicic
  , (hvUseLocaltime,                    VTypeBool)
1721 4e6f1cde Hrvoje Ribicic
  , (hvVga,                             VTypeString)
1722 4e6f1cde Hrvoje Ribicic
  , (hvVhostNet,                        VTypeBool)
1723 4e6f1cde Hrvoje Ribicic
  , (hvVifScript,                       VTypeString)
1724 4e6f1cde Hrvoje Ribicic
  , (hvVifType,                         VTypeString)
1725 4e6f1cde Hrvoje Ribicic
  , (hvViridian,                        VTypeBool)
1726 4e6f1cde Hrvoje Ribicic
  , (hvVncBindAddress,                  VTypeString)
1727 4e6f1cde Hrvoje Ribicic
  , (hvVncPasswordFile,                 VTypeString)
1728 2b4e194e Hrvoje Ribicic
  , (hvVncTls,                          VTypeBool)
1729 4e6f1cde Hrvoje Ribicic
  , (hvVncX509,                         VTypeString)
1730 4e6f1cde Hrvoje Ribicic
  , (hvVncX509Verify,                   VTypeBool)
1731 4e6f1cde Hrvoje Ribicic
  , (hvVnetHdr,                         VTypeBool)
1732 4e6f1cde Hrvoje Ribicic
  , (hvXenCmd,                          VTypeString)
1733 4e6f1cde Hrvoje Ribicic
  , (hvXenCpuid,                        VTypeString)
1734 4e6f1cde Hrvoje Ribicic
  ]
1735 4e6f1cde Hrvoje Ribicic
1736 5a7fab74 Jose A. Lopes
-- * Migration statuses
1737 5a7fab74 Jose A. Lopes
1738 5a7fab74 Jose A. Lopes
hvMigrationActive :: String
1739 5a7fab74 Jose A. Lopes
hvMigrationActive = "active"
1740 5a7fab74 Jose A. Lopes
1741 5a7fab74 Jose A. Lopes
hvMigrationCancelled :: String
1742 5a7fab74 Jose A. Lopes
hvMigrationCancelled = "cancelled"
1743 5a7fab74 Jose A. Lopes
1744 5a7fab74 Jose A. Lopes
hvMigrationCompleted :: String
1745 5a7fab74 Jose A. Lopes
hvMigrationCompleted = "completed"
1746 5a7fab74 Jose A. Lopes
1747 5a7fab74 Jose A. Lopes
hvMigrationFailed :: String
1748 5a7fab74 Jose A. Lopes
hvMigrationFailed = "failed"
1749 5a7fab74 Jose A. Lopes
1750 5a7fab74 Jose A. Lopes
hvMigrationValidStatuses :: FrozenSet String
1751 5a7fab74 Jose A. Lopes
hvMigrationValidStatuses =
1752 5a7fab74 Jose A. Lopes
  ConstantUtils.mkSet [hvMigrationActive,
1753 5a7fab74 Jose A. Lopes
                       hvMigrationCancelled,
1754 5a7fab74 Jose A. Lopes
                       hvMigrationCompleted,
1755 5a7fab74 Jose A. Lopes
                       hvMigrationFailed]
1756 5a7fab74 Jose A. Lopes
1757 5a7fab74 Jose A. Lopes
hvMigrationFailedStatuses :: FrozenSet String
1758 5a7fab74 Jose A. Lopes
hvMigrationFailedStatuses =
1759 5a7fab74 Jose A. Lopes
  ConstantUtils.mkSet [hvMigrationFailed, hvMigrationCancelled]
1760 5a7fab74 Jose A. Lopes
1761 5a7fab74 Jose A. Lopes
-- | KVM-specific statuses
1762 5a7fab74 Jose A. Lopes
--
1763 5a7fab74 Jose A. Lopes
-- FIXME: this constant seems unnecessary
1764 5a7fab74 Jose A. Lopes
hvKvmMigrationValidStatuses :: FrozenSet String
1765 5a7fab74 Jose A. Lopes
hvKvmMigrationValidStatuses = hvMigrationValidStatuses
1766 5a7fab74 Jose A. Lopes
1767 5a7fab74 Jose A. Lopes
-- | Node info keys
1768 5a7fab74 Jose A. Lopes
hvNodeinfoKeyVersion :: String
1769 5a7fab74 Jose A. Lopes
hvNodeinfoKeyVersion = "hv_version"
1770 5a7fab74 Jose A. Lopes
1771 5a7fab74 Jose A. Lopes
-- * Hypervisor state
1772 5a7fab74 Jose A. Lopes
1773 5a7fab74 Jose A. Lopes
hvstCpuNode :: String
1774 5a7fab74 Jose A. Lopes
hvstCpuNode = "cpu_node"
1775 5a7fab74 Jose A. Lopes
1776 5a7fab74 Jose A. Lopes
hvstCpuTotal :: String
1777 5a7fab74 Jose A. Lopes
hvstCpuTotal = "cpu_total"
1778 5a7fab74 Jose A. Lopes
1779 5a7fab74 Jose A. Lopes
hvstMemoryHv :: String
1780 5a7fab74 Jose A. Lopes
hvstMemoryHv = "mem_hv"
1781 5a7fab74 Jose A. Lopes
1782 5a7fab74 Jose A. Lopes
hvstMemoryNode :: String
1783 5a7fab74 Jose A. Lopes
hvstMemoryNode = "mem_node"
1784 5a7fab74 Jose A. Lopes
1785 5a7fab74 Jose A. Lopes
hvstMemoryTotal :: String
1786 5a7fab74 Jose A. Lopes
hvstMemoryTotal = "mem_total"
1787 5a7fab74 Jose A. Lopes
1788 5a7fab74 Jose A. Lopes
hvstsParameters :: FrozenSet String
1789 5a7fab74 Jose A. Lopes
hvstsParameters =
1790 5a7fab74 Jose A. Lopes
  ConstantUtils.mkSet [hvstCpuNode,
1791 5a7fab74 Jose A. Lopes
                       hvstCpuTotal,
1792 5a7fab74 Jose A. Lopes
                       hvstMemoryHv,
1793 5a7fab74 Jose A. Lopes
                       hvstMemoryNode,
1794 5a7fab74 Jose A. Lopes
                       hvstMemoryTotal]
1795 5a7fab74 Jose A. Lopes
1796 5a7fab74 Jose A. Lopes
hvstDefaults :: Map String Int
1797 5a7fab74 Jose A. Lopes
hvstDefaults =
1798 5a7fab74 Jose A. Lopes
  Map.fromList
1799 5a7fab74 Jose A. Lopes
  [(hvstCpuNode, 1),
1800 5a7fab74 Jose A. Lopes
   (hvstCpuTotal, 1),
1801 5a7fab74 Jose A. Lopes
   (hvstMemoryHv, 0),
1802 5a7fab74 Jose A. Lopes
   (hvstMemoryTotal, 0),
1803 5a7fab74 Jose A. Lopes
   (hvstMemoryNode, 0)]
1804 5a7fab74 Jose A. Lopes
1805 5a7fab74 Jose A. Lopes
hvstsParameterTypes :: Map String VType
1806 5a7fab74 Jose A. Lopes
hvstsParameterTypes =
1807 5a7fab74 Jose A. Lopes
  Map.fromList [(hvstMemoryTotal, VTypeInt),
1808 5a7fab74 Jose A. Lopes
                (hvstMemoryNode, VTypeInt),
1809 5a7fab74 Jose A. Lopes
                (hvstMemoryHv, VTypeInt),
1810 5a7fab74 Jose A. Lopes
                (hvstCpuTotal, VTypeInt),
1811 5a7fab74 Jose A. Lopes
                (hvstCpuNode, VTypeInt)]
1812 5a7fab74 Jose A. Lopes
1813 5a7fab74 Jose A. Lopes
-- * Disk state
1814 5a7fab74 Jose A. Lopes
1815 5a7fab74 Jose A. Lopes
dsDiskOverhead :: String
1816 5a7fab74 Jose A. Lopes
dsDiskOverhead = "disk_overhead"
1817 5a7fab74 Jose A. Lopes
1818 5a7fab74 Jose A. Lopes
dsDiskReserved :: String
1819 5a7fab74 Jose A. Lopes
dsDiskReserved = "disk_reserved"
1820 5a7fab74 Jose A. Lopes
1821 5a7fab74 Jose A. Lopes
dsDiskTotal :: String
1822 5a7fab74 Jose A. Lopes
dsDiskTotal = "disk_total"
1823 5a7fab74 Jose A. Lopes
1824 5a7fab74 Jose A. Lopes
dsDefaults :: Map String Int
1825 5a7fab74 Jose A. Lopes
dsDefaults =
1826 5a7fab74 Jose A. Lopes
  Map.fromList
1827 5a7fab74 Jose A. Lopes
  [(dsDiskTotal, 0),
1828 5a7fab74 Jose A. Lopes
   (dsDiskReserved, 0),
1829 5a7fab74 Jose A. Lopes
   (dsDiskOverhead, 0)]
1830 5a7fab74 Jose A. Lopes
1831 5a7fab74 Jose A. Lopes
dssParameterTypes :: Map String VType
1832 5a7fab74 Jose A. Lopes
dssParameterTypes =
1833 5a7fab74 Jose A. Lopes
  Map.fromList [(dsDiskTotal, VTypeInt),
1834 5a7fab74 Jose A. Lopes
                (dsDiskReserved, VTypeInt),
1835 5a7fab74 Jose A. Lopes
                (dsDiskOverhead, VTypeInt)]
1836 5a7fab74 Jose A. Lopes
1837 5a7fab74 Jose A. Lopes
dssParameters :: FrozenSet String
1838 5a7fab74 Jose A. Lopes
dssParameters =
1839 5a7fab74 Jose A. Lopes
  ConstantUtils.mkSet [dsDiskTotal, dsDiskReserved, dsDiskOverhead]
1840 5a7fab74 Jose A. Lopes
1841 5a7fab74 Jose A. Lopes
dsValidTypes :: FrozenSet String
1842 5a7fab74 Jose A. Lopes
dsValidTypes = ConstantUtils.mkSet [Types.diskTemplateToRaw DTPlain]
1843 5a7fab74 Jose A. Lopes
1844 8eb80cb3 Jose A. Lopes
-- Backend parameter names
1845 8eb80cb3 Jose A. Lopes
1846 8eb80cb3 Jose A. Lopes
beAlwaysFailover :: String
1847 8eb80cb3 Jose A. Lopes
beAlwaysFailover = "always_failover"
1848 8eb80cb3 Jose A. Lopes
1849 8eb80cb3 Jose A. Lopes
beAutoBalance :: String
1850 8eb80cb3 Jose A. Lopes
beAutoBalance = "auto_balance"
1851 8eb80cb3 Jose A. Lopes
1852 8eb80cb3 Jose A. Lopes
beMaxmem :: String
1853 8eb80cb3 Jose A. Lopes
beMaxmem = "maxmem"
1854 8eb80cb3 Jose A. Lopes
1855 8eb80cb3 Jose A. Lopes
-- | Deprecated and replaced by max and min mem
1856 8eb80cb3 Jose A. Lopes
beMemory :: String
1857 8eb80cb3 Jose A. Lopes
beMemory = "memory"
1858 8eb80cb3 Jose A. Lopes
1859 8eb80cb3 Jose A. Lopes
beMinmem :: String
1860 8eb80cb3 Jose A. Lopes
beMinmem = "minmem"
1861 8eb80cb3 Jose A. Lopes
1862 8eb80cb3 Jose A. Lopes
beSpindleUse :: String
1863 8eb80cb3 Jose A. Lopes
beSpindleUse = "spindle_use"
1864 8eb80cb3 Jose A. Lopes
1865 8eb80cb3 Jose A. Lopes
beVcpus :: String
1866 8eb80cb3 Jose A. Lopes
beVcpus = "vcpus"
1867 8eb80cb3 Jose A. Lopes
1868 8eb80cb3 Jose A. Lopes
besParameterTypes :: Map String VType
1869 8eb80cb3 Jose A. Lopes
besParameterTypes =
1870 8eb80cb3 Jose A. Lopes
  Map.fromList [(beAlwaysFailover, VTypeBool),
1871 8eb80cb3 Jose A. Lopes
                (beAutoBalance, VTypeBool),
1872 8eb80cb3 Jose A. Lopes
                (beMaxmem, VTypeSize),
1873 8eb80cb3 Jose A. Lopes
                (beMinmem, VTypeSize),
1874 8eb80cb3 Jose A. Lopes
                (beSpindleUse, VTypeInt),
1875 8eb80cb3 Jose A. Lopes
                (beVcpus, VTypeInt)]
1876 8eb80cb3 Jose A. Lopes
1877 8eb80cb3 Jose A. Lopes
besParameterTitles :: Map String String
1878 8eb80cb3 Jose A. Lopes
besParameterTitles =
1879 8eb80cb3 Jose A. Lopes
  Map.fromList [(beAutoBalance, "Auto_balance"),
1880 8eb80cb3 Jose A. Lopes
                (beMinmem, "ConfigMinMem"),
1881 8eb80cb3 Jose A. Lopes
                (beVcpus, "ConfigVCPUs"),
1882 8eb80cb3 Jose A. Lopes
                (beMaxmem, "ConfigMaxMem")]
1883 8eb80cb3 Jose A. Lopes
1884 8eb80cb3 Jose A. Lopes
besParameterCompat :: Map String VType
1885 8eb80cb3 Jose A. Lopes
besParameterCompat = Map.insert beMemory VTypeSize besParameterTypes
1886 8eb80cb3 Jose A. Lopes
1887 8eb80cb3 Jose A. Lopes
besParameters :: FrozenSet String
1888 8eb80cb3 Jose A. Lopes
besParameters =
1889 8eb80cb3 Jose A. Lopes
  ConstantUtils.mkSet [beAlwaysFailover,
1890 8eb80cb3 Jose A. Lopes
                       beAutoBalance,
1891 8eb80cb3 Jose A. Lopes
                       beMaxmem,
1892 8eb80cb3 Jose A. Lopes
                       beMinmem,
1893 8eb80cb3 Jose A. Lopes
                       beSpindleUse,
1894 8eb80cb3 Jose A. Lopes
                       beVcpus]
1895 8eb80cb3 Jose A. Lopes
1896 8397ffde Jose A. Lopes
-- | Instance specs
1897 8397ffde Jose A. Lopes
--
1898 8397ffde Jose A. Lopes
-- FIXME: these should be associated with 'Ganeti.HTools.Types.ISpec'
1899 8397ffde Jose A. Lopes
1900 8397ffde Jose A. Lopes
ispecMemSize :: String
1901 8397ffde Jose A. Lopes
ispecMemSize = ConstantUtils.ispecMemSize
1902 8397ffde Jose A. Lopes
1903 8397ffde Jose A. Lopes
ispecCpuCount :: String
1904 8397ffde Jose A. Lopes
ispecCpuCount = ConstantUtils.ispecCpuCount
1905 8397ffde Jose A. Lopes
1906 8397ffde Jose A. Lopes
ispecDiskCount :: String
1907 8397ffde Jose A. Lopes
ispecDiskCount = ConstantUtils.ispecDiskCount
1908 8397ffde Jose A. Lopes
1909 8397ffde Jose A. Lopes
ispecDiskSize :: String
1910 8397ffde Jose A. Lopes
ispecDiskSize = ConstantUtils.ispecDiskSize
1911 8397ffde Jose A. Lopes
1912 8397ffde Jose A. Lopes
ispecNicCount :: String
1913 8397ffde Jose A. Lopes
ispecNicCount = ConstantUtils.ispecNicCount
1914 8397ffde Jose A. Lopes
1915 8397ffde Jose A. Lopes
ispecSpindleUse :: String
1916 8397ffde Jose A. Lopes
ispecSpindleUse = ConstantUtils.ispecSpindleUse
1917 8397ffde Jose A. Lopes
1918 8397ffde Jose A. Lopes
ispecsParameterTypes :: Map String VType
1919 8397ffde Jose A. Lopes
ispecsParameterTypes =
1920 8397ffde Jose A. Lopes
  Map.fromList
1921 8397ffde Jose A. Lopes
  [(ConstantUtils.ispecDiskSize, VTypeInt),
1922 8397ffde Jose A. Lopes
   (ConstantUtils.ispecCpuCount, VTypeInt),
1923 8397ffde Jose A. Lopes
   (ConstantUtils.ispecSpindleUse, VTypeInt),
1924 8397ffde Jose A. Lopes
   (ConstantUtils.ispecMemSize, VTypeInt),
1925 8397ffde Jose A. Lopes
   (ConstantUtils.ispecNicCount, VTypeInt),
1926 8397ffde Jose A. Lopes
   (ConstantUtils.ispecDiskCount, VTypeInt)]
1927 8397ffde Jose A. Lopes
1928 8397ffde Jose A. Lopes
ispecsParameters :: FrozenSet String
1929 8397ffde Jose A. Lopes
ispecsParameters =
1930 8397ffde Jose A. Lopes
  ConstantUtils.mkSet [ConstantUtils.ispecCpuCount,
1931 8397ffde Jose A. Lopes
                       ConstantUtils.ispecDiskCount,
1932 8397ffde Jose A. Lopes
                       ConstantUtils.ispecDiskSize,
1933 8397ffde Jose A. Lopes
                       ConstantUtils.ispecMemSize,
1934 8397ffde Jose A. Lopes
                       ConstantUtils.ispecNicCount,
1935 8397ffde Jose A. Lopes
                       ConstantUtils.ispecSpindleUse]
1936 8397ffde Jose A. Lopes
1937 8397ffde Jose A. Lopes
ispecsMinmax :: String
1938 8397ffde Jose A. Lopes
ispecsMinmax = ConstantUtils.ispecsMinmax
1939 8397ffde Jose A. Lopes
1940 8397ffde Jose A. Lopes
ispecsMax :: String
1941 8397ffde Jose A. Lopes
ispecsMax = "max"
1942 8397ffde Jose A. Lopes
1943 8397ffde Jose A. Lopes
ispecsMin :: String
1944 8397ffde Jose A. Lopes
ispecsMin = "min"
1945 8397ffde Jose A. Lopes
1946 8397ffde Jose A. Lopes
ispecsStd :: String
1947 8397ffde Jose A. Lopes
ispecsStd = ConstantUtils.ispecsStd
1948 8397ffde Jose A. Lopes
1949 8397ffde Jose A. Lopes
ipolicyDts :: String
1950 8397ffde Jose A. Lopes
ipolicyDts = ConstantUtils.ipolicyDts
1951 8397ffde Jose A. Lopes
1952 8397ffde Jose A. Lopes
ipolicyVcpuRatio :: String
1953 8397ffde Jose A. Lopes
ipolicyVcpuRatio = ConstantUtils.ipolicyVcpuRatio
1954 8397ffde Jose A. Lopes
1955 8397ffde Jose A. Lopes
ipolicySpindleRatio :: String
1956 8397ffde Jose A. Lopes
ipolicySpindleRatio = ConstantUtils.ipolicySpindleRatio
1957 8397ffde Jose A. Lopes
1958 8397ffde Jose A. Lopes
ispecsMinmaxKeys :: FrozenSet String
1959 8397ffde Jose A. Lopes
ispecsMinmaxKeys = ConstantUtils.mkSet [ispecsMax, ispecsMin]
1960 8397ffde Jose A. Lopes
1961 8397ffde Jose A. Lopes
ipolicyParameters :: FrozenSet String
1962 8397ffde Jose A. Lopes
ipolicyParameters =
1963 8397ffde Jose A. Lopes
  ConstantUtils.mkSet [ConstantUtils.ipolicyVcpuRatio,
1964 8397ffde Jose A. Lopes
                       ConstantUtils.ipolicySpindleRatio]
1965 8397ffde Jose A. Lopes
1966 8397ffde Jose A. Lopes
ipolicyAllKeys :: FrozenSet String
1967 8397ffde Jose A. Lopes
ipolicyAllKeys =
1968 8397ffde Jose A. Lopes
  ConstantUtils.union ipolicyParameters $
1969 8397ffde Jose A. Lopes
  ConstantUtils.mkSet [ConstantUtils.ipolicyDts,
1970 8397ffde Jose A. Lopes
                       ConstantUtils.ispecsMinmax,
1971 8397ffde Jose A. Lopes
                       ispecsStd]
1972 8397ffde Jose A. Lopes
1973 ecf43dcb Jose A. Lopes
-- | Node parameter names
1974 ecf43dcb Jose A. Lopes
1975 ecf43dcb Jose A. Lopes
ndExclusiveStorage :: String
1976 ecf43dcb Jose A. Lopes
ndExclusiveStorage = "exclusive_storage"
1977 ecf43dcb Jose A. Lopes
1978 ecf43dcb Jose A. Lopes
ndOobProgram :: String
1979 ecf43dcb Jose A. Lopes
ndOobProgram = "oob_program"
1980 ecf43dcb Jose A. Lopes
1981 ecf43dcb Jose A. Lopes
ndSpindleCount :: String
1982 ecf43dcb Jose A. Lopes
ndSpindleCount = "spindle_count"
1983 ecf43dcb Jose A. Lopes
1984 ecf43dcb Jose A. Lopes
ndOvs :: String
1985 ecf43dcb Jose A. Lopes
ndOvs = "ovs"
1986 ecf43dcb Jose A. Lopes
1987 ecf43dcb Jose A. Lopes
ndOvsLink :: String
1988 ecf43dcb Jose A. Lopes
ndOvsLink = "ovs_link"
1989 ecf43dcb Jose A. Lopes
1990 ecf43dcb Jose A. Lopes
ndOvsName :: String
1991 ecf43dcb Jose A. Lopes
ndOvsName = "ovs_name"
1992 ecf43dcb Jose A. Lopes
1993 ecf43dcb Jose A. Lopes
ndsParameterTypes :: Map String VType
1994 ecf43dcb Jose A. Lopes
ndsParameterTypes =
1995 ecf43dcb Jose A. Lopes
  Map.fromList
1996 ecf43dcb Jose A. Lopes
  [(ndExclusiveStorage, VTypeBool),
1997 ecf43dcb Jose A. Lopes
   (ndOobProgram, VTypeString),
1998 ecf43dcb Jose A. Lopes
   (ndOvs, VTypeBool),
1999 ecf43dcb Jose A. Lopes
   (ndOvsLink, VTypeMaybeString),
2000 ecf43dcb Jose A. Lopes
   (ndOvsName, VTypeMaybeString),
2001 ecf43dcb Jose A. Lopes
   (ndSpindleCount, VTypeInt)]
2002 ecf43dcb Jose A. Lopes
2003 ecf43dcb Jose A. Lopes
ndsParameters :: FrozenSet String
2004 ecf43dcb Jose A. Lopes
ndsParameters = ConstantUtils.mkSet (Map.keys ndsParameterTypes)
2005 ecf43dcb Jose A. Lopes
2006 ecf43dcb Jose A. Lopes
ndsParameterTitles :: Map String String
2007 ecf43dcb Jose A. Lopes
ndsParameterTitles =
2008 ecf43dcb Jose A. Lopes
  Map.fromList
2009 ecf43dcb Jose A. Lopes
  [(ndExclusiveStorage, "ExclusiveStorage"),
2010 ecf43dcb Jose A. Lopes
   (ndOobProgram, "OutOfBandProgram"),
2011 ecf43dcb Jose A. Lopes
   (ndOvs, "OpenvSwitch"),
2012 ecf43dcb Jose A. Lopes
   (ndOvsLink, "OpenvSwitchLink"),
2013 ecf43dcb Jose A. Lopes
   (ndOvsName, "OpenvSwitchName"),
2014 ecf43dcb Jose A. Lopes
   (ndSpindleCount, "SpindleCount")]
2015 ecf43dcb Jose A. Lopes
2016 8eb80cb3 Jose A. Lopes
-- * Logical Disks parameters
2017 8eb80cb3 Jose A. Lopes
2018 8eb80cb3 Jose A. Lopes
ldpAccess :: String
2019 8eb80cb3 Jose A. Lopes
ldpAccess = "access"
2020 8eb80cb3 Jose A. Lopes
2021 8eb80cb3 Jose A. Lopes
ldpBarriers :: String
2022 8eb80cb3 Jose A. Lopes
ldpBarriers = "disabled-barriers"
2023 8eb80cb3 Jose A. Lopes
2024 8eb80cb3 Jose A. Lopes
ldpDefaultMetavg :: String
2025 8eb80cb3 Jose A. Lopes
ldpDefaultMetavg = "default-metavg"
2026 8eb80cb3 Jose A. Lopes
2027 8eb80cb3 Jose A. Lopes
ldpDelayTarget :: String
2028 8eb80cb3 Jose A. Lopes
ldpDelayTarget = "c-delay-target"
2029 8eb80cb3 Jose A. Lopes
2030 8eb80cb3 Jose A. Lopes
ldpDiskCustom :: String
2031 8eb80cb3 Jose A. Lopes
ldpDiskCustom = "disk-custom"
2032 8eb80cb3 Jose A. Lopes
2033 8eb80cb3 Jose A. Lopes
ldpDynamicResync :: String
2034 8eb80cb3 Jose A. Lopes
ldpDynamicResync = "dynamic-resync"
2035 3b170ad4 Jose A. Lopes
2036 8eb80cb3 Jose A. Lopes
ldpFillTarget :: String
2037 8eb80cb3 Jose A. Lopes
ldpFillTarget = "c-fill-target"
2038 85c48fbb Jose A. Lopes
2039 8eb80cb3 Jose A. Lopes
ldpMaxRate :: String
2040 8eb80cb3 Jose A. Lopes
ldpMaxRate = "c-max-rate"
2041 85c48fbb Jose A. Lopes
2042 8eb80cb3 Jose A. Lopes
ldpMinRate :: String
2043 8eb80cb3 Jose A. Lopes
ldpMinRate = "c-min-rate"
2044 85c48fbb Jose A. Lopes
2045 8eb80cb3 Jose A. Lopes
ldpNetCustom :: String
2046 8eb80cb3 Jose A. Lopes
ldpNetCustom = "net-custom"
2047 85c48fbb Jose A. Lopes
2048 8eb80cb3 Jose A. Lopes
ldpNoMetaFlush :: String
2049 8eb80cb3 Jose A. Lopes
ldpNoMetaFlush = "disable-meta-flush"
2050 8eb80cb3 Jose A. Lopes
2051 8eb80cb3 Jose A. Lopes
ldpPlanAhead :: String
2052 8eb80cb3 Jose A. Lopes
ldpPlanAhead = "c-plan-ahead"
2053 8eb80cb3 Jose A. Lopes
2054 8eb80cb3 Jose A. Lopes
ldpPool :: String
2055 8eb80cb3 Jose A. Lopes
ldpPool = "pool"
2056 8eb80cb3 Jose A. Lopes
2057 8eb80cb3 Jose A. Lopes
ldpProtocol :: String
2058 8eb80cb3 Jose A. Lopes
ldpProtocol = "protocol"
2059 8eb80cb3 Jose A. Lopes
2060 8eb80cb3 Jose A. Lopes
ldpResyncRate :: String
2061 8eb80cb3 Jose A. Lopes
ldpResyncRate = "resync-rate"
2062 8eb80cb3 Jose A. Lopes
2063 8eb80cb3 Jose A. Lopes
ldpStripes :: String
2064 8eb80cb3 Jose A. Lopes
ldpStripes = "stripes"
2065 8eb80cb3 Jose A. Lopes
2066 8eb80cb3 Jose A. Lopes
diskLdTypes :: Map String VType
2067 8eb80cb3 Jose A. Lopes
diskLdTypes =
2068 8eb80cb3 Jose A. Lopes
  Map.fromList
2069 8eb80cb3 Jose A. Lopes
  [(ldpAccess, VTypeString),
2070 8eb80cb3 Jose A. Lopes
   (ldpResyncRate, VTypeInt),
2071 8eb80cb3 Jose A. Lopes
   (ldpStripes, VTypeInt),
2072 8eb80cb3 Jose A. Lopes
   (ldpBarriers, VTypeString),
2073 8eb80cb3 Jose A. Lopes
   (ldpNoMetaFlush, VTypeBool),
2074 8eb80cb3 Jose A. Lopes
   (ldpDefaultMetavg, VTypeString),
2075 8eb80cb3 Jose A. Lopes
   (ldpDiskCustom, VTypeString),
2076 8eb80cb3 Jose A. Lopes
   (ldpNetCustom, VTypeString),
2077 8eb80cb3 Jose A. Lopes
   (ldpProtocol, VTypeString),
2078 8eb80cb3 Jose A. Lopes
   (ldpDynamicResync, VTypeBool),
2079 8eb80cb3 Jose A. Lopes
   (ldpPlanAhead, VTypeInt),
2080 8eb80cb3 Jose A. Lopes
   (ldpFillTarget, VTypeInt),
2081 8eb80cb3 Jose A. Lopes
   (ldpDelayTarget, VTypeInt),
2082 8eb80cb3 Jose A. Lopes
   (ldpMaxRate, VTypeInt),
2083 8eb80cb3 Jose A. Lopes
   (ldpMinRate, VTypeInt),
2084 8eb80cb3 Jose A. Lopes
   (ldpPool, VTypeString)]
2085 8eb80cb3 Jose A. Lopes
2086 8eb80cb3 Jose A. Lopes
diskLdParameters :: FrozenSet String
2087 8eb80cb3 Jose A. Lopes
diskLdParameters = ConstantUtils.mkSet (Map.keys diskLdTypes)
2088 85c48fbb Jose A. Lopes
2089 ec321549 Jose A. Lopes
-- * Disk template parameters
2090 ec321549 Jose A. Lopes
--
2091 ec321549 Jose A. Lopes
-- Disk template parameters can be set/changed by the user via
2092 ec321549 Jose A. Lopes
-- gnt-cluster and gnt-group)
2093 ec321549 Jose A. Lopes
2094 ec321549 Jose A. Lopes
drbdResyncRate :: String
2095 ec321549 Jose A. Lopes
drbdResyncRate = "resync-rate"
2096 ec321549 Jose A. Lopes
2097 ec321549 Jose A. Lopes
drbdDataStripes :: String
2098 ec321549 Jose A. Lopes
drbdDataStripes = "data-stripes"
2099 ec321549 Jose A. Lopes
2100 ec321549 Jose A. Lopes
drbdMetaStripes :: String
2101 ec321549 Jose A. Lopes
drbdMetaStripes = "meta-stripes"
2102 ec321549 Jose A. Lopes
2103 ec321549 Jose A. Lopes
drbdDiskBarriers :: String
2104 ec321549 Jose A. Lopes
drbdDiskBarriers = "disk-barriers"
2105 ec321549 Jose A. Lopes
2106 ec321549 Jose A. Lopes
drbdMetaBarriers :: String
2107 ec321549 Jose A. Lopes
drbdMetaBarriers = "meta-barriers"
2108 ec321549 Jose A. Lopes
2109 ec321549 Jose A. Lopes
drbdDefaultMetavg :: String
2110 ec321549 Jose A. Lopes
drbdDefaultMetavg = "metavg"
2111 ec321549 Jose A. Lopes
2112 ec321549 Jose A. Lopes
drbdDiskCustom :: String
2113 ec321549 Jose A. Lopes
drbdDiskCustom = "disk-custom"
2114 ec321549 Jose A. Lopes
2115 ec321549 Jose A. Lopes
drbdNetCustom :: String
2116 ec321549 Jose A. Lopes
drbdNetCustom = "net-custom"
2117 ec321549 Jose A. Lopes
2118 ec321549 Jose A. Lopes
drbdProtocol :: String
2119 ec321549 Jose A. Lopes
drbdProtocol = "protocol"
2120 ec321549 Jose A. Lopes
2121 ec321549 Jose A. Lopes
drbdDynamicResync :: String
2122 ec321549 Jose A. Lopes
drbdDynamicResync = "dynamic-resync"
2123 ec321549 Jose A. Lopes
2124 ec321549 Jose A. Lopes
drbdPlanAhead :: String
2125 ec321549 Jose A. Lopes
drbdPlanAhead = "c-plan-ahead"
2126 ec321549 Jose A. Lopes
2127 ec321549 Jose A. Lopes
drbdFillTarget :: String
2128 ec321549 Jose A. Lopes
drbdFillTarget = "c-fill-target"
2129 ec321549 Jose A. Lopes
2130 ec321549 Jose A. Lopes
drbdDelayTarget :: String
2131 ec321549 Jose A. Lopes
drbdDelayTarget = "c-delay-target"
2132 ec321549 Jose A. Lopes
2133 ec321549 Jose A. Lopes
drbdMaxRate :: String
2134 ec321549 Jose A. Lopes
drbdMaxRate = "c-max-rate"
2135 ec321549 Jose A. Lopes
2136 ec321549 Jose A. Lopes
drbdMinRate :: String
2137 ec321549 Jose A. Lopes
drbdMinRate = "c-min-rate"
2138 ec321549 Jose A. Lopes
2139 ec321549 Jose A. Lopes
lvStripes :: String
2140 ec321549 Jose A. Lopes
lvStripes = "stripes"
2141 ec321549 Jose A. Lopes
2142 ec321549 Jose A. Lopes
rbdAccess :: String
2143 ec321549 Jose A. Lopes
rbdAccess = "access"
2144 ec321549 Jose A. Lopes
2145 ec321549 Jose A. Lopes
rbdPool :: String
2146 ec321549 Jose A. Lopes
rbdPool = "pool"
2147 ec321549 Jose A. Lopes
2148 ec321549 Jose A. Lopes
diskDtTypes :: Map String VType
2149 ec321549 Jose A. Lopes
diskDtTypes =
2150 ec321549 Jose A. Lopes
  Map.fromList [(drbdResyncRate, VTypeInt),
2151 ec321549 Jose A. Lopes
                (drbdDataStripes, VTypeInt),
2152 ec321549 Jose A. Lopes
                (drbdMetaStripes, VTypeInt),
2153 ec321549 Jose A. Lopes
                (drbdDiskBarriers, VTypeString),
2154 ec321549 Jose A. Lopes
                (drbdMetaBarriers, VTypeBool),
2155 ec321549 Jose A. Lopes
                (drbdDefaultMetavg, VTypeString),
2156 ec321549 Jose A. Lopes
                (drbdDiskCustom, VTypeString),
2157 ec321549 Jose A. Lopes
                (drbdNetCustom, VTypeString),
2158 ec321549 Jose A. Lopes
                (drbdProtocol, VTypeString),
2159 ec321549 Jose A. Lopes
                (drbdDynamicResync, VTypeBool),
2160 ec321549 Jose A. Lopes
                (drbdPlanAhead, VTypeInt),
2161 ec321549 Jose A. Lopes
                (drbdFillTarget, VTypeInt),
2162 ec321549 Jose A. Lopes
                (drbdDelayTarget, VTypeInt),
2163 ec321549 Jose A. Lopes
                (drbdMaxRate, VTypeInt),
2164 ec321549 Jose A. Lopes
                (drbdMinRate, VTypeInt),
2165 ec321549 Jose A. Lopes
                (lvStripes, VTypeInt),
2166 ec321549 Jose A. Lopes
                (rbdAccess, VTypeString),
2167 ec321549 Jose A. Lopes
                (rbdPool, VTypeString)]
2168 ec321549 Jose A. Lopes
2169 ec321549 Jose A. Lopes
diskDtParameters :: FrozenSet String
2170 ec321549 Jose A. Lopes
diskDtParameters = ConstantUtils.mkSet (Map.keys diskDtTypes)
2171 ec321549 Jose A. Lopes
2172 ec321549 Jose A. Lopes
-- * Dynamic disk parameters
2173 ec321549 Jose A. Lopes
2174 ec321549 Jose A. Lopes
ddpLocalIp :: String
2175 ec321549 Jose A. Lopes
ddpLocalIp = "local-ip"
2176 ec321549 Jose A. Lopes
2177 ec321549 Jose A. Lopes
ddpRemoteIp :: String
2178 ec321549 Jose A. Lopes
ddpRemoteIp = "remote-ip"
2179 ec321549 Jose A. Lopes
2180 ec321549 Jose A. Lopes
ddpPort :: String
2181 ec321549 Jose A. Lopes
ddpPort = "port"
2182 ec321549 Jose A. Lopes
2183 ec321549 Jose A. Lopes
ddpLocalMinor :: String
2184 ec321549 Jose A. Lopes
ddpLocalMinor = "local-minor"
2185 ec321549 Jose A. Lopes
2186 ec321549 Jose A. Lopes
ddpRemoteMinor :: String
2187 ec321549 Jose A. Lopes
ddpRemoteMinor = "remote-minor"
2188 ec321549 Jose A. Lopes
2189 c890f66a Jose A. Lopes
-- * OOB supported commands
2190 85c48fbb Jose A. Lopes
2191 c890f66a Jose A. Lopes
oobPowerOn :: String
2192 c890f66a Jose A. Lopes
oobPowerOn = Types.oobCommandToRaw OobPowerOn
2193 85c48fbb Jose A. Lopes
2194 c890f66a Jose A. Lopes
oobPowerOff :: String
2195 c890f66a Jose A. Lopes
oobPowerOff = Types.oobCommandToRaw OobPowerOff
2196 85c48fbb Jose A. Lopes
2197 c890f66a Jose A. Lopes
oobPowerCycle :: String
2198 c890f66a Jose A. Lopes
oobPowerCycle = Types.oobCommandToRaw OobPowerCycle
2199 85c48fbb Jose A. Lopes
2200 c890f66a Jose A. Lopes
oobPowerStatus :: String
2201 c890f66a Jose A. Lopes
oobPowerStatus = Types.oobCommandToRaw OobPowerStatus
2202 85c48fbb Jose A. Lopes
2203 c890f66a Jose A. Lopes
oobHealth :: String
2204 c890f66a Jose A. Lopes
oobHealth = Types.oobCommandToRaw OobHealth
2205 85c48fbb Jose A. Lopes
2206 c890f66a Jose A. Lopes
oobCommands :: FrozenSet String
2207 c890f66a Jose A. Lopes
oobCommands = ConstantUtils.mkSet $ map Types.oobCommandToRaw [minBound..]
2208 85c48fbb Jose A. Lopes
2209 c890f66a Jose A. Lopes
oobPowerStatusPowered :: String
2210 c890f66a Jose A. Lopes
oobPowerStatusPowered = "powered"
2211 85c48fbb Jose A. Lopes
2212 c890f66a Jose A. Lopes
-- | 60 seconds
2213 c890f66a Jose A. Lopes
oobTimeout :: Int
2214 c890f66a Jose A. Lopes
oobTimeout = 60
2215 85c48fbb Jose A. Lopes
2216 c890f66a Jose A. Lopes
-- | 2 seconds
2217 c890f66a Jose A. Lopes
oobPowerDelay :: Double
2218 c890f66a Jose A. Lopes
oobPowerDelay = 2.0
2219 85c48fbb Jose A. Lopes
2220 c890f66a Jose A. Lopes
oobStatusCritical :: String
2221 c890f66a Jose A. Lopes
oobStatusCritical = Types.oobStatusToRaw OobStatusCritical
2222 85c48fbb Jose A. Lopes
2223 c890f66a Jose A. Lopes
oobStatusOk :: String
2224 c890f66a Jose A. Lopes
oobStatusOk = Types.oobStatusToRaw OobStatusOk
2225 85c48fbb Jose A. Lopes
2226 c890f66a Jose A. Lopes
oobStatusUnknown :: String
2227 c890f66a Jose A. Lopes
oobStatusUnknown = Types.oobStatusToRaw OobStatusUnknown
2228 85c48fbb Jose A. Lopes
2229 c890f66a Jose A. Lopes
oobStatusWarning :: String
2230 c890f66a Jose A. Lopes
oobStatusWarning = Types.oobStatusToRaw OobStatusWarning
2231 85c48fbb Jose A. Lopes
2232 c890f66a Jose A. Lopes
oobStatuses :: FrozenSet String
2233 c890f66a Jose A. Lopes
oobStatuses = ConstantUtils.mkSet $ map Types.oobStatusToRaw [minBound..]
2234 85c48fbb Jose A. Lopes
2235 649f774a Jose A. Lopes
-- | Instance Parameters Profile
2236 649f774a Jose A. Lopes
ppDefault :: String
2237 649f774a Jose A. Lopes
ppDefault = "default"
2238 649f774a Jose A. Lopes
2239 d4bc2eec Jose A. Lopes
-- * nic* constants are used inside the ganeti config
2240 85c48fbb Jose A. Lopes
2241 c890f66a Jose A. Lopes
nicLink :: String
2242 c890f66a Jose A. Lopes
nicLink = "link"
2243 85c48fbb Jose A. Lopes
2244 c890f66a Jose A. Lopes
nicMode :: String
2245 c890f66a Jose A. Lopes
nicMode = "mode"
2246 85c48fbb Jose A. Lopes
2247 c890f66a Jose A. Lopes
nicVlan :: String
2248 c890f66a Jose A. Lopes
nicVlan = "vlan"
2249 85c48fbb Jose A. Lopes
2250 d4bc2eec Jose A. Lopes
nicsParameterTypes :: Map String VType
2251 d4bc2eec Jose A. Lopes
nicsParameterTypes =
2252 d4bc2eec Jose A. Lopes
  Map.fromList [(nicMode, vtypeString),
2253 d4bc2eec Jose A. Lopes
                (nicLink, vtypeString),
2254 d4bc2eec Jose A. Lopes
                (nicVlan, vtypeMaybeString)]
2255 d4bc2eec Jose A. Lopes
2256 d4bc2eec Jose A. Lopes
nicsParameters :: FrozenSet String
2257 d4bc2eec Jose A. Lopes
nicsParameters = ConstantUtils.mkSet (Map.keys nicsParameterTypes)
2258 d4bc2eec Jose A. Lopes
2259 c890f66a Jose A. Lopes
nicModeBridged :: String
2260 c890f66a Jose A. Lopes
nicModeBridged = Types.nICModeToRaw NMBridged
2261 85c48fbb Jose A. Lopes
2262 c890f66a Jose A. Lopes
nicModeRouted :: String
2263 c890f66a Jose A. Lopes
nicModeRouted = Types.nICModeToRaw NMRouted
2264 85c48fbb Jose A. Lopes
2265 c890f66a Jose A. Lopes
nicModeOvs :: String
2266 c890f66a Jose A. Lopes
nicModeOvs = Types.nICModeToRaw NMOvs
2267 85c48fbb Jose A. Lopes
2268 c890f66a Jose A. Lopes
nicIpPool :: String
2269 c890f66a Jose A. Lopes
nicIpPool = Types.nICModeToRaw NMPool
2270 85c48fbb Jose A. Lopes
2271 c890f66a Jose A. Lopes
nicValidModes :: FrozenSet String
2272 c890f66a Jose A. Lopes
nicValidModes = ConstantUtils.mkSet $ map Types.nICModeToRaw [minBound..]
2273 85c48fbb Jose A. Lopes
2274 649f774a Jose A. Lopes
releaseAction :: String
2275 649f774a Jose A. Lopes
releaseAction = "release"
2276 649f774a Jose A. Lopes
2277 649f774a Jose A. Lopes
reserveAction :: String
2278 649f774a Jose A. Lopes
reserveAction = "reserve"
2279 649f774a Jose A. Lopes
2280 649f774a Jose A. Lopes
-- * idisk* constants are used in opcodes, to create/change disks
2281 649f774a Jose A. Lopes
2282 649f774a Jose A. Lopes
idiskAdopt :: String
2283 649f774a Jose A. Lopes
idiskAdopt = "adopt"
2284 649f774a Jose A. Lopes
2285 649f774a Jose A. Lopes
idiskMetavg :: String
2286 649f774a Jose A. Lopes
idiskMetavg = "metavg"
2287 649f774a Jose A. Lopes
2288 649f774a Jose A. Lopes
idiskMode :: String
2289 649f774a Jose A. Lopes
idiskMode = "mode"
2290 649f774a Jose A. Lopes
2291 649f774a Jose A. Lopes
idiskName :: String
2292 649f774a Jose A. Lopes
idiskName = "name"
2293 649f774a Jose A. Lopes
2294 649f774a Jose A. Lopes
idiskSize :: String
2295 649f774a Jose A. Lopes
idiskSize = "size"
2296 649f774a Jose A. Lopes
2297 649f774a Jose A. Lopes
idiskSpindles :: String
2298 649f774a Jose A. Lopes
idiskSpindles = "spindles"
2299 649f774a Jose A. Lopes
2300 649f774a Jose A. Lopes
idiskVg :: String
2301 649f774a Jose A. Lopes
idiskVg = "vg"
2302 649f774a Jose A. Lopes
2303 649f774a Jose A. Lopes
idiskProvider :: String
2304 649f774a Jose A. Lopes
idiskProvider = "provider"
2305 649f774a Jose A. Lopes
2306 649f774a Jose A. Lopes
idiskParamsTypes :: Map String VType
2307 649f774a Jose A. Lopes
idiskParamsTypes =
2308 649f774a Jose A. Lopes
  Map.fromList [(idiskSize, VTypeSize),
2309 649f774a Jose A. Lopes
                (idiskSpindles, VTypeInt),
2310 649f774a Jose A. Lopes
                (idiskMode, VTypeString),
2311 649f774a Jose A. Lopes
                (idiskAdopt, VTypeString),
2312 649f774a Jose A. Lopes
                (idiskVg, VTypeString),
2313 649f774a Jose A. Lopes
                (idiskMetavg, VTypeString),
2314 649f774a Jose A. Lopes
                (idiskProvider, VTypeString),
2315 649f774a Jose A. Lopes
                (idiskName, VTypeMaybeString)]
2316 649f774a Jose A. Lopes
2317 649f774a Jose A. Lopes
idiskParams :: FrozenSet String
2318 649f774a Jose A. Lopes
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
2319 649f774a Jose A. Lopes
2320 649f774a Jose A. Lopes
-- * inic* constants are used in opcodes, to create/change nics
2321 649f774a Jose A. Lopes
2322 649f774a Jose A. Lopes
inicBridge :: String
2323 649f774a Jose A. Lopes
inicBridge = "bridge"
2324 649f774a Jose A. Lopes
2325 649f774a Jose A. Lopes
inicIp :: String
2326 649f774a Jose A. Lopes
inicIp = "ip"
2327 649f774a Jose A. Lopes
2328 649f774a Jose A. Lopes
inicLink :: String
2329 649f774a Jose A. Lopes
inicLink = "link"
2330 649f774a Jose A. Lopes
2331 649f774a Jose A. Lopes
inicMac :: String
2332 649f774a Jose A. Lopes
inicMac = "mac"
2333 649f774a Jose A. Lopes
2334 649f774a Jose A. Lopes
inicMode :: String
2335 649f774a Jose A. Lopes
inicMode = "mode"
2336 649f774a Jose A. Lopes
2337 649f774a Jose A. Lopes
inicName :: String
2338 649f774a Jose A. Lopes
inicName = "name"
2339 649f774a Jose A. Lopes
2340 649f774a Jose A. Lopes
inicNetwork :: String
2341 649f774a Jose A. Lopes
inicNetwork = "network"
2342 649f774a Jose A. Lopes
2343 649f774a Jose A. Lopes
inicVlan :: String
2344 649f774a Jose A. Lopes
inicVlan = "vlan"
2345 649f774a Jose A. Lopes
2346 649f774a Jose A. Lopes
inicParamsTypes :: Map String VType
2347 649f774a Jose A. Lopes
inicParamsTypes =
2348 649f774a Jose A. Lopes
  Map.fromList [(inicBridge, VTypeMaybeString),
2349 649f774a Jose A. Lopes
                (inicIp, VTypeMaybeString),
2350 649f774a Jose A. Lopes
                (inicLink, VTypeString),
2351 649f774a Jose A. Lopes
                (inicMac, VTypeString),
2352 649f774a Jose A. Lopes
                (inicMode, VTypeString),
2353 649f774a Jose A. Lopes
                (inicName, VTypeMaybeString),
2354 649f774a Jose A. Lopes
                (inicNetwork, VTypeMaybeString),
2355 649f774a Jose A. Lopes
                (inicVlan, VTypeMaybeString)]
2356 649f774a Jose A. Lopes
2357 649f774a Jose A. Lopes
inicParams :: FrozenSet String
2358 649f774a Jose A. Lopes
inicParams = ConstantUtils.mkSet (Map.keys inicParamsTypes)
2359 649f774a Jose A. Lopes
2360 c890f66a Jose A. Lopes
-- * Hypervisor constants
2361 85c48fbb Jose A. Lopes
2362 c890f66a Jose A. Lopes
htXenPvm :: String
2363 c890f66a Jose A. Lopes
htXenPvm = Types.hypervisorToRaw XenPvm
2364 85c48fbb Jose A. Lopes
2365 c890f66a Jose A. Lopes
htFake :: String
2366 c890f66a Jose A. Lopes
htFake = Types.hypervisorToRaw Fake
2367 85c48fbb Jose A. Lopes
2368 c890f66a Jose A. Lopes
htXenHvm :: String
2369 c890f66a Jose A. Lopes
htXenHvm = Types.hypervisorToRaw XenHvm
2370 85c48fbb Jose A. Lopes
2371 c890f66a Jose A. Lopes
htKvm :: String
2372 c890f66a Jose A. Lopes
htKvm = Types.hypervisorToRaw Kvm
2373 85c48fbb Jose A. Lopes
2374 c890f66a Jose A. Lopes
htChroot :: String
2375 c890f66a Jose A. Lopes
htChroot = Types.hypervisorToRaw Chroot
2376 85c48fbb Jose A. Lopes
2377 c890f66a Jose A. Lopes
htLxc :: String
2378 c890f66a Jose A. Lopes
htLxc = Types.hypervisorToRaw Lxc
2379 85c48fbb Jose A. Lopes
2380 c890f66a Jose A. Lopes
hyperTypes :: FrozenSet String
2381 c890f66a Jose A. Lopes
hyperTypes = ConstantUtils.mkSet $ map Types.hypervisorToRaw [minBound..]
2382 85c48fbb Jose A. Lopes
2383 c890f66a Jose A. Lopes
htsReqPort :: FrozenSet String
2384 c890f66a Jose A. Lopes
htsReqPort = ConstantUtils.mkSet [htXenHvm, htKvm]
2385 85c48fbb Jose A. Lopes
2386 cf1f4273 Jose A. Lopes
vncBasePort :: Int
2387 cf1f4273 Jose A. Lopes
vncBasePort = 5900
2388 cf1f4273 Jose A. Lopes
2389 cf1f4273 Jose A. Lopes
vncDefaultBindAddress :: String
2390 cf1f4273 Jose A. Lopes
vncDefaultBindAddress = ip4AddressAny
2391 cf1f4273 Jose A. Lopes
2392 b8576ea1 Jose A. Lopes
-- * NIC types
2393 b8576ea1 Jose A. Lopes
2394 b8576ea1 Jose A. Lopes
htNicE1000 :: String
2395 b8576ea1 Jose A. Lopes
htNicE1000 = "e1000"
2396 b8576ea1 Jose A. Lopes
2397 b8576ea1 Jose A. Lopes
htNicI82551 :: String
2398 b8576ea1 Jose A. Lopes
htNicI82551 = "i82551"
2399 b8576ea1 Jose A. Lopes
2400 b8576ea1 Jose A. Lopes
htNicI8259er :: String
2401 b8576ea1 Jose A. Lopes
htNicI8259er = "i82559er"
2402 b8576ea1 Jose A. Lopes
2403 b8576ea1 Jose A. Lopes
htNicI85557b :: String
2404 b8576ea1 Jose A. Lopes
htNicI85557b = "i82557b"
2405 b8576ea1 Jose A. Lopes
2406 b8576ea1 Jose A. Lopes
htNicNe2kIsa :: String
2407 b8576ea1 Jose A. Lopes
htNicNe2kIsa = "ne2k_isa"
2408 b8576ea1 Jose A. Lopes
2409 b8576ea1 Jose A. Lopes
htNicNe2kPci :: String
2410 b8576ea1 Jose A. Lopes
htNicNe2kPci = "ne2k_pci"
2411 b8576ea1 Jose A. Lopes
2412 b8576ea1 Jose A. Lopes
htNicParavirtual :: String
2413 b8576ea1 Jose A. Lopes
htNicParavirtual = "paravirtual"
2414 b8576ea1 Jose A. Lopes
2415 b8576ea1 Jose A. Lopes
htNicPcnet :: String
2416 b8576ea1 Jose A. Lopes
htNicPcnet = "pcnet"
2417 b8576ea1 Jose A. Lopes
2418 b8576ea1 Jose A. Lopes
htNicRtl8139 :: String
2419 b8576ea1 Jose A. Lopes
htNicRtl8139 = "rtl8139"
2420 b8576ea1 Jose A. Lopes
2421 b8576ea1 Jose A. Lopes
htHvmValidNicTypes :: FrozenSet String
2422 b8576ea1 Jose A. Lopes
htHvmValidNicTypes =
2423 b8576ea1 Jose A. Lopes
  ConstantUtils.mkSet [htNicE1000,
2424 b8576ea1 Jose A. Lopes
                       htNicNe2kIsa,
2425 b8576ea1 Jose A. Lopes
                       htNicNe2kPci,
2426 b8576ea1 Jose A. Lopes
                       htNicParavirtual,
2427 b8576ea1 Jose A. Lopes
                       htNicRtl8139]
2428 b8576ea1 Jose A. Lopes
2429 b8576ea1 Jose A. Lopes
htKvmValidNicTypes :: FrozenSet String
2430 b8576ea1 Jose A. Lopes
htKvmValidNicTypes =
2431 b8576ea1 Jose A. Lopes
  ConstantUtils.mkSet [htNicE1000,
2432 b8576ea1 Jose A. Lopes
                       htNicI82551,
2433 b8576ea1 Jose A. Lopes
                       htNicI8259er,
2434 b8576ea1 Jose A. Lopes
                       htNicI85557b,
2435 b8576ea1 Jose A. Lopes
                       htNicNe2kIsa,
2436 b8576ea1 Jose A. Lopes
                       htNicNe2kPci,
2437 b8576ea1 Jose A. Lopes
                       htNicParavirtual,
2438 b8576ea1 Jose A. Lopes
                       htNicPcnet,
2439 b8576ea1 Jose A. Lopes
                       htNicRtl8139]
2440 b8576ea1 Jose A. Lopes
2441 b8576ea1 Jose A. Lopes
-- * Vif types
2442 b8576ea1 Jose A. Lopes
2443 b8576ea1 Jose A. Lopes
-- | Default vif type in xen-hvm
2444 b8576ea1 Jose A. Lopes
htHvmVifIoemu :: String
2445 b8576ea1 Jose A. Lopes
htHvmVifIoemu = "ioemu"
2446 b8576ea1 Jose A. Lopes
2447 b8576ea1 Jose A. Lopes
htHvmVifVif :: String
2448 b8576ea1 Jose A. Lopes
htHvmVifVif = "vif"
2449 b8576ea1 Jose A. Lopes
2450