Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
4.2.1
-
None
-
Security Level: Public (Anyone can view this level - this is the default.)
-
None
Description
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)
Attachments
Issue Links
- is duplicated by
-
CLOUDSTACK-7538 Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule
-
- Closed
-