Skip to content

Commit 5337ae8

Browse files
committed
linstor: failed remove of allow-two-primaries is no fatal error
1 parent 6de5e90 commit 5337ae8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,19 +332,21 @@ public boolean disconnectPhysicalDiskByPath(String localPath)
332332
ApiCallRcList answers = api.resourceDefinitionModify(rsc.get().getName(), rdm);
333333
if (answers.hasError())
334334
{
335-
s_logger.error("Failed to remove 'allow-two-primaries' on " + rsc.get().getName());
336-
throw new CloudRuntimeException(answers.get(0).getMessage());
335+
s_logger.error(
336+
String.format("Failed to remove 'allow-two-primaries' on %s: %s",
337+
rsc.get().getName(), LinstorUtil.getBestErrorMessage(answers)));
338+
// do not fail here as removing allow-two-primaries property isn't fatal
337339
}
338340

339341
return true;
340342
}
341343
s_logger.warn("Linstor: Couldn't find resource for this path: " + localPath);
342344
} catch (ApiException apiEx) {
343-
s_logger.error(apiEx);
344-
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
345+
s_logger.error(apiEx.getBestMessage());
346+
// do not fail here as removing allow-two-primaries property isn't fatal
345347
}
346348
}
347-
return false;
349+
return true;
348350
}
349351

350352
@Override

0 commit comments

Comments
 (0)