Skip to content
Merged
Prev Previous commit
Next Next commit
Merge branch '4.20' into fix-vmware-ip-loss
  • Loading branch information
DaanHoogland authored May 13, 2025
commit 323eb1f7df937211bcb779c66d38d33061b63900
Original file line number Diff line number Diff line change
Expand Up @@ -5809,7 +5809,8 @@
String details = "Unable to find IP Address of VM. ";
String vmName = cmd.getVmName();
boolean result = false;
Answer answer = null;
String ip;
Answer answer;

VmwareContext context = getServiceContext();
VmwareHypervisorHost hyperHost = getHyperHost(context);
Expand All @@ -5827,18 +5828,18 @@
if (toolsStatus == VirtualMachineToolsStatus.TOOLS_NOT_INSTALLED) {
details += "Vmware tools not installed.";
} else {
var normalizedMac = cmd.getMacAddress().replaceAll("-", ":");

Check warning on line 5831 in plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L5831

Added line #L5831 was not covered by tests
for(var guestInfoNic : guestInfo.getNet()) {
var normalizedNicMac = guestInfoNic.getMacAddress().replaceAll("-", ":");

Check warning on line 5833 in plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L5833

Added line #L5833 was not covered by tests
if (!result && normalizedNicMac.equalsIgnoreCase(normalizedMac)) {
result = true;
details = null;

Check warning on line 5836 in plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L5835-L5836

Added lines #L5835 - L5836 were not covered by tests
for (var ipAddr : guestInfoNic.getIpAddress()) {
if(NetUtils.isIpWithInCidrRange(ipAddr, cmd.getVmNetworkCidr())) {
Comment thread
weizhouapache marked this conversation as resolved.
Outdated
details = ipAddr;

Check warning on line 5839 in plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L5839

Added line #L5839 was not covered by tests
}
}
Comment thread
weizhouapache marked this conversation as resolved.
}

Check warning on line 5842 in plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L5841-L5842

Added lines #L5841 - L5842 were not covered by tests
}
}
} else {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.