DaanHoogland commented on a change in pull request #3798: Fixed volume stats
URL: https://github.com/apache/cloudstack/pull/3798#discussion_r364643991
##########
File path:
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -3722,7 +3722,15 @@ protected GetVolumeStatsAnswer
execute(GetVolumeStatsCommand cmd) {
VirtualMachineMO vmMo =
dcMo.findVm(file.getDir());
Pair<VirtualDisk, String> vds =
vmMo.getDiskDevice(file.getFileName(), true);
long virtualsize =
vds.first().getCapacityInKB() * 1024;
- long physicalsize =
primaryStorageDatastoreMo.fileDiskSize(file.getPath());
+ long physicalsize = 0L;
+ VirtualMachineFileLayoutEx fileLayout =
vmMo.getFileLayout();
+ List<VirtualMachineFileLayoutExFileInfo> files
= fileLayout.getFile();
+ for(VirtualMachineFileLayoutExFileInfo
fileInfo: files){
+ if (fileInfo.getName().contains("ROOT")){
Review comment:
on second thought, there is no way here we know that we "only" want "ROOT"
while iterating over a list of ```cmd.getVolumeUuids()```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services