Skip to content
Draft
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
11 changes: 7 additions & 4 deletions server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public void setKubernetesServiceHelpers(final List<KubernetesServiceHelper> kube
"Wait Interval (in seconds) for shared network vm dhcp ip addr fetch for next iteration ", true);

private static final ConfigKey<Integer> VmIpFetchTrialMax = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmip.max.retry", "10",
"The max number of retrieval times for shared entwork vm dhcp ip fetch, in case of failures", true);
"The max number of retrieval times for shared network vm dhcp ip fetch, in case of failures", true);
Copy link
Preview

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

Good fix for the typo correction from 'entwork' to 'network'.

Copilot uses AI. Check for mistakes.


private static final ConfigKey<Integer> VmIpFetchThreadPoolMax = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmipFetch.threadPool.max", "10",
"number of threads for fetching vms ip address", true);
Expand Down Expand Up @@ -2706,7 +2706,7 @@ protected void runInContext() {

if (vmIdAndCount.getRetrievalCount() <= 0) {
vmIdCountMap.remove(nicId);
logger.debug("Vm " + vmId +" nic "+nicId + " count is zero .. removing vm nic from map ");
logger.debug("Vm {} nic {} count is zero .. removing vm nic from map ", vmId, nicId);

ActionEventUtils.onActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM,
Domain.ROOT_DOMAIN, EventTypes.EVENT_NETWORK_EXTERNAL_DHCP_VM_IPFETCH,
Expand All @@ -2715,12 +2715,15 @@ protected void runInContext() {
continue;
}


UserVm userVm = _vmDao.findById(vmId);
VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
NicVO nicVo = _nicDao.findById(nicId);
NetworkVO network = _networkDao.findById(nicVo.getNetworkId());
if (ObjectUtils.anyNull(userVm, vmInstance, nicVo)) {
logger.warn("Couldn't fetch ip addr, Vm {} or nic {} doesn't exists", vmId, nicId);
continue;
}

NetworkVO network = _networkDao.findById(nicVo.getNetworkId());
VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(userVm);
VirtualMachine vm = vmProfile.getVirtualMachine();
boolean isWindows = _guestOSCategoryDao.findById(_guestOSDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows");
Expand Down
Loading