mirror of https://github.com/apache/cloudstack.git
kvm: fix exception in volume statts after storage migration (#3884)
On kvm, the 'path' of volume is the file name on primary storage. we should use 'path' instead of 'uuid' in volume statistics. Fixes: #3878
This commit is contained in:
parent
bbe2bf1a6e
commit
649ed45965
|
|
@ -928,13 +928,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
|
|||
List<VolumeVO> volumes = _volsDao.findByPoolId(pool.getId(), null);
|
||||
List<String> volumeLocators = new ArrayList<String>();
|
||||
for (VolumeVO volume : volumes) {
|
||||
if (volume.getFormat() == ImageFormat.QCOW2) {
|
||||
if (pool.isManaged()) {
|
||||
volumeLocators.add(volume.getPath());
|
||||
} else {
|
||||
volumeLocators.add(volume.getUuid());
|
||||
}
|
||||
} else if (volume.getFormat() == ImageFormat.VHD) {
|
||||
if (volume.getFormat() == ImageFormat.QCOW2 || volume.getFormat() == ImageFormat.VHD) {
|
||||
volumeLocators.add(volume.getPath());
|
||||
} else if (volume.getFormat() == ImageFormat.OVA) {
|
||||
volumeLocators.add(volume.getChainInfo());
|
||||
|
|
|
|||
Loading…
Reference in New Issue