Damans227 commented on code in PR #13354:
URL: https://github.com/apache/cloudstack/pull/13354#discussion_r4258661353


##########
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java:
##########
@@ -2266,8 +2279,13 @@ public void prepareNicForMigration(final 
VirtualMachineProfile vm, final DeployD
         }
         final List<NicVO> nics = _nicDao.listByVmId(vm.getId());
         final ReservationContext context = new 
ReservationContextImpl(UUID.randomUUID().toString(), null, null);
+        final Map<Long, NetworkVO> networksById = 
batchLoadNetworksForNics(nics);
         for (final NicVO nic : nics) {
-            final NetworkVO network = 
_networksDao.findById(nic.getNetworkId());
+            final NetworkVO network = networksById.get(nic.getNetworkId());
+            if (network == null) {

Review Comment:
   should this fail the migration instead of skipping? before it crashed, now 
the vm can move to the new host without that network set up there



-- 
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]

Reply via email to