@@ -1809,21 +1809,17 @@ private boolean deleteDataStoreInternal(StoragePoolVO sPool, boolean forced) {
18091809
18101810 protected String getStoragePoolNonDestroyedVolumesLog (long storagePoolId ) {
18111811 StringBuilder sb = new StringBuilder ();
1812- List <VolumeVO > nonDestroyedVols = volumeDao .findNonDestroyedVolumesByPoolId (storagePoolId , null );
1812+ List <VolumeVO > nonDestroyedVols = volumeDao .findByPoolId (storagePoolId , null );
18131813 VMInstanceVO volInstance ;
18141814 List <String > logMessageInfo = new ArrayList <>();
18151815
18161816 sb .append ("[" );
18171817 for (VolumeVO vol : nonDestroyedVols ) {
1818- if (vol .getInstanceId () != null ) {
1819- volInstance = _vmInstanceDao .findById (vol .getInstanceId ());
1820- if (volInstance != null ) {
1821- logMessageInfo .add (String .format ("Volume [%s] (attached to VM [%s])" , vol .getUuid (), volInstance .getUuid ()));
1822- } else {
1823- logMessageInfo .add (String .format ("Volume [%s] (attached VM with ID [%d] doesn't exists)" , vol .getUuid (), vol .getInstanceId ()));
1824- }
1818+ volInstance = _vmInstanceDao .findById (vol .getInstanceId ());
1819+ if (volInstance != null ) {
1820+ logMessageInfo .add (String .format ("Volume [%s] (attached to VM [%s])" , vol .getUuid (), volInstance .getUuid ()));
18251821 } else {
1826- logMessageInfo .add (String .format ("Volume [%s] (not attached to any VM) " , vol .getUuid ()));
1822+ logMessageInfo .add (String .format ("Volume [%s]" , vol .getUuid ()));
18271823 }
18281824 }
18291825 sb .append (String .join (", " , logMessageInfo ));
0 commit comments