rp- commented on code in PR #9832:
URL: https://github.com/apache/cloudstack/pull/9832#discussion_r1820883814
##########
plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java:
##########
@@ -268,17 +270,33 @@ private void allow2PrimariesIfInUse(DevelopersApi api,
String rscName) throws Ap
String inUseNode = LinstorUtil.isResourceInUse(api, rscName);
if (inUseNode != null && !inUseNode.equalsIgnoreCase(localNodeName)) {
// allow 2 primaries for live migration, should be removed by
disconnect on the other end
- ResourceConnectionModify rcm = new ResourceConnectionModify();
- Properties props = new Properties();
- props.put("DrbdOptions/Net/allow-two-primaries", "yes");
- props.put("DrbdOptions/Net/protocol", "C");
- rcm.setOverrideProps(props);
- ApiCallRcList answers = api.resourceConnectionModify(rscName,
inUseNode, localNodeName, rcm);
- if (answers.hasError()) {
- s_logger.error(String.format(
- "Unable to set protocol C and 'allow-two-primaries' on
%s/%s/%s",
- inUseNode, localNodeName, rscName));
- // do not fail here as adding allow-two-primaries property is
only a problem while live migrating
+
+ // if non hyperconverged setup, we have to set allow-two-primaries
on the resource-definition
+ // as there is no resource connection between diskless nodes.
+ if (LinstorUtil.areResourcesDiskless(api, rscName,
Arrays.asList(inUseNode, localNodeName))) {
+ ResourceDefinitionModify rdm = new ResourceDefinitionModify();
+ Properties props = new Properties();
+ props.put("DrbdOptions/Net/allow-two-primaries", "yes");
+ props.put("DrbdOptions/Net/protocol", "C");
+ rdm.setOverrideProps(props);
+ ApiCallRcList answers = api.resourceDefinitionModify(rscName,
rdm);
+ if (answers.hasError()) {
+ s_logger.error(String.format("Unable to set protocol C and
'allow-two-primaries' on %s", rscName));
+ // do not fail here as adding allow-two-primaries property
is only a problem while live migrating
+ }
+ } else {
+ ResourceConnectionModify rcm = new ResourceConnectionModify();
+ Properties props = new Properties();
+ props.put("DrbdOptions/Net/allow-two-primaries", "yes");
+ props.put("DrbdOptions/Net/protocol", "C");
+ rcm.setOverrideProps(props);
+ ApiCallRcList answers = api.resourceConnectionModify(rscName,
inUseNode, localNodeName, rcm);
+ if (answers.hasError()) {
+ s_logger.error(String.format(
+ "Unable to set protocol C and
'allow-two-primaries' on %s/%s/%s",
+ inUseNode, localNodeName, rscName));
+ // do not fail here as adding allow-two-primaries property
is only a problem while live migrating
+ }
Review Comment:
done and the other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]