commit 92dfcd62ac33e10fea1d29b2f12d2d41cbf209dd
Merge: 235407b 8ac5c5d
Author: Iustin Pop <[email protected]>
Date:   Fri May 20 09:33:29 2011 +0200

    Merge remote branch 'origin/devel-2.4'
    
    * origin/devel-2.4:
      Fix errors in hooks documentation
      Clarify a bit the noded man page
      Note --no-remember in NEWS
      Switch QA over to using instance stop --no-remember
      Implement no_remember at RAPI level
      Implement no_remember at CLI level
      Introduce instance start/stop no_remember attribute
      Bump version for the 2.4.2 release
      Fix a bug in LUInstanceMove
      Abstract ignore_consistency opcode parameter
      Preload the string-escape code in noded
      Fix error in iallocator documentation reg. disk mode
      Try to prevent instance memory changes N+1 failures
      Update NEWS file for the 2.4.2 release
    
    Conflicts:
            NEWS                (trivial)
            doc/iallocator.rst  (kept our version)
            lib/cli.py          (trivial)
            lib/opcodes.py      (removed duplicated work, both branches
                                 introduced the same new variable
                                  PIgnoreConsistency :)
            lib/rapi/client.py  (trivial)
            lib/rapi/rlib2.py   (almost trivial)
            qa/ganeti-qa.py     (below trivial)

diff --cc NEWS
index 9d91afe,5dd911c..377c04b
--- a/NEWS
+++ b/NEWS
@@@ -1,25 -1,93 +1,112 @@@
  News
  ====
  
 +Version 2.5.0 beta1
 +-------------------
 +
 +*(unreleased)*
 +
 +- The default of the ``/2/instances/[instance_name]/rename`` RAPI
 +  resource's ``ip_check`` parameter changed from ``True`` to ``False``
 +  to match the underlying LUXI interface
 +- When creating file-based instances via RAPI, the ``file_driver``
 +  parameter no longer defaults to ``loop`` and must be specified
 +- The deprecated "bridge" nic parameter is no longer supported. Use
 +  "link" instead.
 +- Support for the undocumented and deprecated RAPI instance creation
 +  request format version 0 has been dropped. Use version 1, supported
 +  since Ganeti 2.1.3 and :doc:`documented <rapi>`, instead.
 +- Pyparsing 1.4.6 or above is required, see :doc:`installation
 +  documentation <install>`
 +
 +
