mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
PowerFlex: Handle missing volumes gracefully during delete volume (#7924)
This commit is contained in:
parent
2cccd8f754
commit
89e0a4ca25
@ -738,11 +738,20 @@ public class ScaleIOGatewayClientImpl implements ScaleIOGatewayClient {
|
||||
try {
|
||||
unmapVolumeFromAllSdcs(volumeId);
|
||||
} catch (Exception ignored) {}
|
||||
Boolean removeVolumeStatus = post(
|
||||
"/instances/Volume::" + volumeId + "/action/removeVolume",
|
||||
"{\"removeMode\":\"ONLY_ME\"}", Boolean.class);
|
||||
if (removeVolumeStatus != null) {
|
||||
return removeVolumeStatus;
|
||||
|
||||
try {
|
||||
Boolean removeVolumeStatus = post(
|
||||
"/instances/Volume::" + volumeId + "/action/removeVolume",
|
||||
"{\"removeMode\":\"ONLY_ME\"}", Boolean.class);
|
||||
if (removeVolumeStatus != null) {
|
||||
return removeVolumeStatus;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
if (ex instanceof ServerApiException && ex.getMessage().contains("Could not find the volume")) {
|
||||
LOG.warn(String.format("API says deleting volume %s does not exist, handling gracefully", volumeId));
|
||||
return true;
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user