mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7835: Deleted volumes with null UUID and no removed timestamp in database still appear.
Also removed CREATING -> DESTROY via DESTROYREQUESTED, which was causing the volume to get stuck in expunging state.
This commit is contained in:
parent
7a8f511014
commit
1d503bb853
|
|
@ -69,7 +69,6 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
|
|||
s_fsm.addTransition(Creating, Event.OperationRetry, Creating);
|
||||
s_fsm.addTransition(Creating, Event.OperationFailed, Allocated);
|
||||
s_fsm.addTransition(Creating, Event.OperationSucceeded, Ready);
|
||||
s_fsm.addTransition(Creating, Event.DestroyRequested, Destroy);
|
||||
s_fsm.addTransition(Creating, Event.CreateRequested, Creating);
|
||||
s_fsm.addTransition(Ready, Event.ResizeRequested, Resizing);
|
||||
s_fsm.addTransition(Resizing, Event.OperationSucceeded, Ready);
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,12 @@ public class VolumeServiceImpl implements VolumeService {
|
|||
destroyVolume(srcVolume.getId());
|
||||
srcVolume = volFactory.getVolume(srcVolume.getId());
|
||||
AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
|
||||
destroyFuture.get();
|
||||
// If volume destroy fails, this could be because of vdi is still in use state, so wait and retry.
|
||||
if (destroyFuture.get().isFailed()) {
|
||||
Thread.sleep(5 * 1000);
|
||||
destroyFuture = expungeVolumeAsync(srcVolume);
|
||||
destroyFuture.get();
|
||||
}
|
||||
future.complete(res);
|
||||
} catch (Exception e) {
|
||||
s_logger.debug("failed to clean up volume on storage", e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue