Revision 294bb337
b/htools/Ganeti/HTools/CLI.hs | ||
---|---|---|
47 | 47 |
, oExTags |
48 | 48 |
, oExecJobs |
49 | 49 |
, oGroup |
50 |
, oIDisk |
|
51 |
, oIMem |
|
52 |
, oIVcpus |
|
53 | 50 |
, oInstMoves |
54 | 51 |
, oLuxiSocket |
55 | 52 |
, oMachineReadable |
... | ... | |
73 | 70 |
, oSelInst |
74 | 71 |
, oShowHelp |
75 | 72 |
, oShowVer |
73 |
, oStdSpec |
|
76 | 74 |
, oTieredSpec |
77 | 75 |
, oVerbose |
78 | 76 |
) where |
... | ... | |
263 | 261 |
(ReqArg (\ f o -> Ok o { optGroup = Just f }) "ID") |
264 | 262 |
"the ID of the group to balance" |
265 | 263 |
|
266 |
oIDisk :: OptType |
|
267 |
oIDisk = Option "" ["disk"] |
|
268 |
(ReqArg (\ d opts -> do |
|
269 |
dsk <- annotateResult "--disk option" (parseUnit d) |
|
270 |
let ospec = optISpec opts |
|
271 |
nspec = ospec { rspecDsk = dsk } |
|
272 |
return $ opts { optISpec = nspec }) "DISK") |
|
273 |
"disk size for instances" |
|
274 |
|
|
275 |
oIMem :: OptType |
|
276 |
oIMem = Option "" ["memory"] |
|
277 |
(ReqArg (\ m opts -> do |
|
278 |
mem <- annotateResult "--memory option" (parseUnit m) |
|
279 |
let ospec = optISpec opts |
|
280 |
nspec = ospec { rspecMem = mem } |
|
281 |
return $ opts { optISpec = nspec }) "MEMORY") |
|
282 |
"memory size for instances" |
|
283 |
|
|
284 |
oIVcpus :: OptType |
|
285 |
oIVcpus = Option "" ["vcpus"] |
|
286 |
(ReqArg (\ p opts -> do |
|
287 |
vcpus <- tryRead "--vcpus option" p |
|
288 |
let ospec = optISpec opts |
|
289 |
nspec = ospec { rspecCpu = vcpus } |
|
290 |
return $ opts { optISpec = nspec }) "NUM") |
|
291 |
"number of virtual cpus for instances" |
|
292 |
|
|
293 | 264 |
oLuxiSocket :: OptType |
294 | 265 |
oLuxiSocket = Option "L" ["luxi"] |
295 | 266 |
(OptArg ((\ f opts -> Ok opts { optLuxi = Just f }) . |
... | ... | |
408 | 379 |
(NoArg (\ opts -> Ok opts { optShowVer = True})) |
409 | 380 |
"show the version of the program" |
410 | 381 |
|
382 |
oStdSpec :: OptType |
|
383 |
oStdSpec = Option "" ["standard-alloc"] |
|
384 |
(ReqArg (\ inp opts -> do |
|
385 |
tspec <- parseISpecString "standard" inp |
|
386 |
return $ opts { optISpec = tspec } ) |
|
387 |
"STDSPEC") |
|
388 |
"enable standard specs allocation, given as 'disk,ram,cpu'" |
|
389 |
|
|
411 | 390 |
oTieredSpec :: OptType |
412 | 391 |
oTieredSpec = Option "" ["tiered-alloc"] |
413 | 392 |
(ReqArg (\ inp opts -> do |
b/htools/Ganeti/HTools/Program/Hspace.hs | ||
---|---|---|
59 | 59 |
, oVerbose |
60 | 60 |
, oQuiet |
61 | 61 |
, oOfflineNode |
62 |
, oIMem |
|
63 |
, oIDisk |
|
64 |
, oIVcpus |
|
65 | 62 |
, oMachineReadable |
66 | 63 |
, oMaxCpu |
67 | 64 |
, oMaxSolLength |
68 | 65 |
, oMinDisk |
66 |
, oStdSpec |
|
69 | 67 |
, oTieredSpec |
70 | 68 |
, oSaveCluster |
71 | 69 |
, oShowVer |
b/man/hspace.rst | ||
---|---|---|
29 | 29 |
|
30 | 30 |
Request options: |
31 | 31 |
|
32 |
**[--memory** *mem* **]** |
|
33 |
**[--disk** *disk* **]** |
|
34 | 32 |
**[--disk-template** *template* **]** |
35 |
**[--vcpus** *vcpus* **]** |
|
36 |
**[--tiered-alloc** *spec* **]** |
|
33 |
|
|
34 |
**[--standard-alloc** *disk,ram,cpu* **]** |
|
35 |
|
|
36 |
**[--tiered-alloc** *disk,ram,cpu* **]** |
|
37 | 37 |
|
38 | 38 |
Output options: |
39 | 39 |
|
... | ... | |
201 | 201 |
|
202 | 202 |
The options that can be passed to the program are as follows: |
203 | 203 |
|
204 |
--memory *mem* |
|
205 |
The memory size of the instances to be placed (defaults to |
|
206 |
4GiB). Units can be used (see below for more details). |
|
207 |
|
|
208 |
--disk *disk* |
|
209 |
The disk size of the instances to be placed (defaults to |
|
210 |
100GiB). Units can be used. |
|
211 |
|
|
212 | 204 |
--disk-template *template* |
213 | 205 |
The disk template for the instance; one of the Ganeti disk templates |
214 | 206 |
(e.g. plain, drbd, so on) should be passed in. |
215 | 207 |
|
216 |
--vcpus *vcpus* |
|
217 |
The number of VCPUs of the instances to be placed (defaults to 1). |
|
218 |
|
|
219 | 208 |
--max-cpu=*cpu-ratio* |
220 | 209 |
The maximum virtual to physical cpu ratio, as a floating point number |
221 | 210 |
greater than or equal to one. For example, specifying *cpu-ratio* as |
... | ... | |
284 | 273 |
overriding the cluster data with a simulated cluster. For details |
285 | 274 |
about the description, see the man page **htools**(1). |
286 | 275 |
|
287 |
--tiered-alloc *spec* |
|
288 |
Besides the standard, fixed-size allocation, also do a tiered |
|
289 |
allocation scheme where the algorithm starts from the given |
|
290 |
specification and allocates until there is no more space; then it |
|
291 |
decreases the specification and tries the allocation again. The |
|
292 |
decrease is done on the matric that last failed during |
|
293 |
allocation. The specification given is similar to the *--simulate* |
|
294 |
option and it holds: |
|
276 |
--standard-alloc *disk,ram,cpu* |
|
277 |
This option specifies the instance size for the *standard* allocation |
|
278 |
mode, where we simply allocate instances of the same, fixed size until |
|
279 |
the cluster runs out of space. |
|
280 |
|
|
281 |
The specification given is similar to the *--simulate* option and it |
|
282 |
holds: |
|
295 | 283 |
|
296 | 284 |
- the disk size of the instance (units can be used) |
297 | 285 |
- the memory size of the instance (units can be used) |
298 | 286 |
- the vcpu count for the insance |
299 | 287 |
|
300 |
An example description would be *100G,4g,2* describing an initial |
|
301 |
starting specification of 100GB of disk space, 4GiB of memory and 2 |
|
302 |
VCPUs. |
|
288 |
An example description would be *100G,4g,2* describing an instance |
|
289 |
specification of 100GB of disk space, 4GiB of memory and 2 VCPUs. |
|
290 |
|
|
291 |
--tiered-alloc *disk,ram,cpu* |
|
292 |
Besides the standard, fixed-size allocation, also do a tiered |
|
293 |
allocation scheme where the algorithm starts from the given |
|
294 |
specification and allocates until there is no more space; then it |
|
295 |
decreases the specification and tries the allocation again. The |
|
296 |
decrease is done on the metric that last failed during allocation. The |
|
297 |
argument should have the same format as for ``-standard-alloc``. |
|
303 | 298 |
|
304 | 299 |
Also note that the normal allocation and the tiered allocation are |
305 | 300 |
independent, and both start from the initial cluster state; as such, |
Also available in: Unified diff