Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1371#discussion_r62779198 --- Diff: engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java --- @@ -1445,28 +1466,31 @@ public void prepareAllNicsForMigration(final VirtualMachineProfile vm, final Dep Long guestNetworkId = null; for (final NicVO nic : nics) { final NetworkVO network = _networksDao.findById(nic.getNetworkId()); - if(network.getTrafficType().equals(TrafficType.Guest) && network.getGuestType().equals(GuestType.Isolated)){ + if (network.getTrafficType().equals(TrafficType.Guest) && network.getGuestType().equals(GuestType.Isolated)) { + guestNetworkId = network.getId(); } final Integer networkRate = _networkModel.getNetworkRate(network.getId(), vm.getId()); final NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName()); final NicProfile profile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vm.getHypervisorType(), network)); - if(guru instanceof NetworkMigrationResponder){ - if(!((NetworkMigrationResponder) guru).prepareMigration(profile, network, vm, dest, context)){ - s_logger.error("NetworkGuru "+guru+" prepareForMigration failed."); // XXX: Transaction error + if (guru instanceof NetworkMigrationResponder) { + if (!((NetworkMigrationResponder)guru).prepareMigration(profile, network, vm, dest, context)) { + s_logger.error("NetworkGuru " + guru + " prepareForMigration failed."); // XXX: Transaction error + } } final List<Provider> providersToImplement = getNetworkProviders(network.getId()); for (final NetworkElement element : networkElements) { if (providersToImplement.contains(element.getProvider())) { if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) { - throw new CloudRuntimeException("Service provider " + element.getProvider().getName() + " either doesn't exist or is not enabled in physical network id: " + network.getPhysicalNetworkId()); + throw new CloudRuntimeException("Service provider " + element.getProvider().getName() + " either doesn't exist or is not enabled in physical network id: " + + network.getPhysicalNetworkId()); } - if(element instanceof NetworkMigrationResponder){ - if(!((NetworkMigrationResponder) element).prepareMigration(profile, network, vm, dest, context)){ - s_logger.error("NetworkElement "+element+" prepareForMigration failed."); // XXX: Transaction error + if (element instanceof NetworkMigrationResponder) { + if (!((NetworkMigrationResponder)element).prepareMigration(profile, network, vm, dest, context)) { + s_logger.error("NetworkElement " + element + " prepareForMigration failed."); // XXX: Transaction error --- End diff -- Should this method continue if the ``prepareMigration`` call fails? If not, should it return or throw an exception?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---