Commit f2b58d93 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Merge branch 'stable-2.7' into stable-2.8



* stable-2.7:
  Add a warning about the restriction of gnt-node evacuate
  Fix permissions of the queue archive dir
  Fix daemon QA tests
  grow disk: call SetDiskID before blockdev_getsize
  Catch DeviceCreationError unhandled exceptions

Conflicts:
	lib/cmdlib.py (due to the cmdlib split)
	qa/qa_daemon.py (trivial)
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parents 27df5b73 1b3fbef6
......@@ -1412,6 +1412,7 @@ class LUInstanceGrowDisk(LogicalUnit):
if wipe_disks:
# Get disk size from primary node for wiping
self.cfg.SetDiskID(disk, instance.primary_node)
result = self.rpc.call_blockdev_getsize(instance.primary_node, [disk])
result.Raise("Failed to retrieve disk size from node '%s'" %
instance.primary_node)
......@@ -2166,9 +2167,12 @@ class TLReplaceDisks(Tasklet):
# we pass force_create=True to force the LVM creation
for new_lv in new_lvs:
_CreateBlockDevInner(self.lu, node_name, self.instance, new_lv, True,
GetInstanceInfoText(self.instance), False,
excl_stor)
try:
_CreateBlockDevInner(self.lu, node_name, self.instance, new_lv, True,
GetInstanceInfoText(self.instance), False,
excl_stor)
except errors.DeviceCreationError, e:
raise errors.OpExecError("Can't create block device: %s" % e.message)
return iv_names
......@@ -2383,9 +2387,12 @@ class TLReplaceDisks(Tasklet):
(self.new_node, idx))
# we pass force_create=True to force LVM creation
for new_lv in dev.children:
_CreateBlockDevInner(self.lu, self.new_node, self.instance, new_lv,
True, GetInstanceInfoText(self.instance), False,
excl_stor)
try:
_CreateBlockDevInner(self.lu, self.new_node, self.instance, new_lv,
True, GetInstanceInfoText(self.instance), False,
excl_stor)
except errors.DeviceCreationError, e:
raise errors.OpExecError("Can't create block device: %s" % e.message)
# Step 4: dbrd minors and drbd setups changes
# after this, we must manually remove the drbd minors on both the
......
......@@ -170,7 +170,7 @@ def GetPaths():
getent.masterd_uid, getent.daemons_gid, False),
(pathutils.JOB_QUEUE_VERSION_FILE, FILE, constants.JOB_QUEUE_FILES_PERMS,
getent.masterd_uid, getent.daemons_gid, False),
(pathutils.JOB_QUEUE_ARCHIVE_DIR, DIR, 0740,
(pathutils.JOB_QUEUE_ARCHIVE_DIR, DIR, 0750,
getent.masterd_uid, getent.daemons_gid),
(rapi_dir, DIR, 0750, getent.rapi_uid, getent.masterd_gid),
(pathutils.RAPI_USERS_FILE, FILE, 0640,
......
......@@ -131,6 +131,15 @@ Example::
# gnt-node evacuate -I hail node3.example.com
Note that, due to an issue with the iallocator interface, evacuation of
all instances at once is not yet implemented. Full evacuation can
currently be achieved by sequentially evacuating primaries and
secondaries.
::
# gnt-node evacuate -p node3.example.com
# gnt-node evacuate -s node3.example.com
FAILOVER
~~~~~~~~
......
......@@ -61,6 +61,18 @@ def _ShutdownInstance(name):
raise qa_error.Error("instance shutdown failed")
def _StartInstance(name):
"""Starts instance and waits for completion.
@param name: full name of the instance
"""
AssertCommand(["gnt-instance", "start", name])
if not bool(_InstanceRunning(name)):
raise qa_error.Error("instance start failed")
def _ResetWatcherDaemon():
"""Removes the watcher daemon's state file.
......@@ -130,6 +142,7 @@ def TestInstanceConsecutiveFailures(instance):
"""
inst_name = qa_utils.ResolveInstanceName(instance.name)
inst_was_running = bool(_InstanceRunning(inst_name))
_ResetWatcherDaemon()
......@@ -146,3 +159,6 @@ def TestInstanceConsecutiveFailures(instance):
raise qa_error.Error(msg)
AssertCommand(["gnt-instance", "info", inst_name])
if inst_was_running:
_StartInstance(inst_name)
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