mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
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
9168d826da
commit
a53d39c1b6
@ -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);
|
||||
|
||||
@ -1021,11 +1021,20 @@ public class VolumeServiceImpl implements VolumeService {
|
||||
srcVolume.processEvent(Event.OperationSuccessed);
|
||||
destVolume.processEvent(Event.OperationSuccessed, result.getAnswer());
|
||||
_volumeDao.updateUuid(srcVolume.getId(), destVolume.getId());
|
||||
destroyVolume(srcVolume.getId());
|
||||
srcVolume = volFactory.getVolume(srcVolume.getId());
|
||||
AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
|
||||
destroyFuture.get();
|
||||
future.complete(res);
|
||||
try {
|
||||
destroyVolume(srcVolume.getId());
|
||||
srcVolume = volFactory.getVolume(srcVolume.getId());
|
||||
AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
|
||||
// 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);
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
s_logger.debug("Failed to process copy volume callback", e);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user