mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7337: Volume state remains in allocated after volume creation faliure from snapshot Volume should be marked to Destroy state after creation faliure.
Signed-off-by: Koushik Das <koushik@apache.org>
This commit is contained in:
parent
ab7c1f34d6
commit
8d0817860f
@ -659,8 +659,9 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||||||
return volume;
|
return volume;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
created = false;
|
created = false;
|
||||||
s_logger.debug("Failed to create volume: " + volume.getId(), e);
|
VolumeInfo vol = volFactory.getVolume(cmd.getEntityId());
|
||||||
return null;
|
vol.stateTransit(Volume.Event.DestroyRequested);
|
||||||
|
throw new CloudRuntimeException("Failed to create volume: " + volume.getId(), e);
|
||||||
} finally {
|
} finally {
|
||||||
if (!created) {
|
if (!created) {
|
||||||
s_logger.trace("Decrementing volume resource count for account id=" + volume.getAccountId() + " as volume failed to create on the backend");
|
s_logger.trace("Decrementing volume resource count for account id=" + volume.getAccountId() + " as volume failed to create on the backend");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user