diff --git a/htools/Ganeti/HTools/CLI.hs b/htools/Ganeti/HTools/CLI.hs index 820be57a7c405e19d35bd3a8ae31e4e5cf31b008..58ffa22f7fc59bb7e51b9c508826cbc0c4ec32df 100644 --- a/htools/Ganeti/HTools/CLI.hs +++ b/htools/Ganeti/HTools/CLI.hs @@ -47,9 +47,6 @@ module Ganeti.HTools.CLI , oExTags , oExecJobs , oGroup - , oIDisk - , oIMem - , oIVcpus , oInstMoves , oLuxiSocket , oMachineReadable @@ -73,6 +70,7 @@ module Ganeti.HTools.CLI , oSelInst , oShowHelp , oShowVer + , oStdSpec , oTieredSpec , oVerbose ) where @@ -263,33 +261,6 @@ oGroup = Option "G" ["group"] (ReqArg (\ f o -> Ok o { optGroup = Just f }) "ID") "the ID of the group to balance" -oIDisk :: OptType -oIDisk = Option "" ["disk"] - (ReqArg (\ d opts -> do - dsk <- annotateResult "--disk option" (parseUnit d) - let ospec = optISpec opts - nspec = ospec { rspecDsk = dsk } - return $ opts { optISpec = nspec }) "DISK") - "disk size for instances" - -oIMem :: OptType -oIMem = Option "" ["memory"] - (ReqArg (\ m opts -> do - mem <- annotateResult "--memory option" (parseUnit m) - let ospec = optISpec opts - nspec = ospec { rspecMem = mem } - return $ opts { optISpec = nspec }) "MEMORY") - "memory size for instances" - -oIVcpus :: OptType -oIVcpus = Option "" ["vcpus"] - (ReqArg (\ p opts -> do - vcpus <- tryRead "--vcpus option" p - let ospec = optISpec opts - nspec = ospec { rspecCpu = vcpus } - return $ opts { optISpec = nspec }) "NUM") - "number of virtual cpus for instances" - oLuxiSocket :: OptType oLuxiSocket = Option "L" ["luxi"] (OptArg ((\ f opts -> Ok opts { optLuxi = Just f }) . @@ -408,6 +379,14 @@ oShowVer = Option "V" ["version"] (NoArg (\ opts -> Ok opts { optShowVer = True})) "show the version of the program" +oStdSpec :: OptType +oStdSpec = Option "" ["standard-alloc"] + (ReqArg (\ inp opts -> do + tspec <- parseISpecString "standard" inp + return $ opts { optISpec = tspec } ) + "STDSPEC") + "enable standard specs allocation, given as 'disk,ram,cpu'" + oTieredSpec :: OptType oTieredSpec = Option "" ["tiered-alloc"] (ReqArg (\ inp opts -> do diff --git a/htools/Ganeti/HTools/Program/Hspace.hs b/htools/Ganeti/HTools/Program/Hspace.hs index 52118148cad1838933bf4bb8d1d64c26e432568c..63dddc1466751c42690f6e9eb84ba1acf5abb9e3 100644 --- a/htools/Ganeti/HTools/Program/Hspace.hs +++ b/htools/Ganeti/HTools/Program/Hspace.hs @@ -59,13 +59,11 @@ options = , oVerbose , oQuiet , oOfflineNode - , oIMem - , oIDisk - , oIVcpus , oMachineReadable , oMaxCpu , oMaxSolLength , oMinDisk + , oStdSpec , oTieredSpec , oSaveCluster , oShowVer diff --git a/man/hspace.rst b/man/hspace.rst index 6088d5580c10b1acec14b21a128d99a16525d0dd..70f55c0e985230724762ad90f4b71bc256bc538d 100644 --- a/man/hspace.rst +++ b/man/hspace.rst @@ -29,11 +29,11 @@ Algorithm options: Request options: -**[--memory** *mem* **]** -**[--disk** *disk* **]** **[--disk-template** *template* **]** -**[--vcpus** *vcpus* **]** -**[--tiered-alloc** *spec* **]** + +**[--standard-alloc** *disk,ram,cpu* **]** + +**[--tiered-alloc** *disk,ram,cpu* **]** Output options: @@ -201,21 +201,10 @@ OPTIONS The options that can be passed to the program are as follows: ---memory *mem* - The memory size of the instances to be placed (defaults to - 4GiB). Units can be used (see below for more details). - ---disk *disk* - The disk size of the instances to be placed (defaults to - 100GiB). Units can be used. - --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). - --max-cpu=*cpu-ratio* The maximum virtual to physical cpu ratio, as a floating point number greater than or equal to one. For example, specifying *cpu-ratio* as @@ -284,22 +273,28 @@ The options that can be passed to the program are as follows: overriding the cluster data with a simulated cluster. For details about the description, see the man page **htools**(1). ---tiered-alloc *spec* - Besides the standard, fixed-size allocation, also do a tiered - allocation scheme where the algorithm starts from the given - specification and allocates until there is no more space; then it - decreases the specification and tries the allocation again. The - decrease is done on the matric that last failed during - allocation. The specification given is similar to the *--simulate* - option and it holds: +--standard-alloc *disk,ram,cpu* + This option specifies the instance size for the *standard* allocation + mode, where we simply allocate instances of the same, fixed size until + the cluster runs out of space. + + The specification given is similar to the *--simulate* option and it + holds: - the disk size of the instance (units can be used) - the memory size of the instance (units can be used) - the vcpu count for the insance - An example description would be *100G,4g,2* describing an initial - starting specification of 100GB of disk space, 4GiB of memory and 2 - VCPUs. + An example description would be *100G,4g,2* describing an instance + specification of 100GB of disk space, 4GiB of memory and 2 VCPUs. + +--tiered-alloc *disk,ram,cpu* + Besides the standard, fixed-size allocation, also do a tiered + allocation scheme where the algorithm starts from the given + specification and allocates until there is no more space; then it + decreases the specification and tries the allocation again. The + decrease is done on the metric that last failed during allocation. The + argument should have the same format as for ``-standard-alloc``. Also note that the normal allocation and the tiered allocation are independent, and both start from the initial cluster state; as such,