Add check for disks i/o utilization to verifyGaleraStatus method
Related: PROD-28135
Depends-on: https://gerrit.mcp.mirantis.com/#/c/38214/
Change-Id: Ic7ff18789fae76886a3bf13656e0a8fa4a4935ff
diff --git a/src/com/mirantis/mk/Galera.groovy b/src/com/mirantis/mk/Galera.groovy
index 6f25315..351e16a 100644
--- a/src/com/mirantis/mk/Galera.groovy
+++ b/src/com/mirantis/mk/Galera.groovy
@@ -92,6 +92,22 @@
common.errorMsg("No Galera slave was reachable.")
return 130
}
+ def checkTargets = salt.getMinions(env, "I@salt:master or I@salt:minion")
+ for (checkTarget in checkTargets) {
+ def iostatRes = salt.getIostatValues(['saltId': env, 'target': checkTarget, 'parameterName': "%util", 'output': true])
+ if (iostatRes == [:]) {
+ common.errorMsg("Recevived empty response from iostat call on ${checkTarget}. Maybe 'sysstat' package is not installed?")
+ return 140
+ }
+ for (int i = 0; i < iostatRes.size(); i++) {
+ def diskKey = iostatRes.keySet()[i]
+ if (!(iostatRes[diskKey].toString().isBigDecimal() && (iostatRes[diskKey].toBigDecimal() < 0.5 ))) {
+ common.errorMsg("Disk ${diskKey} has to high i/o utilization. Maximum value is 0.5 and current value is ${iostatRes[diskKey]}.")
+ return 141
+ }
+ }
+ }
+ common.infoMsg("Disk i/o utilization was checked and everything seems to be in order.")
if (checkTimeSync && !salt.checkClusterTimeSync(env, "I@galera:master or I@galera:slave")) {
common.errorMsg("Time in cluster is desynchronized or it couldn't be detemined. You should fix this issue manually before proceeding.")
return 131