buf.write(" - memory: %sMiB\n" %
compat.TryToRoman(instance["be_actual"][constants.BE_MAXMEM],
convert=opts.roman_integers))
+ buf.write(" - %s: %s\n" %
+ (constants.BE_ALWAYS_FAILOVER,
+ instance["be_actual"][constants.BE_ALWAYS_FAILOVER]))
buf.write(" - NICs:\n")
for idx, (ip, mac, mode, link) in enumerate(instance["nics"]):
buf.write(" - nic/%d: MAC: %s, IP: %s, mode: %s, link: %s\n" %
self.lu.LogInfo("Not checking memory on the secondary node as"
" instance will not be started")
+ # check if failover must be forced instead of migration
+ if (not self.cleanup and not self.failover and
+ i_be[constants.BE_ALWAYS_FAILOVER]):
+ if self.fallback:
+ self.lu.LogInfo("Instance configured to always failover; fallback"
+ " to failover")
+ self.failover = True
+ else:
+ raise errors.OpPrereqError("This instance has been configured to"
+ " always failover, please allow failover",
+ errors.ECODE_STATE)
+
# check bridge existance
_CheckInstanceBridgesExist(self.lu, instance, node=target_node)
BE_MINMEM = "minmem"
BE_VCPUS = "vcpus"
BE_AUTO_BALANCE = "auto_balance"
+BE_ALWAYS_FAILOVER = "always_failover"
BES_PARAMETER_TYPES = {
BE_MAXMEM: VTYPE_SIZE,
BE_MINMEM: VTYPE_SIZE,
BE_VCPUS: VTYPE_INT,
BE_AUTO_BALANCE: VTYPE_BOOL,
+ BE_ALWAYS_FAILOVER: VTYPE_BOOL,
}
BES_PARAMETER_COMPAT = {
BE_MAXMEM: 128,
BE_VCPUS: 1,
BE_AUTO_BALANCE: True,
+ BE_ALWAYS_FAILOVER: False,
}
NDC_DEFAULTS = {
whether the instance is considered in the N+1 cluster checks
(enough redundancy in the cluster to survive a node failure)
+always\_failover
+ ``True`` or ``False``, whether the instance must be failed over
+ (shut down and rebooted) always or it may be migrated (briefly
+ suspended)
+
The ``-t`` options specifies the disk layout type for the instance.
If not passed, the configuration of the original instance is used.
Value of the auto\_balance flag for instances to use by default,
will be set to true if not specified.
+always\_failover
+ Default value for the ``always\_failover`` flag for instances; if
+ not set, ``False`` is used.
+
The ``-N (--nic-parameters)`` option allows you to set the default nic
parameters for the cluster. The parameter format is a comma-separated
whether the instance is considered in the N+1 cluster checks
(enough redundancy in the cluster to survive a node failure)
+always\_failover
+ ``True`` or ``False``, whether the instance must be failed over
+ (shut down and rebooted) always or it may be migrated (briefly
+ suspended)
+
Note that before 2.6 Ganeti had a ``memory`` parameter, which was the
only value of memory an instance could have. With the
``maxmem``/``minmem`` change Ganeti guarantees that at least the minimum
The option ``-f`` will skip the prompting for confirmation.
If ``--allow-failover`` is specified it tries to fallback to failover if
-it already can determine that a migration won't work (i.e. if the
+it already can determine that a migration won't work (e.g. if the
instance is shut down). Please note that the fallback will not happen
during execution. If a migration fails during execution it still fails.