bug 7528: the vm expunge action wasn't destroying the volumes during vm destroy. Added logic to do that. Also, made sure the volumes are removed during vm expunge

status 7528: resolved fixed
This commit is contained in:
abhishek 2010-12-20 14:50:50 -08:00
parent 626a03ad78
commit 6eacec782e
2 changed files with 10 additions and 3 deletions

View File

@ -278,5 +278,7 @@ public interface StorageManager extends Manager {
void prepare(VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException;
void release(VirtualMachineProfile<? extends VirtualMachine> vm);
//void release(VirtualMachineProfile<? extends VirtualMachine> vm);
void release(VirtualMachineProfile<? extends VMInstanceVO> profile);
}

View File

@ -2881,8 +2881,13 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
}
@Override
public void release(VirtualMachineProfile profile) {
// Right now we don't do anything.
public void release(VirtualMachineProfile<? extends VMInstanceVO> profile) {
//Clean up volumes based on the profile's instance id
List<VolumeVO> volumesForProfile = _volsDao.findByInstance(profile.getId());
for(VolumeVO vol : volumesForProfile){
destroyVolume(vol);
}
}
}