Commit 9b0e86e2 authored by Thomas Thrainer's avatar Thomas Thrainer

Check DRBD status in cluster verify

If the status of DRBD disks is degraded or in a faulty state, issue an
error in cluster verify.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 271d03ff
......@@ -1874,11 +1874,18 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
constants.CV_EINSTANCEFAULTYDISK, instance,
"couldn't retrieve status for disk/%s on %s: %s",
idx, self.cfg.GetNodeName(nname), bdev_status)
self._ErrorIf((inst_config.disks_active and
success and
bdev_status.ldisk_status == constants.LDS_FAULTY),
constants.CV_EINSTANCEFAULTYDISK, instance,
"disk/%s on %s is faulty", idx, self.cfg.GetNodeName(nname))
if inst_config.disks_active and success and \
(bdev_status.is_degraded or
bdev_status.ldisk_status != constants.LDS_OKAY):
msg = "disk/%s on %s" % (idx, self.cfg.GetNodeName(nname))
if bdev_status.is_degraded:
msg += " is degraded"
if bdev_status.ldisk_status != constants.LDS_OKAY:
msg += "; state is '%s'" % \
constants.LDS_NAMES[bdev_status.ldisk_status]
self._Error(constants.CV_EINSTANCEFAULTYDISK, instance, msg)
self._ErrorIf(pnode_img.rpc_fail and not pnode_img.offline,
constants.CV_ENODERPC, pnode, "instance %s, connection to"
......
......@@ -428,6 +428,12 @@ VALID_STORAGE_OPERATIONS = {
LDS_UNKNOWN,
LDS_FAULTY) = range(1, 4)
LDS_NAMES = {
LDS_OKAY: "ok",
LDS_UNKNOWN: "unknown",
LDS_FAULTY: "faulty",
}
# disk template types
DT_BLOCK = "blockdev"
DT_DISKLESS = "diskless"
......
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