|
28 | 28 | import javax.naming.ConfigurationException; |
29 | 29 |
|
30 | 30 | import org.apache.cloudstack.api.command.user.vmsnapshot.ListVMSnapshotCmd; |
| 31 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; |
| 32 | +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; |
31 | 33 | import org.apache.log4j.Logger; |
32 | 34 | import org.springframework.stereotype.Component; |
33 | 35 |
|
|
61 | 63 | import com.cloud.storage.GuestOSVO; |
62 | 64 | import com.cloud.storage.Snapshot; |
63 | 65 | import com.cloud.storage.SnapshotVO; |
64 | | -import com.cloud.storage.StoragePoolVO; |
| 66 | +import com.cloud.storage.StoragePool; |
65 | 67 | import com.cloud.storage.VolumeVO; |
66 | 68 | import com.cloud.storage.dao.GuestOSDao; |
67 | 69 | import com.cloud.storage.dao.SnapshotDao; |
@@ -115,6 +117,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana |
115 | 117 | @Inject StoragePoolDao _storagePoolDao; |
116 | 118 | @Inject SnapshotDao _snapshotDao; |
117 | 119 | @Inject VirtualMachineManager _itMgr; |
| 120 | + @Inject DataStoreManager dataStoreMgr; |
118 | 121 | @Inject ConfigurationDao _configDao; |
119 | 122 | int _vmSnapshotMax; |
120 | 123 | StateMachine2<VMSnapshot.State, VMSnapshot.Event, VMSnapshot> _vmSnapshottateMachine ; |
@@ -393,7 +396,7 @@ protected List<VolumeTO> getVolumeTOList(Long vmId) { |
393 | 396 | List<VolumeVO> volumeVos = _volumeDao.findByInstance(vmId); |
394 | 397 |
|
395 | 398 | for (VolumeVO volume : volumeVos) { |
396 | | - StoragePoolVO pool = _storagePoolDao.findById(volume.getPoolId()); |
| 399 | + StoragePool pool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(volume.getPoolId()); |
397 | 400 | VolumeTO volumeTO = new VolumeTO(volume, pool); |
398 | 401 | volumeTOs.add(volumeTO); |
399 | 402 | } |
|
0 commit comments