Commit ce445897 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Merge branch 'stable-2.5' into devel-2.5



* stable-2.5:
  Bump version for 2.5.0 final release
  configure.ac: Fix “too many arguments” error
  Fix extra whitespace
  Further fixes concerning drbd port release
  Fix a bug concerning TCP port release
  Fix extra whitespace
  Fix a bug concerning TCP port release
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parents 8e2ed2e8 c434401a
......@@ -2,10 +2,10 @@ News
====
Version 2.5.0 rc6
-----------------
Version 2.5.0
-------------
*(Released Fri, 23 Mar 2012)*
*(Released Thu, 12 Apr 2012)*
Incompatible/important changes and bugfixes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -41,6 +41,8 @@ Incompatible/important changes and bugfixes
- Offline nodes are ignored when failing over an instance.
- Support for KVM version 1.0, which changed the version reporting format
from 3 to 2 digits.
- TCP/IP ports used by DRBD disks are returned to a pool upon instance
removal.
- ``Makefile`` is now compatible with Automake 1.11.2
- Includes all bugfixes made in the 2.4 series
......@@ -134,9 +136,19 @@ Misc
- A short delay when waiting for job changes reduces the number of LUXI
requests significantly.
- DRBD metadata volumes are overwritten with zeros during disk creation.
- Out-of-band commands no longer acquire the cluster lock in exclusive
mode.
- ``devel/upload`` now uses correct permissions for directories.
Version 2.5.0 rc6
-----------------
*(Released Fri, 23 Mar 2012)*
This was the sixth release candidate of the 2.5 series.
Version 2.5.0 rc5
-----------------
......
......@@ -2,7 +2,7 @@
m4_define([gnt_version_major], [2])
m4_define([gnt_version_minor], [5])
m4_define([gnt_version_revision], [0])
m4_define([gnt_version_suffix], [~rc6])
m4_define([gnt_version_suffix], [])
m4_define([gnt_version_full],
m4_format([%d.%d.%d%s],
gnt_version_major, gnt_version_minor,
......@@ -450,7 +450,7 @@ AC_SUBST(HTOOLS_APIDOC)
fi # end if enable_htools, define automake conditions
AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
AM_CONDITIONAL([WANT_HTOOLSTESTS], [test x$GHC_PKG_QUICKCHECK != x])
AM_CONDITIONAL([WANT_HTOOLSTESTS], [test "x$GHC_PKG_QUICKCHECK" != x])
AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
SOCAT_USE_ESCAPE=
......
......@@ -6640,7 +6640,7 @@ def _RemoveInstance(lu, feedback_fn, instance, ignore_failures):
"""
logging.info("Removing block devices for instance %s", instance.name)
if not _RemoveDisks(lu, instance):
if not _RemoveDisks(lu, instance, ignore_failures=ignore_failures):
if not ignore_failures:
raise errors.OpExecError("Can't remove instance's disks")
feedback_fn("Warning: can't remove instance's disks")
......@@ -8000,7 +8000,7 @@ def _CreateDisks(lu, instance, to_skip=None, target_node=None):
_CreateBlockDev(lu, node, instance, device, f_create, info, f_create)
def _RemoveDisks(lu, instance, target_node=None):
def _RemoveDisks(lu, instance, target_node=None, ignore_failures=False):
"""Remove all disks for an instance.
This abstracts away some work from `AddInstance()` and
......@@ -8021,6 +8021,7 @@ def _RemoveDisks(lu, instance, target_node=None):
logging.info("Removing block devices for instance %s", instance.name)
all_result = True
ports_to_release = set()
for device in instance.disks:
if target_node:
edata = [(target_node, device)]
......@@ -8036,8 +8037,11 @@ def _RemoveDisks(lu, instance, target_node=None):
# if this is a DRBD disk, return its port to the pool
if device.dev_type in constants.LDS_DRBD:
tcp_port = device.logical_id[2]
lu.cfg.AddTcpUdpPort(tcp_port)
ports_to_release.add(device.logical_id[2])
if all_result or ignore_failures:
for port in ports_to_release:
lu.cfg.AddTcpUdpPort(port)
if instance.disk_template == constants.DT_FILE:
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1])
......@@ -11252,6 +11256,12 @@ class LUInstanceSetParams(LogicalUnit):
child.size = parent.size
child.mode = parent.mode
# this is a DRBD disk, return its port to the pool
# NOTE: this must be done right before the call to cfg.Update!
for disk in old_disks:
tcp_port = disk.logical_id[2]
self.cfg.AddTcpUdpPort(tcp_port)
# update instance structure
instance.disks = new_disks
instance.disk_template = constants.DT_PLAIN
......@@ -11274,11 +11284,6 @@ class LUInstanceSetParams(LogicalUnit):
self.LogWarning("Could not remove metadata for disk %d on node %s,"
" continuing anyway: %s", idx, pnode, msg)
# this is a DRBD disk, return its port to the pool
for disk in old_disks:
tcp_port = disk.logical_id[2]
self.cfg.AddTcpUdpPort(tcp_port)
def Exec(self, feedback_fn):
"""Modifies an instance.
......
#
#
# 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
......@@ -654,12 +654,15 @@ class ConfigWriter:
def AddTcpUdpPort(self, port):
"""Adds a new port to the available port pool.
@warning: this method does not "flush" the configuration (via
L{_WriteConfig}); callers should do that themselves once the
configuration is stable
"""
if not isinstance(port, int):
raise errors.ProgrammerError("Invalid type passed for port")
self._config_data.cluster.tcpudp_port_pool.add(port)
self._WriteConfig()
@locking.ssynchronized(_config_lock, shared=1)
def GetPortList(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment