#
#
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
"SPECS_DISK_SIZE_OPT",
"SPECS_MEM_SIZE_OPT",
"SPECS_NIC_COUNT_OPT",
- "SPECS_DISK_TEMPLATES",
+ "IPOLICY_DISK_TEMPLATES",
"SPICE_CACERT_OPT",
"SPICE_CERT_OPT",
"SRC_DIR_OPT",
type="keyval", default={},
help="NIC count specs: min, max, std")
-SPECS_DISK_TEMPLATES = cli_option("--specs-disk-templates",
- dest="ispecs_disk_templates",
- type="list", default=None,
- help="Comma-separated list of"
- " enabled disk templates")
+IPOLICY_DISK_TEMPLATES = cli_option("--ipolicy-disk-templates",
+ dest="ipolicy_disk_templates",
+ type="list", default=None,
+ help="Comma-separated list of"
+ " enabled disk templates")
HYPERVISOR_OPT = cli_option("-H", "--hypervisor-parameters", dest="hypervisor",
help="Hypervisor and hypervisor options, in the"
SPECS_DISK_SIZE_OPT,
SPECS_MEM_SIZE_OPT,
SPECS_NIC_COUNT_OPT,
- SPECS_DISK_TEMPLATES,
+ IPOLICY_DISK_TEMPLATES,
]
utils.ForceDictType(diskparams[templ], constants.DISK_DT_TYPES)
# prepare ipolicy dict
- ispecs_dts = opts.ispecs_disk_templates # hate long var names
+ ispecs_dts = opts.ipolicy_disk_templates # hate long var names
ipolicy_raw = \
objects.CreateIPolicyFromOpts(ispecs_mem_size=opts.ispecs_mem_size,
ispecs_cpu_count=opts.ispecs_cpu_count,
ispecs_disk_count=opts.ispecs_disk_count,
ispecs_disk_size=opts.ispecs_disk_size,
ispecs_nic_count=opts.ispecs_nic_count,
- ispecs_disk_templates=ispecs_dts,
+ ipolicy_disk_templates=ispecs_dts,
fill_all=True)
ipolicy = objects.FillIPolicy(constants.IPOLICY_DEFAULTS, ipolicy_raw)
ToStdout(" - %s", key)
_PrintGroupedParams(result["ipolicy"][key], roman=opts.roman_integers)
ToStdout(" - enabled disk templates: %s",
- utils.CommaJoin(result["ipolicy"][constants.ISPECS_DTS]))
+ utils.CommaJoin(result["ipolicy"][constants.IPOLICY_DTS]))
return 0
if ndparams is not None:
utils.ForceDictType(ndparams, constants.NDS_PARAMETER_TYPES)
- ispecs_dts = opts.ispecs_disk_templates
+ ispecs_dts = opts.ipolicy_disk_templates
ipolicy = \
objects.CreateIPolicyFromOpts(ispecs_mem_size=opts.ispecs_mem_size,
ispecs_cpu_count=opts.ispecs_cpu_count,
ispecs_disk_count=opts.ispecs_disk_count,
ispecs_disk_size=opts.ispecs_disk_size,
ispecs_nic_count=opts.ispecs_nic_count,
- ispecs_disk_templates=ispecs_dts)
+ ipolicy_disk_templates=ispecs_dts)
mnh = opts.maintain_node_health
ispecs_disk_count=opts.ispecs_disk_count,
ispecs_disk_size=opts.ispecs_disk_size,
ispecs_nic_count=opts.ispecs_nic_count,
- ispecs_disk_templates=opts.ispecs_disk_templates,
+ ipolicy_disk_templates=opts.ipolicy_disk_templates,
group_ipolicy=True,
allowed_values=[constants.VALUE_DEFAULT])
#
#
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ISPECS_MIN = "min"
ISPECS_MAX = "max"
ISPECS_STD = "std"
-ISPECS_DTS = "disk_templates"
+IPOLICY_DTS = "disk_templates"
IPOLICY_PARAMETERS = frozenset([
ISPECS_MIN,
ISPECS_MAX,
ISPECS_STD,
])
-IPOLICY_ALL_KEYS = IPOLICY_PARAMETERS.union([ISPECS_DTS])
+IPOLICY_ALL_KEYS = IPOLICY_PARAMETERS.union([IPOLICY_DTS])
# Node parameter names
ND_OOB_PROGRAM = "oob_program"
ISPEC_DISK_SIZE: 1024,
ISPEC_NIC_COUNT: 1,
},
- ISPECS_DTS: DISK_TEMPLATES,
+ IPOLICY_DTS: DISK_TEMPLATES,
}
MASTER_POOL_SIZE_DEFAULT = 10
custom_ipolicy.get(key, {}),
skip_keys=skip_keys)
# list items
- for key in [constants.ISPECS_DTS]:
+ for key in [constants.IPOLICY_DTS]:
ret_dict[key] = list(custom_ipolicy.get(key, default_ipolicy[key]))
return ret_dict
ispecs_disk_count=None,
ispecs_disk_size=None,
ispecs_nic_count=None,
- ispecs_disk_templates=None,
+ ipolicy_disk_templates=None,
group_ipolicy=False,
allowed_values=None,
fill_all=False):
ipolicy_out[key][name] = val
# no filldict for lists
- if not group_ipolicy and fill_all and ispecs_disk_templates is None:
- ispecs_disk_templates = constants.DISK_TEMPLATES
- if ispecs_disk_templates is not None:
- ipolicy_out[constants.ISPECS_DTS] = list(ispecs_disk_templates)
+ if not group_ipolicy and fill_all and ipolicy_disk_templates is None:
+ ipolicy_disk_templates = constants.DISK_TEMPLATES
+ if ipolicy_disk_templates is not None:
+ ipolicy_out[constants.IPOLICY_DTS] = list(ipolicy_disk_templates)
assert not (frozenset(ipolicy_out.keys()) - constants.IPOLICY_ALL_KEYS)
"""
for param in constants.ISPECS_PARAMETERS:
InstancePolicy.CheckISpecSyntax(ipolicy, param)
- if constants.ISPECS_DTS in ipolicy:
- InstancePolicy.CheckDiskTemplates(ipolicy[constants.ISPECS_DTS])
+ if constants.IPOLICY_DTS in ipolicy:
+ InstancePolicy.CheckDiskTemplates(ipolicy[constants.IPOLICY_DTS])
wrong_keys = frozenset(ipolicy.keys()) - constants.IPOLICY_ALL_KEYS
if wrong_keys:
raise errors.ConfigurationError("Invalid keys in ipolicy: %s" %
| [--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*...]]
+| [--ipol-disk-templates *template* [,*template*...]]
| [--disk-state *diskstate*]
| [--hypervisor-state *hvstate*]
| {*clustername*}
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. 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.
+The ``--specs-...`` and ``--ipol-disk-templates`` options specify
+instance policy on the cluster. For the ``--specs-...`` options, 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. The ``--ipol-disk-templates`` option takes a
+comma-separated list of disk templates.
- ``--specs-cpu-count`` limits the number of VCPUs that can be used by an
instance.
- ``--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)
+- ``--ipol-disk-templates`` limits the allowed disk templates
For details about how to use ``--hypervisor-state`` and ``--disk-state``
have a look at **ganeti**(7).
| [--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*...]]
+| [--ipol-disk-templates *template* [,*template*...]]
Modify the options for the cluster.
command. To clear the default iallocator, just pass an empty string
('').
-The ``--specs-...`` options are described in the **init** command.
+The ``--specs-...`` and ``--ipol-disk-templates`` options are described
+in the **init** command.
QUEUE
~~~~~
| [--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*...]]
+| [--ipol-disk-templates *template* [,*template*...]]
| [--disk-state *diskstate*]
| [--hypervisor-state *hvstate*]
| {*group*}
**gnt-cluster add** in **gnt-cluster**(8) for more information about
disk parameters
-The ``--specs-...`` options specify instance policies on the node group,
-and are documented in the **gnt-cluster**(8) man page.
+The ``--specs-...`` and ``--ipol-disk-templates`` options specify
+instance policies on the node group, and are documented in the
+**gnt-cluster**(8) man page.
ASSIGN-NODES
~~~~~~~~~~~~
| [--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*...]]
+| [--ipol-disk-templates *template* [,*template*...]]
| {*group*}
Modifies some parameters from the node group.
(--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.
+The ``--specs-...`` and ``--ipol-disk-templates`` options specify
+instance policies on the node group, and are documented in the
+**gnt-cluster**(8) man page.
REMOVE
~~~~~~