Skip to content

Commit 417aa67

Browse files
ustcweizhouRakesh Venkatesh
authored andcommitted
kvm: Add option 'noaction' for storage issue handling
1 parent 8ace796 commit 417aa67

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/KVMHABase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static enum PoolType {
4545
public enum HeartBeatAction {
4646
HARDRESET("hardreset", "-c"),
4747
DESTROYVMS("destroyvms", "-d"),
48+
NOACTION("noaction", "-n"),
4849
STOPAGENT("stopagent", "-s");
4950

5051
String _action;

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ private void check() {
171171
// Perform action if can't write to heartbeat file.
172172
// This will raise an alert on the mgmt server
173173
s_logger.warn("write heartbeat failed: " + result);
174+
if (HeartBeatAction.NOACTION.equals(s_heartBeatFailureAction)) {
175+
s_logger.warn("No action will be performed on storage pool: " + primaryStoragePool._poolUUID);
176+
_storagePoolCheckStatus.remove(primaryStoragePool._poolUUID);
177+
return true;
178+
}
174179

175180
performAction(primaryStoragePool);
176181
_storagePoolCheckStatus.put(primaryStoragePool._poolUUID, STATUS_TERMINATED);

0 commit comments

Comments
 (0)