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 {
|
try {
|
||||||
unmapVolumeFromAllSdcs(volumeId);
|
unmapVolumeFromAllSdcs(volumeId);
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
Boolean removeVolumeStatus = post(
|
|
||||||
"/instances/Volume::" + volumeId + "/action/removeVolume",
|
try {
|
||||||
"{\"removeMode\":\"ONLY_ME\"}", Boolean.class);
|
Boolean removeVolumeStatus = post(
|
||||||
if (removeVolumeStatus != null) {
|
"/instances/Volume::" + volumeId + "/action/removeVolume",
|
||||||
return removeVolumeStatus;
|
"{\"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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user