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:
Likitha Shetty 2013-08-06 15:30:11 +05:30
parent 323f246765
commit eac3631abe

View File

@ -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) {