Skip to content

Commit 649ed45

Browse files
authored
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
1 parent bbe2bf1 commit 649ed45

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

server/src/main/java/com/cloud/server/StatsCollector.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -928,13 +928,7 @@ protected void runInContext() {
928928
List<VolumeVO> volumes = _volsDao.findByPoolId(pool.getId(), null);
929929
List<String> volumeLocators = new ArrayList<String>();
930930
for (VolumeVO volume : volumes) {
931-
if (volume.getFormat() == ImageFormat.QCOW2) {
932-
if (pool.isManaged()) {
933-
volumeLocators.add(volume.getPath());
934-
} else {
935-
volumeLocators.add(volume.getUuid());
936-
}
937-
} else if (volume.getFormat() == ImageFormat.VHD) {
931+
if (volume.getFormat() == ImageFormat.QCOW2 || volume.getFormat() == ImageFormat.VHD) {
938932
volumeLocators.add(volume.getPath());
939933
} else if (volume.getFormat() == ImageFormat.OVA) {
940934
volumeLocators.add(volume.getChainInfo());

0 commit comments

Comments
 (0)