Revision 15cf9cbb lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
1287 | 1287 |
EINSTANCEMISSINGDISK = (TINSTANCE, "EINSTANCEMISSINGDISK") |
1288 | 1288 |
EINSTANCEWRONGNODE = (TINSTANCE, "EINSTANCEWRONGNODE") |
1289 | 1289 |
ENODEDRBD = (TNODE, "ENODEDRBD") |
1290 |
ENODEDRBDHELPER = (TNODE, "ENODEDRBDHELPER") |
|
1290 | 1291 |
ENODEFILECHECK = (TNODE, "ENODEFILECHECK") |
1291 | 1292 |
ENODEHOOKS = (TNODE, "ENODEHOOKS") |
1292 | 1293 |
ENODEHV = (TNODE, "ENODEHV") |
... | ... | |
1715 | 1716 |
"file '%s' should not exist" |
1716 | 1717 |
" on non master candidates", file_name) |
1717 | 1718 |
|
1718 |
def _VerifyNodeDrbd(self, ninfo, nresult, instanceinfo, drbd_map): |
|
1719 |
def _VerifyNodeDrbd(self, ninfo, nresult, instanceinfo, drbd_helper, |
|
1720 |
drbd_map): |
|
1719 | 1721 |
"""Verifies and the node DRBD status. |
1720 | 1722 |
|
1721 | 1723 |
@type ninfo: L{objects.Node} |
1722 | 1724 |
@param ninfo: the node to check |
1723 | 1725 |
@param nresult: the remote results for the node |
1724 | 1726 |
@param instanceinfo: the dict of instances |
1727 |
@param drbd_helper: the configured DRBD usermode helper |
|
1725 | 1728 |
@param drbd_map: the DRBD map as returned by |
1726 | 1729 |
L{ganeti.config.ConfigWriter.ComputeDRBDMap} |
1727 | 1730 |
|
... | ... | |
1729 | 1732 |
node = ninfo.name |
1730 | 1733 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103 |
1731 | 1734 |
|
1735 |
if drbd_helper: |
|
1736 |
helper_result = nresult.get(constants.NV_DRBDHELPER, None) |
|
1737 |
test = (helper_result == None) |
|
1738 |
_ErrorIf(test, self.ENODEDRBDHELPER, node, |
|
1739 |
"no drbd usermode helper returned") |
|
1740 |
if helper_result: |
|
1741 |
status, payload = helper_result |
|
1742 |
test = not status |
|
1743 |
_ErrorIf(test, self.ENODEDRBDHELPER, node, |
|
1744 |
"drbd usermode helper check unsuccessful: %s", payload) |
|
1745 |
test = status and (payload != drbd_helper) |
|
1746 |
_ErrorIf(test, self.ENODEDRBDHELPER, node, |
|
1747 |
"wrong drbd usermode helper: %s", payload) |
|
1748 |
|
|
1732 | 1749 |
# compute the DRBD minors |
1733 | 1750 |
node_drbd = {} |
1734 | 1751 |
for minor, instance in drbd_map[node].items(): |
... | ... | |
1979 | 1996 |
_ErrorIf(errcode, self.ECLUSTERCERT, None, msg, code=errcode) |
1980 | 1997 |
|
1981 | 1998 |
vg_name = self.cfg.GetVGName() |
1999 |
drbd_helper = self.cfg.GetDRBDHelper() |
|
1982 | 2000 |
hypervisors = self.cfg.GetClusterInfo().enabled_hypervisors |
1983 | 2001 |
cluster = self.cfg.GetClusterInfo() |
1984 | 2002 |
nodelist = utils.NiceSort(self.cfg.GetNodeList()) |
... | ... | |
2030 | 2048 |
node_verify_param[constants.NV_PVLIST] = [vg_name] |
2031 | 2049 |
node_verify_param[constants.NV_DRBDLIST] = None |
2032 | 2050 |
|
2051 |
if drbd_helper: |
|
2052 |
node_verify_param[constants.NV_DRBDHELPER] = drbd_helper |
|
2053 |
|
|
2033 | 2054 |
# Build our expected cluster state |
2034 | 2055 |
node_image = dict((node.name, self.NodeImage(offline=node.offline, |
2035 | 2056 |
name=node.name)) |
... | ... | |
2110 | 2131 |
self._VerifyNodeLVM(node_i, nresult, vg_name) |
2111 | 2132 |
self._VerifyNodeFiles(node_i, nresult, file_names, local_checksums, |
2112 | 2133 |
master_files) |
2113 |
self._VerifyNodeDrbd(node_i, nresult, instanceinfo, all_drbd_map) |
|
2134 |
self._VerifyNodeDrbd(node_i, nresult, instanceinfo, drbd_helper, |
|
2135 |
all_drbd_map) |
|
2114 | 2136 |
self._VerifyNodeTime(node_i, nresult, nvinfo_starttime, nvinfo_endtime) |
2115 | 2137 |
|
2116 | 2138 |
self._UpdateNodeVolumes(node_i, nresult, nimg, vg_name) |
Also available in: Unified diff