You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Joris van Lieshout (JIRA)" <ji...@apache.org> on 2014/03/11 15:50:44 UTC

[jira] [Created] (CLOUDSTACK-6223) removeNicFromVirtualMachine fails if another instance in another domain has a nic with the same ip and a forwarding rule configured on it

Joris van Lieshout created CLOUDSTACK-6223:
----------------------------------------------

             Summary: removeNicFromVirtualMachine fails if another instance in another domain has a nic with the same ip and a forwarding rule configured on it
                 Key: CLOUDSTACK-6223
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6223
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
    Affects Versions: 4.2.1
            Reporter: Joris van Lieshout
            Priority: Blocker


When removeNicFromVirtualMachine is called for a nic on an instance the code below is evaluated. This piece of code searches for portforwarding rules across all domains. If another instance exists that has a nic with the same ip and a forwarding rule the search returns >1 and the removeNicFromVirtualMachine call failed. 

server/src/com/cloud/network/rules/RulesManagerImpl.java
@Override
    public List<FirewallRuleVO> listAssociatedRulesForGuestNic(Nic nic){
        List<FirewallRuleVO> result = new ArrayList<FirewallRuleVO>();
        // add PF rules
        result.addAll(_portForwardingDao.listByDestIpAddr(nic.getIp4Address()));
        // add static NAT rules

Stack trace:
2014-03-11 15:24:04,944 ERROR [cloud.async.AsyncJobManagerImpl] (Job-Executor-102:job-193607 = [ 30e81de3-2a00-49f2-8d80-545a765e4c1e ]) Unexpected exception while executing org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from VM[User|zzz1] in Ntwk[994|Guest|14], nic has associated Port forwarding or Load balancer or Static NAT rules.
        at com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3058)
        at com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1031)
        at org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd.execute(RemoveNicFromVMCmd.java:103)
        at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:158)
        at com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:531)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)



--
This message was sent by Atlassian JIRA
(v6.2#6252)