Revision 9ef605a6
b/htools/hspace.hs | ||
---|---|---|
52 | 52 |
options = |
53 | 53 |
[ oPrintNodes |
54 | 54 |
, oDataFile |
55 |
, oDiskTemplate |
|
55 | 56 |
, oNodeSim |
56 | 57 |
, oRapiMaster |
57 | 58 |
, oLuxiSocket |
... | ... | |
61 | 62 |
, oIMem |
62 | 63 |
, oIDisk |
63 | 64 |
, oIVcpus |
64 |
, oINodes |
|
65 | 65 |
, oMaxCpu |
66 | 66 |
, oMinDisk |
67 | 67 |
, oTieredSpec |
... | ... | |
217 | 217 |
let verbose = optVerbose opts |
218 | 218 |
ispec = optISpec opts |
219 | 219 |
shownodes = optShowNodes opts |
220 |
disk_template = optDiskTemplate opts |
|
221 |
req_nodes = Instance.requiredNodes disk_template |
|
220 | 222 |
|
221 | 223 |
(ClusterData gl fixed_nl il ctags) <- loadExternalData opts |
222 | 224 |
|
223 | 225 |
printKeys $ map (\(a, fn) -> ("SPEC_" ++ a, fn ispec)) specData |
224 |
printKeys [ ("SPEC_RQN", printf "%d" (optINodes opts)) ]
|
|
226 |
printKeys [ ("SPEC_RQN", printf "%d" req_nodes) ]
|
|
225 | 227 |
|
226 | 228 |
let num_instances = length $ Container.elems il |
227 | 229 |
|
... | ... | |
234 | 236 |
Node.name n `elem` offline_names || |
235 | 237 |
Node.alias n `elem` offline_names) |
236 | 238 |
all_nodes |
237 |
req_nodes = optINodes opts |
|
238 | 239 |
m_cpu = optMcpu opts |
239 | 240 |
m_dsk = optMdsk opts |
240 | 241 |
|
... | ... | |
280 | 281 |
|
281 | 282 |
-- utility functions |
282 | 283 |
let iofspec spx = Instance.create "new" (rspecMem spx) (rspecDsk spx) |
283 |
(rspecCpu spx) "running" [] True (-1) (-1) DTDrbd8
|
|
284 |
(rspecCpu spx) "running" [] True (-1) (-1) disk_template
|
|
284 | 285 |
exitifbad val = (case val of |
285 | 286 |
Bad s -> do |
286 | 287 |
hPrintf stderr "Failure: %s\n" s :: IO () |
b/man/hspace.rst | ||
---|---|---|
31 | 31 |
|
32 | 32 |
**[--memory** *mem* **]** |
33 | 33 |
**[--disk** *disk* **]** |
34 |
**[--req-nodes** *req-nodes* **]**
|
|
34 |
**[--disk-template** *template* **]**
|
|
35 | 35 |
**[--vcpus** *vcpus* **]** |
36 | 36 |
**[--tiered-alloc** *spec* **]** |
37 | 37 |
|
... | ... | |
46 | 46 |
The program will try to place instances, all of the same size, on the |
47 | 47 |
cluster, until the point where we don't have any N+1 possible |
48 | 48 |
allocation. It uses the exact same allocation algorithm as the hail |
49 |
iallocator plugin. |
|
49 |
iallocator plugin in *allocate* mode.
|
|
50 | 50 |
|
51 | 51 |
The output of the program is designed to interpreted as a shell |
52 | 52 |
fragment (or parsed as a *key=value* file). Options which extend the |
... | ... | |
191 | 191 |
--disk *disk* |
192 | 192 |
The disk size of the instances to be placed (defaults to 100GiB). |
193 | 193 |
|
194 |
--req-nodes *num-nodes*
|
|
195 |
The number of nodes for the instances; the default of two means
|
|
196 |
mirrored instances, while passing one means plain type instances.
|
|
194 |
--disk-template *template*
|
|
195 |
The disk template for the instance; one of the Ganeti disk templates
|
|
196 |
(e.g. plain, drbd, so on) should be passed in.
|
|
197 | 197 |
|
198 | 198 |
--vcpus *vcpus* |
199 | 199 |
The number of VCPUs of the instances to be placed (defaults to 1). |
Also available in: Unified diff