Source:
<code>private void init(VM vm, VmInfoBuildUtils vmInfoBuildUtils, Guid hostId) { this.vm = vm; this.vmInfoBuildUtils = vmInfoBuildUtils; payloadIndex = -1; cdRomIndex = -1; vnicMetadata = new HashMap<>(); diskMetadata = new HashMap<>(); <START> volumeLeases = new ArrayList<>(); <END> hypervEnabled = vmInfoBuildUtils.isHypervEnabled(vm.getVmOsId(), vm.getCompatibilityVersion()); emulatedMachine = vm.getEmulatedMachine() != null ? vm.getEmulatedMachine() : vmInfoBuildUtils.getEmulatedMachineByClusterArch(vm.getClusterArch()); cdInterface = vmInfoBuildUtils.getCdInterface( vm.getOs(), vm.getCompatibilityVersion(), ChipsetType.fromMachineType(emulatedMachine)); writer = new XmlTextWriter(); qosCache = new HashMap<>(); vmCustomProperties = VmPropertiesUtils.getInstance().getVMProperties( vm.getCompatibilityVersion(), vm.getStaticData()); if (hostId != null) { hostDevicesSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getHostDevices(hostId)); hostStatisticsSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getVdsStatistics(hostId)); hostNumaNodesSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getVdsNumaNodes(hostId)); } else { hostDevicesSupplier = new MemoizingSupplier<>(() -> Collections.emptyMap()); hostStatisticsSupplier = new MemoizingSupplier<>(() -> null); hostNumaNodesSupplier = new MemoizingSupplier<>(() -> Collections.emptyList()); } vmNumaNodesSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getVmNumaNodes(vm)); }</code><technical_language>in 99.99999% of cases this code is executed volume leases, please change this to: volumeLeases = <hosted_engine?> ? new ArrayList<>() : Collections.emptyMap(); a option be: private List<Pair<Guid, Guid>> volumeLeases = Collections.emptyMap(); in constructor for hosted-engine VM initialize empty list</technical_language>

Target:
private void init(VM vm, VmInfoBuildUtils vmInfoBuildUtils, Guid hostId) { this.vm = vm; this.vmInfoBuildUtils = vmInfoBuildUtils; payloadIndex = -1; cdRomIndex = -1; vnicMetadata = new HashMap<>(); diskMetadata = new HashMap<>(); hypervEnabled = vmInfoBuildUtils.isHypervEnabled(vm.getVmOsId(), vm.getCompatibilityVersion()); emulatedMachine = vm.getEmulatedMachine() != null ? vm.getEmulatedMachine() : vmInfoBuildUtils.getEmulatedMachineByClusterArch(vm.getClusterArch()); cdInterface = vmInfoBuildUtils.getCdInterface( vm.getOs(), vm.getCompatibilityVersion(), ChipsetType.fromMachineType(emulatedMachine)); writer = new XmlTextWriter(); qosCache = new HashMap<>(); vmCustomProperties = VmPropertiesUtils.getInstance().getVMProperties( vm.getCompatibilityVersion(), vm.getStaticData()); if (hostId != null) { hostDevicesSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getHostDevices(hostId)); hostStatisticsSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getVdsStatistics(hostId)); hostNumaNodesSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getVdsNumaNodes(hostId)); } else { hostDevicesSupplier = new MemoizingSupplier<>(() -> Collections.emptyMap()); hostStatisticsSupplier = new MemoizingSupplier<>(() -> null); hostNumaNodesSupplier = new MemoizingSupplier<>(() -> Collections.emptyList()); } vmNumaNodesSupplier = new MemoizingSupplier<>(() -> vmInfoBuildUtils.getVmNumaNodes(vm)); }