Skip to content

Commit 544255b

Browse files
committed
linstor: improve heartbeat check with also asking linstor (apache#10105)
If a node doesn't have a DRBD connection to another node, additionally ask Linstor-Controller if the node is alive. Otherwise we would have simply said no and the node might still be alive. This is always the case in a non hyperconverged setup.
1 parent 78ae2b8 commit 544255b

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

plugins/storage/volume/linstor/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to Linstor CloudStack plugin will be documented in this file
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2024-12-13]
9+
10+
### Fixed
11+
12+
- Linstor heartbeat check now also ask linstor-controller if there is no connection between nodes
13+
814
## [2024-10-28]
915

1016
### Fixed

plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.linbit.linstor.api.DevelopersApi;
3939
import com.linbit.linstor.api.model.ApiCallRc;
4040
import com.linbit.linstor.api.model.ApiCallRcList;
41+
import com.linbit.linstor.api.model.Node;
4142
import com.linbit.linstor.api.model.Properties;
4243
import com.linbit.linstor.api.model.ProviderKind;
4344
import com.linbit.linstor.api.model.Resource;
@@ -704,4 +705,19 @@ public long getUsed(LinstorStoragePool pool) {
704705
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
705706
}
706707
}
708+
709+
public boolean isNodeOnline(LinstorStoragePool pool, String nodeName) {
710+
DevelopersApi linstorApi = getLinstorAPI(pool);
711+
try {
712+
List<Node> node = linstorApi.nodeList(Collections.singletonList(nodeName), Collections.emptyList(), null, null);
713+
if (node == null || node.isEmpty()) {
714+
return false;
715+
}
716+
717+
return Node.ConnectionStatusEnum.ONLINE.equals(node.get(0).getConnectionStatus());
718+
} catch (ApiException apiEx) {
719+
s_logger.error(apiEx.getMessage());
720+
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
721+
}
722+
}
707723
}

0 commit comments

Comments
 (0)