On Fri, Mar 7, 2014 at 7:25 PM, Klaus Aehlig <[email protected]> wrote: > > > > > > commit ac928871577777dffd5b1f37eec4f5f2b5f26f7e > Merge: f1638b0 4cbe513 > Author: Klaus Aehlig <[email protected]> > Date: Fri Mar 7 19:14:53 2014 +0100 > > Merge branch 'stable-2.10' into stable-2.11 > > * stable-2.10 > Revision bump for the 2.10.1 release > Update NEWS file for 2.10.1 > Use node UUIDs for executing LU hook > Add PreparePostHookNodes to LUs > Fix error propagation in post-commit hooks > > * stable-2.9 > Fix error introduced during merge > gnt-cluster copyfile: accept relative paths > > * stable-2.8 > Improve RAPI detection of the watcher > Add patching QA configuration files on buildbots > Enable a timeout for instance shutdown > Allow KVM commands to have a timeout > Allow xen commands to have a timeout > Fix wrong docstring > > Conflicts: > NEWS: take both additions > configure.ac: ignore revision bump > lib/hypervisor/hv_base.py: manually add timeout > parameter to 2.11 version > lib/hypervisor/hv_kvm.py: dito > lib/hypervisor/hv_xen.py: dito > > Signed-off-by: Klaus Aehlig <[email protected]> > > diff --cc NEWS > index 87fedcb,4366cb8..f5b990b > --- a/NEWS > +++ b/NEWS > @@@ -2,65 -2,26 +2,85 @@@ New > ==== > > > +Version 2.11.0 beta1 > +-------------------- > + > +*(Released Wed, 5 Mar 2014)* > + > +Incompatible/important changes > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +- ``gnt-node list`` no longer shows disk space information for shared file > + disk templates because it is not a node attribute. (For example, if you > have > + both the file and shared file disk templates enabled, ``gnt-node list`` > now > + only shows information about the file disk template.) > +- The shared file disk template is now in the new 'sharedfile' storage type. > + As a result, ``gnt-node list-storage -t file`` now only shows information > + about the file disk template and you may use ``gnt-node list-storage -t > + sharedfile`` to query storage information for the shared file disk > template. > +- Over luxi, syntactially incorrect queries are now rejected as a whole; > + before, a 'SumbmitManyJobs' request was partially executed, if the outer > + structure of the request was syntactically correct. As the luxi protocol > + is internal (external applications are expected to use RAPI), the impact > + of this incompatible change should be limited. > +- Queries for nodes, instances, groups, backups and networks are now > + exclusively done via the luxi daemon. Legacy python code was removed, > + as well as the --enable-split-queries configuration option. > +- Orphan volumes errors are demoted to warnings and no longer affect the > exit > + code of ``gnt-cluster verify``. > +- RPC security got enhanced by using different client SSL certificates > + for each node. In this context 'gnt-cluster renew-crypto' got a new > + option '--renew-node-certificates', which renews the client > + certificates of all nodes. After a cluster upgrade from pre-2.11, run > + this to create client certificates and activate this feature. > + > +New features > +~~~~~~~~~~~~ > + > +- Instance moves, backups and imports can now use compression to transfer > the > + instance data. > +- Node groups can be configured to use an SSH port different than the > + default 22. > +- Added experimental support for Gluster distributed file storage as the > + ``gluster`` disk template under the new ``sharedfile`` storage type > through > + automatic management of per-node FUSE mount points. You can configure the > + mount point location at ``gnt-cluster init`` time by using the new > + ``--gluster-storage-dir`` switch. > +- Job scheduling is now handled by luxid, and the maximal number of jobs > running > + in parallel is a run-time parameter of the cluster. > + > +New dependencies > +~~~~~~~~~~~~~~~~ > +The following new dependencies have been added: > + > +For Haskell: > + > +- ``zlib`` library (http://hackage.haskell.org/package/base64-bytestring) > + > +- ``base64-bytestring`` library (http://hackage.haskell.org/package/zlib), > + at least version 1.0.0.0 > + > + > + Version 2.10.1 > + -------------- > + > + *(Released Wed, 5 Mar 2014)* > + > + - Fix incorrect invocation of hooks on offline nodes (issue 742) > + - Fix incorrect exit code of gnt-cluster verify in certain circumstances > + (issue 744) > + > + Inherited from the 2.9 branch: > + > + - Fix overflow problem in hbal that caused it to break when waiting for > + jobs for more than 10 minutes (issue 717) > + - Make hbal properly handle non-LVM storage > + - Properly export and import NIC parameters, and do so in a backwards > + compatible way (issue 716) > + - Fix net-common script in case of routed mode (issue 728) > + - Improve documentation (issues 724, 730) > + > + > Version 2.10.0 > -------------- > > diff --cc lib/hypervisor/hv_base.py > index 6de8817,5ac7490..b521774 > --- a/lib/hypervisor/hv_base.py > +++ b/lib/hypervisor/hv_base.py > @@@ -199,8 -187,10 +200,12 @@@ class BaseHypervisor(object) > @param name: if this parameter is passed, the the instance object > should not be used (will be passed as None), and the shutdown > must be done by name only > + @type timeout: int or None > + @param timeout: if the parameter is not None, a soft shutdown operation > will > + be killed after the specified number of seconds. A hard (forced) > + shutdown cannot have a timeout > + @raise errors.HypervisorError: when a parameter is not valid or > + the instance failed to be stopped > > """ > raise NotImplementedError > diff --cc lib/hypervisor/hv_kvm.py > index 9308f70,dcb4329..859f6ad > --- a/lib/hypervisor/hv_kvm.py > +++ b/lib/hypervisor/hv_kvm.py > @@@ -2024,8 -1985,7 +2024,8 @@@ class KVMHypervisor(hv_base.BaseHypervi > self._SaveKVMRuntime(instance, kvm_runtime) > self._ExecuteKVMRuntime(instance, kvm_runtime, kvmhelp) > > - def _CallMonitorCommand(self, instance_name, command, timeout=None): > + @classmethod > - def _CallMonitorCommand(cls, instance_name, command): > ++ def _CallMonitorCommand(cls, instance_name, command, timeout=None): > """Invoke a command on the instance monitor. > > """ > @@@ -2036,10 -2001,12 +2041,11 @@@ > # 500ms and likely more: socat can't detect the end of the reply and > waits > # for 500ms of no data received before exiting (500 ms is the default > for > # the "-t" parameter). > - socat = ("echo %s | %s STDIO UNIX-CONNECT:%s" % > + socat = ("echo %s | %s %s STDIO UNIX-CONNECT:%s" % > (utils.ShellQuote(command), > + timeout_cmd, > constants.SOCAT_PATH, > - utils.ShellQuote(self._InstanceMonitor(instance_name)))) > - > + utils.ShellQuote(cls._InstanceMonitor(instance_name)))) > result = utils.RunCmd(socat) > if result.failed: > msg = ("Failed to send command '%s' to instance '%s', reason '%s'," > @@@ -2304,8 -2271,8 +2310,8 @@@ > else: > return "pc" > > - def StopInstance(self, instance, force=False, retry=False, name=None, > - timeout=None): > + @classmethod > - def _StopInstance(cls, instance, force=False, name=None): > ++ def _StopInstance(cls, instance, force=False, name=None, timeout=None): > """Stop an instance. > > """ > @@@ -2321,14 -2290,7 +2329,15 @@@ > if force or not acpi: > utils.KillProcess(pid) > else: > - cls._CallMonitorCommand(name, "system_powerdown") > - self._CallMonitorCommand(name, "system_powerdown", timeout) > ++ cls._CallMonitorCommand(name, "system_powerdown", timeout) > + cls._ClearUserShutdown(instance.name) > + > - def StopInstance(self, instance, force=False, retry=False, name=None): > ++ def StopInstance(self, instance, force=False, retry=False, name=None, > ++ timeout=None): > + """Stop an instance. > + > + """ > - self._StopInstance(instance, force, name) > ++ self._StopInstance(instance, force, name=name, timeout=timeout) > > def CleanupInstance(self, instance_name): > """Cleanup after a stopped instance > diff --cc lib/hypervisor/hv_xen.py > index 1e5036b,a2b58da..8eec20c > --- a/lib/hypervisor/hv_xen.py > +++ b/lib/hypervisor/hv_xen.py > @@@ -699,24 -676,7 +715,24 @@@ class XenHypervisor(hv_base.BaseHypervi > > return self._RunXen(["destroy", name], hvparams) > > + # Destroy a domain only if necessary > + # > + # This method checks if the domain has already been destroyed before > + # issuing the 'destroy' command. This step is necessary to handle > + # domains created by other versions of Ganeti. For example, an > + # instance created with 2.10 will be destroy by the > + # '_ShutdownInstance', thus not requiring an additional destroy, > + # which would cause an error if issued. See issue 619. > + def _DestroyInstanceIfAlive(self, name, hvparams): > + instance_info = self.GetInstanceInfo(name, hvparams=hvparams) > + > + if instance_info is None: > + raise errors.HypervisorError("Failed to destroy instance %s, already" > + " destroyed" % name) > + else: > + self._DestroyInstance(name, hvparams) > + > - def _StopInstance(self, name, force, hvparams): > + def _StopInstance(self, name, force, hvparams, timeout): > """Stop an instance. > > @type name: string > @@@ -728,18 -688,16 +744,22 @@@ > @type hvparams: dict of string > @param hvparams: hypervisor parameters of the instance > > + @type timeout: int or None > + @param timeout: a timeout after which the shutdown command should be > killed, > + or None for no timeout > + > """ > + instance_info = self.GetInstanceInfo(name, hvparams=hvparams) > + > + if instance_info is None: > + raise errors.HypervisorError("Failed to shutdown instance %s," > + " not running" % name) > + > if force: > - result = self._DestroyInstance(name, hvparams) > + result = self._DestroyInstanceIfAlive(name, hvparams) > else: > - self._ShutdownInstance(name, hvparams) > + self._ShutdownInstance(name, hvparams, timeout) > - result = self._DestroyInstance(name, hvparams) > + result = self._DestroyInstanceIfAlive(name, hvparams) > > if result is not None and result.failed and \ > self.GetInstanceInfo(name, hvparams=hvparams) is not None: > > -- > Klaus Aehlig > Google Germany GmbH, Dienerstr. 12, 80331 Muenchen > Registergericht und -nummer: Hamburg, HRB 86891 > Sitz der Gesellschaft: Hamburg > Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
LGTM, thanks. Michele -- Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
