mirror of https://github.com/apache/cloudstack.git
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;
|
||||
} catch (Exception e) {
|
||||
created = false;
|
||||
s_logger.debug("Failed to create volume: " + volume.getId(), e);
|
||||
return null;
|
||||
VolumeInfo vol = volFactory.getVolume(cmd.getEntityId());
|
||||
vol.stateTransit(Volume.Event.DestroyRequested);
|
||||
throw new CloudRuntimeException("Failed to create volume: " + volume.getId(), e);
|
||||
} finally {
|
||||
if (!created) {
|
||||
s_logger.trace("Decrementing volume resource count for account id=" + volume.getAccountId() + " as volume failed to create on the backend");
|
||||
|
|
|
|||
Loading…
Reference in New Issue