itsayushpandey commented on code in PR #7712:
URL: https://github.com/apache/cloudstack/pull/7712#discussion_r1340933911
##########
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java:
##########
@@ -580,17 +598,20 @@ private void
checkUnmanagedNicAndNetworkForImport(UnmanagedInstanceTO.Nic nic, N
return;
}
- String networkBroadcastUri = network.getBroadcastUri() == null ? null
: network.getBroadcastUri().toString();
- if (nic.getVlan() != null && nic.getVlan() != 0 && nic.getPvlan() ==
null &&
- (StringUtils.isEmpty(networkBroadcastUri) ||
- !networkBroadcastUri.equals(String.format("vlan://%d",
nic.getVlan())))) {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
String.format("VLAN of network(ID: %s) %s is found different from the VLAN of
nic(ID: %s) vlan://%d during VM import", network.getUuid(),
networkBroadcastUri, nic.getNicId(), nic.getVlan()));
- }
- String pvLanType = nic.getPvlanType() == null ? "" :
nic.getPvlanType().toLowerCase().substring(0, 1);
- if (nic.getVlan() != null && nic.getVlan() != 0 && nic.getPvlan() !=
null && nic.getPvlan() != 0 &&
- (StringUtils.isEmpty(network.getBroadcastUri().toString()) ||
-
!networkBroadcastUri.equals(String.format("pvlan://%d-%s%d", nic.getVlan(),
pvLanType, nic.getPvlan())))) {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
String.format("PVLAN of network(ID: %s) %s is found different from the VLAN of
nic(ID: %s) pvlan://%d-%s%d during VM import", network.getUuid(),
networkBroadcastUri, nic.getNicId(), nic.getVlan(), pvLanType, nic.getPvlan()));
+ if (hypervisorType == Hypervisor.HypervisorType.VMware) {
+ // Checks not needed for KVM
Review Comment:
done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]