+ Version 2.4.3
+ -------------
+ 
+ *(unreleased)*
+ 
+ - Added a new parameter to instance stop/start called ``--no-remember``
+   that will make the state change to not be remembered
+ 
+ 
+ Version 2.4.2
+ -------------
+ 
+ *(Released Thu, 12 May 2011)*
+ 
+ Many bug-fixes and a few new small features:
+ 
+ - Fixed a bug related to log opening failures
+ - Fixed a bug in instance listing with orphan instances
+ - Fixed a bug which prevented resetting the cluster-level node parameter
+   ``oob_program`` to the default
+ - Many fixes related to the ``cluster-merge`` tool
+ - Fixed a race condition in the lock monitor, which caused failures
+   during (at least) creation of many instances in parallel
+ - Improved output for gnt-job info
+ - Removed the quiet flag on some ssh calls which prevented debugging
+   failures
+ - Improved the N+1 failure messages in cluster verify by actually
+   showing the memory values (needed and available)
+ - Increased lock attempt timeouts so that when executing long operations
+   (e.g. DRBD replace-disks) other jobs do not enter 'blocking acquire'
+   too early and thus prevent the use of the 'fair' mechanism
+ - Changed instance query data (``gnt-instance info``) to not acquire
+   locks unless needed, thus allowing its use on locked instance if only
+   static information is asked for
+ - Improved behaviour with filesystems that do not support rename on an
+   opened file
+ - Fixed the behaviour of ``prealloc_wipe_disks`` cluster parameter which
+   kept locks on all nodes during the wipe, which is unneeded
+ - Fixed ``gnt-watcher`` handling of errors during hooks execution
+ - Fixed bug in ``prealloc_wipe_disks`` with small disk sizes (less than
+   10GiB) which caused the wipe to fail right at the end in some cases
+ - Fixed master IP activation when doing master failover with no-voting
+ - Fixed bug in ``gnt-node add --readd`` which allowed the re-adding of
+   the master node itself
+ - Fixed potential data-loss in under disk full conditions, where Ganeti
+   wouldn't check correctly the return code and would consider
+   partially-written files 'correct'
+ - Fixed bug related to multiple VGs and DRBD disk replacing
+ - Added new disk parameter ``metavg`` that allows placement of the meta
+   device for DRBD in a different volume group
+ - Fixed error handling in the node daemon when the system libc doesn't
+   have major number 6 (i.e. if ``libc.so.6`` is not the actual libc)
+ - Fixed lock release during replace-disks, which kept cluster-wide locks
+   when doing disk replaces with an iallocator script
+ - Added check for missing bridges in cluster verify
+ - Handle EPIPE errors while writing to the terminal better, so that
+   piping the output to e.g. ``less`` doesn't cause a backtrace
+ - Fixed rare case where a ^C during Luxi calls could have been
+   interpreted as server errors, instead of simply terminating
+ - Fixed a race condition in LUGroupAssignNodes (``gnt-group
+   assign-nodes``)
+ - Added a few more parameters to the KVM hypervisor, allowing a second
+   CDROM, custom disk type for CDROMs and a floppy image
+ - Removed redundant message in instance rename when the name is given
+   already as a FQDN
+ - Added option to ``gnt-instance recreate-disks`` to allow creating the
+   disks on new nodes, allowing recreation when the original instance
+   nodes are completely gone
+ - Added option when converting disk templates to DRBD to skip waiting
+   for the resync, in order to make the instance available sooner
+ - Added two new variables to the OS scripts environment (containing the
+   instance's nodes)
+ - Made the root_path and optional parameter for the xen-pvm hypervisor,
+   to allow use of ``pvgrub`` as bootloader
+ - Changed the instance memory modifications to only check out-of-memory
+   conditions on memory increases, and turned the secondary node warnings
+   into errors (they can still be overridden via ``--force``)
+ - Fixed the handling of a corner case when the Python installation gets
+   corrupted (e.g. a bad disk) while ganeti-noded is running and we try
+   to execute a command that doesn't exist
+ - Fixed a bug in ``gnt-instance move`` (LUInstanceMove) when the primary
+   node of the instance returned failures during instance shutdown; this
+   adds the option ``--ignore-consistency`` to gnt-instance move
+ 
+ And as usual, various improvements to the error messages, documentation
+ and man pages.
+ 
  Version 2.4.1
  -------------
  
diff --cc lib/cli.py
index 1cb4c41,766981e..10bcf95
--- a/lib/cli.py
+++ b/lib/cli.py
@@@ -1184,19 -1150,12 +1185,25 @@@ NODE_POWERED_OPT = cli_option("--node-p
                                dest="node_powered",
                                help="Specify if the SoR for node is powered")
  
 +OOB_TIMEOUT_OPT = cli_option("--oob-timeout", dest="oob_timeout", type="int",
 +                         default=constants.OOB_TIMEOUT,
 +                         help="Maximum time to wait for out-of-band helper")
 +
 +POWER_DELAY_OPT = cli_option("--power-delay", dest="power_delay", 
type="float",
 +                             default=constants.OOB_POWER_DELAY,
 +                             help="Time in seconds to wait between power-ons")
 +
 +FORCE_FILTER_OPT = cli_option("-F", "--filter", dest="force_filter",
 +                              action="store_true", default=False,
 +                              help=("Whether command argument should be 
treated"
 +                                    " as filter"))
 +
+ NO_REMEMBER_OPT = cli_option("--no-remember",
+                              dest="no_remember",
+                              action="store_true", default=False,
+                              help="Perform but do not record the change"
+                              " in the configuration")
+ 
  
  #: Options provided by all commands
  COMMON_OPTS = [DEBUG_OPT]
diff --cc lib/opcodes.py
index 1946284,b89444d..dfae4aa
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@@ -72,48 -67,23 +72,52 @@@ _PGroupName = ("group_name", ht.NoDefau
  
  #: Migration type (live/non-live)
  _PMigrationMode = ("mode", None,
 -                   ht.TOr(ht.TNone, ht.TElemOf(constants.HT_MIGRATION_MODES)))
 +                   ht.TOr(ht.TNone, ht.TElemOf(constants.HT_MIGRATION_MODES)),
 +                   "Migration mode")
  
  #: Obsolete 'live' migration mode (boolean)
 -_PMigrationLive = ("live", None, ht.TMaybeBool)
 +_PMigrationLive = ("live", None, ht.TMaybeBool,
 +                   "Legacy setting for live migration, do not use")
  
  #: Tag type
 -_PTagKind = ("kind", ht.NoDefault, ht.TElemOf(constants.VALID_TAG_TYPES))
 +_PTagKind = ("kind", ht.NoDefault, ht.TElemOf(constants.VALID_TAG_TYPES), 
None)
  
  #: List of tag strings
 -_PTags = ("tags", ht.NoDefault, ht.TListOf(ht.TNonEmptyString))
 +_PTags = ("tags", ht.NoDefault, ht.TListOf(ht.TNonEmptyString), None)
  
 -#: Ignore consistency
 -_PIgnoreConsistency = ("ignore_consistency", False, ht.TBool)
 +_PForceVariant = ("force_variant", False, ht.TBool,
 +                  "Whether to force an unknown OS variant")
 +
 +_PWaitForSync = ("wait_for_sync", True, ht.TBool,
 +                 "Whether to wait for the disk to synchronize")
 +
 +_PIgnoreConsistency = ("ignore_consistency", False, ht.TBool,
 +                       "Whether to ignore disk consistency")
 +
 +_PStorageName = ("name", ht.NoDefault, ht.TMaybeString, "Storage name")
 +
 +_PUseLocking = ("use_locking", False, ht.TBool,
 +                "Whether to use synchronization")
 +
 +_PNameCheck = ("name_check", True, ht.TBool, "Whether to check name")
 +
 +_PNodeGroupAllocPolicy = \
 +  ("alloc_policy", None,
 +   ht.TOr(ht.TNone, ht.TElemOf(constants.VALID_ALLOC_POLICIES)),
 +   "Instance allocation policy")
 +
 +_PGroupNodeParams = ("ndparams", None, ht.TMaybeDict,
 +                     "Default node parameters for group")
 +
 +_PQueryWhat = ("what", ht.NoDefault, ht.TElemOf(constants.QR_VIA_OP),
 +               "Resource(s) to query for")
 +
 +_PIpCheckDoc = "Whether to ensure instance's IP address is inactive"
  
+ #: Do not remember instance state changes
 -_PNoRemember = ("no_remember", False, ht.TBool)
++_PNoRemember = ("no_remember", False, ht.TBool,
++                "Do not remember the state change")
+ 
  #: OP_ID conversion regular expression
  _OPID_RE = re.compile("([a-z])([A-Z])")
  
@@@ -985,9 -840,9 +989,10 @@@ class OpInstanceStartup(OpCode)
      _PInstanceName,
      _PForce,
      _PIgnoreOfflineNodes,
 +    ("hvparams", ht.EmptyDict, ht.TDict,
 +     "Temporary hypervisor parameters, hypervisor-dependent"),
 +    ("beparams", ht.EmptyDict, ht.TDict, "Temporary backend parameters"),
+     _PNoRemember,
 -    ("hvparams", ht.EmptyDict, ht.TDict),
 -    ("beparams", ht.EmptyDict, ht.TDict),
      ]
  
  
