mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2104: add state change in createVolume back to Allocated if
anything fails Changes: createVolume changes the volume state from 'Allocated' to 'Creating', but has no code to change it back to 'Allocated' if anything goes wrong, despite there already being a path from 'Creating' to 'Allocated' for volumes, via the OperationFailed event. Adding this in fixes the issue and avoids leaving disks in an unusable state. Testing: Tested in devcloud-kvm, volume that was larger than primary storage failed to attack, and went back to 'Allocated' from 'Creating' upon the failure. I was then able to retry, and delete the disk.
This commit is contained in:
parent
3d37f2a6e8
commit
ccc49875dd
|
|
@ -837,6 +837,11 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
}
|
||||
|
||||
if (created == null) {
|
||||
try {
|
||||
stateTransitTo(volume, Volume.Event.OperationFailed);
|
||||
} catch (NoTransitionException e) {
|
||||
s_logger.debug("Unable to update volume state: " + e.toString());
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
volume.setFolder(pool.getPath());
|
||||
|
|
|
|||
Loading…
Reference in New Issue