mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-4038. State of the DATA volumes remains in Allocated state if they are deleted before using them.
If a volume is in Allocated state i.e. not present in primary or secondary mark the volume as removed.
This commit is contained in:
parent
323f246765
commit
eac3631abe
@ -1337,6 +1337,12 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
|
||||
Volume.class.getName(), volume.getUuid());
|
||||
}
|
||||
}
|
||||
// Mark volume as removed if volume has not been created on primary or secondary
|
||||
if (volume.getState() == Volume.State.Allocated) {
|
||||
_volsDao.remove(volumeId);
|
||||
stateTransitTo(volume, Volume.Event.DestroyRequested);
|
||||
return true;
|
||||
}
|
||||
// expunge volume from primary if volume is on primary
|
||||
VolumeInfo volOnPrimary = volFactory.getVolume(volume.getId(), DataStoreRole.Primary);
|
||||
if (volOnPrimary != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user