@@@ -997,8 -852,8 +1002,9 @@@ class OpInstanceShutdown(OpCode)
    OP_PARAMS = [
      _PInstanceName,
      _PIgnoreOfflineNodes,
 +    ("timeout", constants.DEFAULT_SHUTDOWN_TIMEOUT, ht.TPositiveInt,
 +     "How long to wait for instance to shut down"),
+     _PNoRemember,
 -    ("timeout", constants.DEFAULT_SHUTDOWN_TIMEOUT, ht.TPositiveInt),
      ]
  
  
@@@ -1086,7 -924,8 +1092,8 @@@ class OpInstanceMove(OpCode)
    OP_PARAMS = [
      _PInstanceName,
      _PShutdownTimeout,
 +    ("target_node", ht.NoDefault, ht.TNonEmptyString, "Target node"),
+     _PIgnoreConsistency,
 -    ("target_node", ht.NoDefault, ht.TNonEmptyString),
      ]
  
  
diff --cc lib/rapi/client.py
index 546b58c,eb30794..b752915
--- a/lib/rapi/client.py
+++ b/lib/rapi/client.py
@@@ -870,8 -915,8 +870,10 @@@ class GanetiRapiClient(object): # pylin
      @param instance: the instance to shut down
      @type dry_run: bool
      @param dry_run: whether to perform a dry run
