diff --git a/lib/cli.py b/lib/cli.py index 2c611c0b810f1f9b9b23a4f102af8c25e080bba9..bc758237d004221a464aaa31aae014faef77b9e4 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -194,6 +194,7 @@ __all__ = [ "DISK_STATE_OPT", "HV_STATE_OPT", "IGNORE_IPOLICY_OPT", + "INSTANCE_POLICY_OPTS", # Generic functions for CLI programs "ConfirmOperation", "GenericMain", @@ -1388,6 +1389,16 @@ COMMON_CREATE_OPTS = [ PRIORITY_OPT, ] +# common instance policy options +INSTANCE_POLICY_OPTS = [ + SPECS_CPU_COUNT_OPT, + SPECS_DISK_COUNT_OPT, + SPECS_DISK_SIZE_OPT, + SPECS_MEM_SIZE_OPT, + SPECS_NIC_COUNT_OPT, + SPECS_DISK_TEMPLATES, + ] + def _ParseArgs(argv, commands, aliases, env_override): """Parser for the command line arguments. diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index 5087ffd7f702e645263d41c86e3554f6c58efb44..64ea490cc80991c79a7db5387bfe67637d2cbb69 100644 --- a/lib/client/gnt_cluster.py +++ b/lib/client/gnt_cluster.py @@ -1444,14 +1444,6 @@ def Epo(opts, args): else: return _EpoOff(opts, node_list, inst_map) -INSTANCE_POLICY_OPTS = [ - SPECS_CPU_COUNT_OPT, - SPECS_DISK_COUNT_OPT, - SPECS_DISK_SIZE_OPT, - SPECS_MEM_SIZE_OPT, - SPECS_NIC_COUNT_OPT, - ] - commands = { "init": ( InitCluster, [ArgHost(min=1, max=1)], diff --git a/lib/client/gnt_group.py b/lib/client/gnt_group.py index 8cde11ed6d442f0b705281586a15e17993022bee..d5cb0acbeb7731a57b0d4e4649f87c86370722a6 100644 --- a/lib/client/gnt_group.py +++ b/lib/client/gnt_group.py @@ -277,14 +277,6 @@ def EvacuateGroup(opts, args): return rcode -INSTANCE_POLICY_OPTS = [ - SPECS_CPU_COUNT_OPT, - SPECS_DISK_COUNT_OPT, - SPECS_DISK_SIZE_OPT, - SPECS_MEM_SIZE_OPT, - SPECS_NIC_COUNT_OPT, - ] - commands = { "add": ( AddGroup, ARGS_ONE_GROUP, diff --git a/man/gnt-cluster.rst b/man/gnt-cluster.rst index 199760b8b44e0d2a3833f77cc6a4a5b6357b90c4..34d517f655e2e0ba364a65116c11ff4377b908f5 100644 --- a/man/gnt-cluster.rst +++ b/man/gnt-cluster.rst @@ -190,6 +190,7 @@ INIT | [--specs-disk-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-mem-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-nic-count *spec-param*=*value* [,*spec-param*=*value*...]] +| [--specs-disk-templates *template* [,*template*...]] | [--disk-state *diskstate*] | [--hypervisor-state *hvstate*] | {*clustername*} @@ -371,7 +372,7 @@ must be specified first, followed by a colon and by a comma-separated list of key-value pairs. These parameters can only be specified at cluster and node group level; the cluster-level parameter are inherited by the node group at the moment of its creation, and can be further -modified at node group level using the **gnt-group**(8) command. +modified at node group level using the **gnt-group**(8) command. The following is the list of disk parameters available for the **drbd** template, with measurement units specified in square brackets at the end @@ -483,17 +484,21 @@ The ``-C (--candidate-pool-size)`` option specifies the that the master will try to keep as master\_candidates. For more details about this role and other node roles, see the ganeti(7). -The ``--specs-..`` options specify instance policy on the cluster. Each -option can have three values: ``min``, ``max`` and ``std``, which can -also be modified on group level (except for ``std``, which is defined -once for the entire cluster). Please note, that ``std`` values are not -the same as defaults set by ``--beparams``. -``--specs-cpu-count`` sets the number of VCPUs that can be used by an -instance. -``--specs-disk-count`` sets the number of disks -``--specs-disk-size`` limits the disk size for every disk used -``--specs-mem-size`` limits the amount of memory available -``--specs-nic-count`` sets limits on the amount of nics used +The ``--specs-...`` options specify instance policy on the +cluster. Except for the ``disk-templates`` option, each option can have +three values: ``min``, ``max`` and ``std``, which can also be modified +on group level (except for ``std``, which is defined once for the entire +cluster). Please note, that ``std`` values are not the same as defaults +set by ``--beparams``, but they are used for the capacity calculations. + +- ``--specs-cpu-count`` limits the number of VCPUs that can be used by an + instance. +- ``--specs-disk-count`` limits the number of disks +- ``--specs-disk-size`` limits the disk size for every disk used +- ``--specs-mem-size`` limits the amount of memory available +- ``--specs-nic-count`` sets limits on the number of NICs used +- ``--specs-disk-templates`` limits the allowed disk templates (no + mix/std/max for this option) For details about how to use ``--hypervisor-state`` and ``--disk-state`` have a look at **ganeti**(7). @@ -565,6 +570,7 @@ MODIFY | [--specs-disk-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-mem-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-nic-count *spec-param*=*value* [,*spec-param*=*value*...]] +| [--specs-disk-templates *template* [,*template*...]] Modify the options for the cluster. @@ -601,7 +607,7 @@ The ``-I (--default-iallocator)`` is described in the **init** command. To clear the default iallocator, just pass an empty string (''). -The ``--specs-..`` options are described in the **init** command. +The ``--specs-...`` options are described in the **init** command. QUEUE ~~~~~ diff --git a/man/gnt-group.rst b/man/gnt-group.rst index 977b3c3e984b366e2a75250dc04a4802631b027b..a260e654709e64663e6bce511b73de8209034127 100644 --- a/man/gnt-group.rst +++ b/man/gnt-group.rst @@ -32,6 +32,7 @@ ADD | [--specs-disk-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-mem-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-nic-count *spec-param*=*value* [,*spec-param*=*value*...]] +| [--specs-disk-templates *template* [,*template*...]] | [--disk-state *diskstate*] | [--hypervisor-state *hvstate*] | {*group*} @@ -66,14 +67,8 @@ parameters for the node group; please see the section about **gnt-cluster add** in **gnt-cluster**(8) for more information about disk parameters -The ``--specs-..`` options specify instance policy on the cluster. Each -option can have two values: ``min`` and ``max``. -``--specs-cpu-count`` sets the number of VCPUs that can be used by an -instance. -``--specs-disk-count`` sets the number of disks -``--specs-disk-size`` limits the disk size for every disk used -``--specs-mem-size`` limits the amount of memory available -``--specs-nic-count`` sets limits on the amount of nics used +The ``--specs-...`` options specify instance policies on the node group, +and are documented in the **gnt-cluster**(8) man page. ASSIGN-NODES ~~~~~~~~~~~~ @@ -105,6 +100,7 @@ MODIFY | [--specs-disk-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-mem-size *spec-param*=*value* [,*spec-param*=*value*...]] | [--specs-nic-count *spec-param*=*value* [,*spec-param*=*value*...]] +| [--specs-disk-templates *template* [,*template*...]] | {*group*} Modifies some parameters from the node group. @@ -114,8 +110,11 @@ in the **add** command above. ``--hypervisor-state`` as well as ``--disk-state`` are documented in detail in **ganeti**(7). The ``--node-parameters``, ``--alloc-policy``, ``-D -(--disk-parameters)`` and ``--specs-..`` options are documented in the -**add** command above. +(--disk-parameters)`` options are documented in the **add** command +above. + +The ``--specs-...`` options specify instance policies on the node group, +and are documented in the **gnt-cluster**(8) man page. REMOVE ~~~~~~