server24 commented on issue #3497: VMs stuck in Stopping state due to NPE at 
org.apache.cloudstack.network.topology.BasicNetworkVisitor.visit(BasicNetworkVisitor.java:201)
URL: https://github.com/apache/cloudstack/issues/3497#issuecomment-512356917
 
 
   You probably want to add the destination parameter to removeDhcpEntry in 
server/src/org/apache/cloudstack/network/topology/BasicNetworkTopology.java, e. 
g.:
   
   ```
       @Override
       public boolean removeDhcpEntry(final Network network, final NicProfile 
nic, final VirtualMachineProfile profile, final DeployDestination dest,
                        final VirtualRouter virtualRouter) throws 
ResourceUnavailableException {
                        
           s_logger.debug("REMOVING DHCP ENTRY RULE");
   
           final String typeString = "dhcp entry";
           final Long podId = profile.getVirtualMachine().getPodIdToDeployIn();
           boolean isPodLevelException = false;
   
           if (podId != null && profile.getVirtualMachine().getType() == 
VirtualMachine.Type.User && network.getTrafficType() == TrafficType.Guest
                   && network.getGuestType() == Network.GuestType.Shared) {
               isPodLevelException = true;
           }
   
           final boolean failWhenDisconnect = false;
   
           final DhcpEntryRules dhcpRules = new DhcpEntryRules(network, nic, 
profile, dest);
           dhcpRules.setRemove(true);
   
           return applyRules(network, virtualRouter, typeString, 
isPodLevelException, podId, failWhenDisconnect, new 
RuleApplierWrapper<RuleApplier>(dhcpRules));
       }
   
   ```
   But that is the obvious choice (e.g. compared to applyDhcpEntry), so there 
must be something that prevented this trivial solution from being implemented.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to