Commit e8c86ab1 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Merge branch 'stable-2.9' into master



* stable-2.9
  Version bump for 2.9.0 rc2
  Update NEWS for 2.9.0 rc2
  Downgrade 'vif_script'
  Downgrade 'xen_cmd'
  Add test cluster config for version 2.9
  Remove superfluous import of 'errors'
  Start NEWS entry for 2.9.0 rc2
  Fix lint errors
  Fix upgrade and downgrade regarding disk.dev_type
  Rename LDS_DRBD to DTS_DRBD

* stable-2.8
  Fix typo in walkthrough documentation
  Don't attemp ipv6 ssh in case of ipv4 cluster
  Fix outdated documentation for users-setup

Conflicts:
	NEWS: trivial
	configure.ac: ignore suffix bump on stable-2.9
	lib/constants.py: manually replay 66a37e on master
	lib/objects.py: manually apply the LDS -> DTS change on master
	test/data/cluster_config_2.9.json: take version of stable-2.9
	tools/cfgupgrade: union of all Upgrade tasks, remove all downgrade paths from stable-2.9
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarJose A. Lopes <jabolopes@google.com>
parents 7e65c12c 43fad017
......@@ -26,10 +26,10 @@ New features
procedure between two Ganeti versions that are both 2.10 or higher.
Version 2.9.0 rc1
Version 2.9.0 rc2
-----------------
*(Released Tue, 1 Oct 2013)*
*(Released Wed, 9 Oct 2013)*
Incompatible/important changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -95,8 +95,21 @@ Haskell
- ``hslogger`` (http://software.complete.org/hslogger) is now always
required, even if confd is not enabled.
Since 2.9.0 beta1
~~~~~~~~~~~~~~~~~
Since 2.9.0 rc1
~~~~~~~~~~~~~~~
- Fix bug in cfgupgrade that led to failure when upgrading from 2.8 with
at least one DRBD instance.
- Fix bug in cfgupgrade that led to an invalid 2.8 configuration after
downgrading.
Version 2.9.0 rc1
-----------------
*(Released Tue, 1 Oct 2013)*
The first release candidate in the 2.9 series. Since 2.9.0 beta1:
- various bug fixes
- update of the documentation, in particular installation instructions
......
......@@ -1791,7 +1791,11 @@ permissions to files and programs to be correct.
The ``users-setup`` tool, when run, takes care of setting up the proper
users and groups.
The tool does not accept any parameter, and requires root permissions to run.
When invoked without parameters, the tool runs in interactive mode, showing the
list of actions it will perform and asking for confirmation before proceeding.
Providing the ``--yes-do-it`` parameter to the tool prevents the confirmation
from being asked, and the users and groups will be created immediately.
.. TODO: document cluster-merge tool
......
......@@ -274,7 +274,7 @@ Creation
At this point, Ganeti and the hardware seems to be functioning
correctly, so we'll follow up with creating the instances manually::
$ gnt-instance add -t drbd -o debootstrap -s %256m% %instance3%
$ gnt-instance add -t drbd -o debootstrap -s %256m% %instance1%
Mon Oct 26 04:06:52 2009 - INFO: Selected nodes for instance instance1 via iallocator hail: node2, node3
Mon Oct 26 04:06:53 2009 * creating instance disks...
Mon Oct 26 04:06:57 2009 adding instance instance1 to cluster config
......
......@@ -3305,7 +3305,7 @@ class LUInstanceSetParams(LogicalUnit):
self.cfg.GetNodeName(node_uuid), msg)
# if this is a DRBD disk, return its port to the pool
if root.dev_type in constants.LDS_DRBD:
if root.dev_type in constants.DTS_DRBD:
self.cfg.AddTcpUdpPort(root.logical_id[2])
def _CreateNewNic(self, idx, params, private):
......
......@@ -339,7 +339,7 @@ class LUInstanceQueryData(NoHooksLU):
"""
drbd_info = None
if dev.dev_type in constants.LDS_DRBD:
if dev.dev_type in constants.DTS_DRBD:
# we change the snode then (otherwise we use the one passed in)
if dev.logical_id[0] == instance.primary_node:
snode_uuid = dev.logical_id[1]
......
......@@ -283,7 +283,7 @@ def RemoveDisks(lu, instance, target_node_uuid=None, ignore_failures=False):
all_result = False
# if this is a DRBD disk, return its port to the pool
if device.dev_type in constants.LDS_DRBD:
if device.dev_type in constants.DTS_DRBD:
ports_to_release.add(device.logical_id[2])
if all_result or ignore_failures:
......
......@@ -715,7 +715,7 @@ class ConfigWriter(object):
# gather the drbd ports for duplicate checks
for (idx, dsk) in enumerate(instance.disks):
if dsk.dev_type in constants.LDS_DRBD:
if dsk.dev_type in constants.DTS_DRBD:
tcp_port = dsk.logical_id[2]
if tcp_port not in ports:
ports[tcp_port] = []
......
......@@ -317,6 +317,8 @@ DTS_EXCL_STORAGE = _constants.DTS_EXCL_STORAGE
DTS_NO_FREE_SPACE_CHECK = _constants.DTS_NO_FREE_SPACE_CHECK
DTS_BLOCK = _constants.DTS_BLOCK
DTS_DRBD = _constants.DTS_DRBD
DRBD_HMAC_ALG = _constants.DRBD_HMAC_ALG
DRBD_DEFAULT_NET_PROTOCOL = _constants.DRBD_DEFAULT_NET_PROTOCOL
DRBD_MIGRATION_NET_PROTOCOL = _constants.DRBD_MIGRATION_NET_PROTOCOL
......@@ -349,8 +351,6 @@ FD_BLKTAP = _constants.FD_BLKTAP
FD_LOOP = _constants.FD_LOOP
FILE_DRIVER = _constants.FILE_DRIVER
LDS_DRBD = _constants.LDS_DRBD
DISK_RDONLY = _constants.DISK_RDONLY
DISK_RDWR = _constants.DISK_RDWR
DISK_ACCESS_SET = _constants.DISK_ACCESS_SET
......
......@@ -587,7 +587,7 @@ class Disk(ConfigObject):
constants.DT_BLOCK, constants.DT_RBD,
constants.DT_EXT, constants.DT_SHARED_FILE]:
result = [node_uuid]
elif self.dev_type in constants.LDS_DRBD:
elif self.dev_type in constants.DTS_DRBD:
result = [self.logical_id[0], self.logical_id[1]]
if node_uuid not in result:
raise errors.ConfigurationError("DRBD device passed unknown node")
......@@ -716,7 +716,7 @@ class Disk(ConfigObject):
child.UpdateDynamicDiskParams(target_node_uuid, nodes_ip)
dyn_disk_params = {}
if self.logical_id is not None and self.dev_type in constants.LDS_DRBD:
if self.logical_id is not None and self.dev_type in constants.DTS_DRBD:
pnode_uuid, snode_uuid, _, pminor, sminor, _ = self.logical_id
if target_node_uuid not in (pnode_uuid, snode_uuid):
# disk object is being sent to neither the primary nor the secondary
......@@ -771,7 +771,7 @@ class Disk(ConfigObject):
obj.children = outils.ContainerFromDicts(obj.children, list, Disk)
if obj.logical_id and isinstance(obj.logical_id, list):
obj.logical_id = tuple(obj.logical_id)
if obj.dev_type in constants.LDS_DRBD:
if obj.dev_type in constants.DTS_DRBD:
# we need a tuple of length six here
if len(obj.logical_id) < 6:
obj.logical_id += (None,) * (6 - len(obj.logical_id))
......@@ -783,7 +783,7 @@ class Disk(ConfigObject):
"""
if self.dev_type == constants.DT_PLAIN:
val = "<LogicalVolume(/dev/%s/%s" % self.logical_id
elif self.dev_type in constants.LDS_DRBD:
elif self.dev_type in constants.DTS_DRBD:
node_a, node_b, port, minor_a, minor_b = self.logical_id[:5]
val = "<DRBD8("
......@@ -1092,7 +1092,7 @@ class Instance(TaggableObject):
"""
def _Helper(nodes, device):
"""Recursively computes nodes given a top device."""
if device.dev_type in constants.LDS_DRBD:
if device.dev_type in constants.DTS_DRBD:
nodea, nodeb = device.logical_id[:2]
nodes.add(nodea)
nodes.add(nodeb)
......@@ -1150,7 +1150,7 @@ class Instance(TaggableObject):
if dev.dev_type == constants.DT_PLAIN:
lvmap[node_uuid].append(dev.logical_id[0] + "/" + dev.logical_id[1])
elif dev.dev_type in constants.LDS_DRBD:
elif dev.dev_type in constants.DTS_DRBD:
if dev.children:
self.MapLVsByNode(lvmap, dev.children, dev.logical_id[0])
self.MapLVsByNode(lvmap, dev.children, dev.logical_id[1])
......
......@@ -183,6 +183,8 @@ class SshRunner:
if self.ipv6:
options.append("-6")
else:
options.append("-4")
return options
......
......@@ -908,8 +908,8 @@ fileDriver =
map Types.fileDriverToRaw [minBound..]
-- | The set of drbd-like disk types
ldsDrbd :: FrozenSet String
ldsDrbd = ConstantUtils.mkSet [Types.diskTemplateToRaw DTDrbd8]
dtsDrbd :: FrozenSet String
dtsDrbd = ConstantUtils.mkSet [Types.diskTemplateToRaw DTDrbd8]
-- * Disk access mode
......
This diff is collapsed.
......@@ -30,7 +30,6 @@ import operator
from ganeti import constants
from ganeti import utils
from ganeti import errors
from ganeti import serializer
from ganeti import netutils
......
......@@ -60,6 +60,12 @@ DOWNGRADE_MAJOR = 2
#: Target minor version for downgrade
DOWNGRADE_MINOR = 9
# map of legacy device types
# (mapping differing old LD_* constants to new DT_* constants)
DEV_TYPE_OLD_NEW = {"lvm": constants.DT_PLAIN, "drbd8": constants.DT_DRBD8}
# (mapping differing new DT_* constants to old LD_* constants)
DEV_TYPE_NEW_OLD = dict((v, k) for k, v in DEV_TYPE_OLD_NEW.items())
class Error(Exception):
"""Generic exception"""
......@@ -183,7 +189,26 @@ def RemovePhysicalId(disk):
del disk["physical_id"]
def ChangeDiskDevType(disk, dev_type_map):
"""Replaces disk's dev_type attributes according to the given map.
This can be used for both, up or downgrading the disks.
"""
if disk["dev_type"] in dev_type_map:
disk["dev_type"] = dev_type_map[disk["dev_type"]]
if "children" in disk:
for child in disk["children"]:
ChangeDiskDevType(child, dev_type_map)
def UpgradeDiskDevType(disk):
"""Upgrades the disks' device type."""
ChangeDiskDevType(disk, DEV_TYPE_OLD_NEW)
def UpgradeInstances(config_data):
"""Upgrades the instances' configuration."""
network2uuid = dict((n["name"], n["uuid"])
for n in config_data["networks"].values())
if "instances" not in config_data:
......@@ -213,6 +238,10 @@ def UpgradeInstances(config_data):
" from '%s' to '%s'",
instance, idx, current, expected)
dobj["iv_name"] = expected
if "dev_type" in dobj:
UpgradeDiskDevType(dobj)
if not "spindles" in dobj:
missing_spindles = True
......@@ -300,7 +329,11 @@ def GetNewNodeIndex(nodes_by_old_key, old_key, new_key_field):
def ChangeNodeIndices(config_data, old_key_field, new_key_field):
def ChangeDiskNodeIndices(disk):
if disk["dev_type"] in constants.LDS_DRBD:
# Note: 'drbd8' is a legacy device type from pre 2.9 and needs to be
# considered when up/downgrading from/to any versions touching 2.9 on the
# way.
drbd_disk_types = set(["drbd8"]) | constants.DTS_DRBD
if disk["dev_type"] in drbd_disk_types:
for i in range(0, 2):
disk["logical_id"][i] = GetNewNodeIndex(nodes_by_old_key,
disk["logical_id"][i],
......
......@@ -393,7 +393,7 @@ class Merger(object):
# Update the DRBD port assignments
# This is a little bit hackish
for dsk in instance_info.disks:
if dsk.dev_type in constants.LDS_DRBD:
if dsk.dev_type in constants.DTS_DRBD:
port = my_config.AllocatePort()
logical_id = list(dsk.logical_id)
......
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