+     @type no_remember: bool
+     @param no_remember: if true, will not record the state change
 +    @rtype: string
 +    @return: job id
  
      """
      query = []
@@@ -889,8 -936,8 +893,10 @@@
      @param instance: the instance to start up
      @type dry_run: bool
      @param dry_run: whether to perform a dry run
+     @type no_remember: bool
+     @param no_remember: if true, will not record the state change
 +    @rtype: string
 +    @return: job id
  
      """
      query = []
diff --cc lib/rapi/rlib2.py
index 1e8c50c,61ff6b7..eef6fc7
--- a/lib/rapi/rlib2.py
+++ b/lib/rapi/rlib2.py
@@@ -869,19 -1004,6 +871,20 @@@ class R_2_instances_name_startup(baserl
      return baserlib.SubmitJob([op])
  
  
- def _ParseShutdownInstanceRequest(name, data, dry_run):
++def _ParseShutdownInstanceRequest(name, data, dry_run, no_remember):
 +  """Parses a request for an instance shutdown.
 +
 +  @rtype: L{opcodes.OpInstanceShutdown}
 +  @return: Instance shutdown opcode
 +
 +  """
 +  return baserlib.FillOpcode(opcodes.OpInstanceShutdown, data, {
 +    "instance_name": name,
 +    "dry_run": dry_run,
++    "no_remember": no_remember,
 +    })
 +
 +
  class R_2_instances_name_shutdown(baserlib.R_Generic):
    """/2/instances/[instance_name]/shutdown resource.
  
@@@ -891,13 -1013,12 +894,14 @@@
    def PUT(self):
      """Shutdown an instance.
  
 +    @return: a job id
 +
      """
 -    instance_name = self.items[0]
 +    baserlib.CheckType(self.request_body, dict, "Body contents")
 +
+     no_remember = bool(self._checkIntVariable('no_remember'))
 -    op = opcodes.OpInstanceShutdown(instance_name=instance_name,
 -                                    dry_run=bool(self.dryRun()),
 -                                    no_remember=no_remember)
 +    op = _ParseShutdownInstanceRequest(self.items[0], self.request_body,
-                                        bool(self.dryRun()))
++                                       bool(self.dryRun()), no_remember)
  
      return baserlib.SubmitJob([op])
  
diff --cc qa/ganeti-qa.py
index cb22862,47c900d..3da6351
--- a/qa/ganeti-qa.py
+++ b/qa/ganeti-qa.py
@@@ -438,10 -411,8 +438,10 @@@ def RunQa()
        instance = RunTest(qa_instance.TestInstanceAddWithPlainDisk, pnode)
        RunCommonInstanceTests(instance)
        RunGroupListTests()
 +      RunTestIf("cluster-epo", qa_cluster.TestClusterEpo)
        RunExportImportTests(instance, pnode, None)
-       RunDaemonTests(instance, pnode)
+       RunDaemonTests(instance)
 +      RunRepairDiskSizes()
        RunTest(qa_instance.TestInstanceRemove, instance)
        del instance
  

Reply via email to