Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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")){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought, there is no way here we know that we "only" want "ROOT" while iterating over a list of cmd.getVolumeUuids()

physicalsize += fileInfo.getSize();
}
}

if (statEntry.containsKey(chainInfo)) {
VolumeStatsEntry vse = statEntry.get(chainInfo);
if (vse != null) {
Expand Down