diff --git a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java index 706b665c2863..340a3e2e99db 100755 --- a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java @@ -4043,7 +4043,10 @@ public NicProfile addVmToNetwork(final VirtualMachine vm, final Network network, /** * duplicated in {@see UserVmManagerImpl} for a {@see UserVmVO} */ - private void checkIfNetworkExistsForVM(VirtualMachine virtualMachine, Network network) { + private void checkIfNetworkExistsForUserVM(VirtualMachine virtualMachine, Network network) { + if (virtualMachine.getType() != VirtualMachine.Type.User) { + return; // others may have multiple nics in the same network + } List allNics = _nicsDao.listByVmId(virtualMachine.getId()); for (NicVO nic : allNics) { if (nic.getNetworkId() == network.getId()) { @@ -4056,7 +4059,7 @@ private NicProfile orchestrateAddVmToNetwork(final VirtualMachine vm, final Netw InsufficientCapacityException { final CallContext cctx = CallContext.current(); - checkIfNetworkExistsForVM(vm, network); + checkIfNetworkExistsForUserVM(vm, network); s_logger.debug("Adding vm " + vm + " to network " + network + "; requested nic profile " + requested); final VMInstanceVO vmVO = _vmDao.findById(vm.getId()); final ReservationContext context = new ReservationContextImpl(null, null, cctx.getCallingUser(), cctx.getCallingAccount());