sgoeminn commented on a change in pull request #2259: CLOUDSTACK-10024: Network 
migration support
URL: https://github.com/apache/cloudstack/pull/2259#discussion_r146493419
 
 

 ##########
 File path: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
 ##########
 @@ -3636,6 +3639,36 @@ private void orchestrateMigrateForScale(final String 
vmUuid, final long srcHostI
         }
     }
 
+    @Override
+    public boolean replugNic(final Network network, final NicTO nic, final 
VirtualMachineTO vm, final ReservationContext context, final DeployDestination 
dest) throws ConcurrentOperationException,
+            ResourceUnavailableException, InsufficientCapacityException {
+        boolean result = true;
+
+        final VMInstanceVO router = _vmDao.findById(vm.getId());
+        if (router.getState() == State.Running) {
+            try {
+                final ReplugNicCommand replugNicCmd = new 
ReplugNicCommand(nic, vm.getName(), vm.getType(), vm.getDetails());
+                final Commands cmds = new Commands(Command.OnError.Stop);
+                cmds.addCommand("replugnic", replugNicCmd);
+                _agentMgr.send(dest.getHost().getId(), cmds);
+                final ReplugNicAnswer replugNicAnswer = 
cmds.getAnswer(ReplugNicAnswer.class);
+                if (!(replugNicAnswer != null && replugNicAnswer.getResult())) 
{
 
 Review comment:
   Agree, we changed it to (replugNicAnswer == null || 
!replugNicAnswer.getResult()). We have also updated the other places in that 
file where that code was used.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to