Commit 9ef605a6 authored by Iustin Pop's avatar Iustin Pop

hspace: ask for the disk_template not number of nodes

This makes more sense, as the disk template is more meaningful than
the number of nodes.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent a10a476a
......@@ -52,6 +52,7 @@ options :: [OptType]
options =
[ oPrintNodes
, oDataFile
, oDiskTemplate
, oNodeSim
, oRapiMaster
, oLuxiSocket
......@@ -61,7 +62,6 @@ options =
, oIMem
, oIDisk
, oIVcpus
, oINodes
, oMaxCpu
, oMinDisk
, oTieredSpec
......@@ -217,11 +217,13 @@ main = do
let verbose = optVerbose opts
ispec = optISpec opts
shownodes = optShowNodes opts
disk_template = optDiskTemplate opts
req_nodes = Instance.requiredNodes disk_template
(ClusterData gl fixed_nl il ctags) <- loadExternalData opts
printKeys $ map (\(a, fn) -> ("SPEC_" ++ a, fn ispec)) specData
printKeys [ ("SPEC_RQN", printf "%d" (optINodes opts)) ]
printKeys [ ("SPEC_RQN", printf "%d" req_nodes) ]
let num_instances = length $ Container.elems il
......@@ -234,7 +236,6 @@ main = do
Node.name n `elem` offline_names ||
Node.alias n `elem` offline_names)
all_nodes
req_nodes = optINodes opts
m_cpu = optMcpu opts
m_dsk = optMdsk opts
......@@ -280,7 +281,7 @@ main = do
-- utility functions
let iofspec spx = Instance.create "new" (rspecMem spx) (rspecDsk spx)
(rspecCpu spx) "running" [] True (-1) (-1) DTDrbd8
(rspecCpu spx) "running" [] True (-1) (-1) disk_template
exitifbad val = (case val of
Bad s -> do
hPrintf stderr "Failure: %s\n" s :: IO ()
......
......@@ -31,7 +31,7 @@ Request options:
**[--memory** *mem* **]**
**[--disk** *disk* **]**
**[--req-nodes** *req-nodes* **]**
**[--disk-template** *template* **]**
**[--vcpus** *vcpus* **]**
**[--tiered-alloc** *spec* **]**
......@@ -46,7 +46,7 @@ while maintaining N+1 status.
The program will try to place instances, all of the same size, on the
cluster, until the point where we don't have any N+1 possible
allocation. It uses the exact same allocation algorithm as the hail
iallocator plugin.
iallocator plugin in *allocate* mode.
The output of the program is designed to interpreted as a shell
fragment (or parsed as a *key=value* file). Options which extend the
......@@ -191,9 +191,9 @@ The options that can be passed to the program are as follows:
--disk *disk*
The disk size of the instances to be placed (defaults to 100GiB).
--req-nodes *num-nodes*
The number of nodes for the instances; the default of two means
mirrored instances, while passing one means plain type instances.
--disk-template *template*
The disk template for the instance; one of the Ganeti disk templates
(e.g. plain, drbd, so on) should be passed in.
--vcpus *vcpus*
The number of VCPUs of the instances to be placed (defaults to 1).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment