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 706b665c286..340a3e2e99d 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 class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac /** * 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 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac 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());