Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/schema/src/com/cloud/storage/dao/VolumeDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public interface VolumeDao extends GenericDao<VolumeVO, Long>, StateDao<Volume.S

List<VolumeVO> listVolumesToBeDestroyed();

List<VolumeVO> listNonRootVolumesToBeDestroyed(Date date);
List<VolumeVO> listVolumesToBeDestroyed(Date date);

ImageFormat getImageFormat(Long volumeId);

Expand Down
4 changes: 1 addition & 3 deletions engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ public VolumeDaoImpl() {
AllFieldsSearch.and("deviceId", AllFieldsSearch.entity().getDeviceId(), Op.EQ);
AllFieldsSearch.and("poolId", AllFieldsSearch.entity().getPoolId(), Op.EQ);
AllFieldsSearch.and("vType", AllFieldsSearch.entity().getVolumeType(), Op.EQ);
AllFieldsSearch.and("notVolumeType", AllFieldsSearch.entity().getVolumeType(), Op.NEQ);
AllFieldsSearch.and("id", AllFieldsSearch.entity().getId(), Op.EQ);
AllFieldsSearch.and("destroyed", AllFieldsSearch.entity().getState(), Op.EQ);
AllFieldsSearch.and("notDestroyed", AllFieldsSearch.entity().getState(), Op.NEQ);
Expand Down Expand Up @@ -482,10 +481,9 @@ public List<VolumeVO> listVolumesToBeDestroyed() {
}

@Override
public List<VolumeVO> listNonRootVolumesToBeDestroyed(Date date) {
public List<VolumeVO> listVolumesToBeDestroyed(Date date) {
SearchCriteria<VolumeVO> sc = AllFieldsSearch.create();
sc.setParameters("state", Volume.State.Destroy);
sc.setParameters("notVolumeType", Volume.Type.ROOT.toString());
sc.setParameters("updateTime", date);

return listBy(sc);
Expand Down
3 changes: 1 addition & 2 deletions server/src/com/cloud/storage/StorageManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,7 @@ public void cleanupStorage(boolean recurring) {

cleanupSecondaryStorage(recurring);

// ROOT volumes will be destroyed as part of VM cleanup
List<VolumeVO> vols = _volsDao.listNonRootVolumesToBeDestroyed(new Date(System.currentTimeMillis() - ((long) StorageCleanupDelay.value() << 10)));
List<VolumeVO> vols = _volsDao.listVolumesToBeDestroyed(new Date(System.currentTimeMillis() - ((long) StorageCleanupDelay.value() << 10)));
for (VolumeVO vol : vols) {
try {
// If this fails, just log a warning. It's ideal if we clean up the host-side clustered file
Expand Down