[jira] [Commented] (CLOUDSTACK-7538) Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule

2014-09-24 Thread Saksham Srivastava (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14146318#comment-14146318
 ] 

Saksham Srivastava commented on CLOUDSTACK-7538:


Created https://issues.apache.org/jira/browse/CLOUDSTACK-7548
Fixed on master 
https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=commitdiff;h=8c671c4;hp=6379ca4548b8329f2492fa7f142c4946bef8d55e

 Can not remove the vm nic due to there is another vm with same internal ip 
 having port forwording rule
 --

 Key: CLOUDSTACK-7538
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7538
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
Affects Versions: 4.4.0, 4.5.0
Reporter: Wei Zhou
Assignee: Wei Zhou
 Fix For: 4.5.0, 4.4.1


 When I tried to remove a nic from a VM, an exception raised:
 2014-09-08 10:07:12,847 ERROR [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Unexpected exception while executing 
 org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
  com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from 
 VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated Port forwarding or 
 Load balancer or Static NAT rules.
  at 
 com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3129)
  at 
 com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1068)
  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:1146)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:701)
  2014-09-08 10:07:12,849 DEBUG [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Complete async job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ], 
 jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Failed to 
 remove nic from VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated 
 Port forwarding or Load balancer or Static NAT rules.
 This is because there is another vm (with same internal ip) having port 
 forward rules .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-7538) Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule

2014-09-15 Thread Saksham Srivastava (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14133796#comment-14133796
 ] 

Saksham Srivastava commented on CLOUDSTACK-7538:


A particular case where the fix will not work is when the same vm has 2 nics in 
different networks but the IPs of both the nics are same and one of them is 
configured for PF.

Wei the following query is executed while checking for PF rules :
SELECT firewall_rules.id, firewall_rules.xid, firewall_rules.domain_id, 
firewall_rules.account_id, firewall_rules.ip_address_id, 
firewall_rules.start_port, firewall_rules.end_port, firewall_rules.protocol, 
firewall_rules.purpose, firewall_rules.state, firewall_rules.created, 
firewall_rules.network_id, firewall_rules.icmp_code, firewall_rules.icmp_type, 
firewall_rules.related, firewall_rules.type, firewall_rules.traffic_type, 
firewall_rules.uuid, port_forwarding_rules.dest_ip_address, 
port_forwarding_rules.dest_port_start, port_forwarding_rules.dest_port_end, 
port_forwarding_rules.instance_id FROM port_forwarding_rules INNER JOIN 
firewall_rules ON port_forwarding_rules.id=firewall_rules.id 
WHERE firewall_rules.purpose='PortForwarding' 
AND port_forwarding_rules.dest_ip_address = IP of NIC to remove;

So the param that needs to be added should be networkid of the nic,which will 
assure that only the IP of the nic that is being removed is checked for PF 
rules. A network should not have same IP assigned to different nics while a vm 
can still have same IPs in different networks.

 Can not remove the vm nic due to there is another vm with same internal ip 
 having port forwording rule
 --

 Key: CLOUDSTACK-7538
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7538
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
Affects Versions: 4.4.0, 4.5.0
Reporter: Wei Zhou
Assignee: Wei Zhou
 Fix For: 4.5.0, 4.4.1


 When I tried to remove a nic from a VM, an exception raised:
 2014-09-08 10:07:12,847 ERROR [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Unexpected exception while executing 
 org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
  com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from 
 VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated Port forwarding or 
 Load balancer or Static NAT rules.
  at 
 com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3129)
  at 
 com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1068)
  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:1146)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:701)
  2014-09-08 10:07:12,849 DEBUG [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Complete async job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ], 
 jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Failed to 
 remove nic from VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated 
 Port forwarding or Load balancer or Static NAT rules.
 This is because there is another vm (with same internal ip) having port 
 forward rules .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-7538) Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule

2014-09-15 Thread Wei Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14133802#comment-14133802
 ] 

Wei Zhou commented on CLOUDSTACK-7538:
--

I totally agree with you.

The commit for CLOUDSTACK-6223 is not a prefect fix, but it is better than 
nothing, right?
I have asked Daan to cherry-pick the commit to 4.4 and he did it.


 Can not remove the vm nic due to there is another vm with same internal ip 
 having port forwording rule
 --

 Key: CLOUDSTACK-7538
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7538
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
Affects Versions: 4.4.0, 4.5.0
Reporter: Wei Zhou
Assignee: Wei Zhou
 Fix For: 4.5.0, 4.4.1


 When I tried to remove a nic from a VM, an exception raised:
 2014-09-08 10:07:12,847 ERROR [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Unexpected exception while executing 
 org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
  com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from 
 VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated Port forwarding or 
 Load balancer or Static NAT rules.
  at 
 com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3129)
  at 
 com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1068)
  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:1146)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:701)
  2014-09-08 10:07:12,849 DEBUG [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Complete async job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ], 
 jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Failed to 
 remove nic from VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated 
 Port forwarding or Load balancer or Static NAT rules.
 This is because there is another vm (with same internal ip) having port 
 forward rules .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-7538) Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule

2014-09-15 Thread Saksham Srivastava (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14133815#comment-14133815
 ] 

Saksham Srivastava commented on CLOUDSTACK-7538:


Certainly, I am on my way to provide the correct fix.

 Can not remove the vm nic due to there is another vm with same internal ip 
 having port forwording rule
 --

 Key: CLOUDSTACK-7538
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7538
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
Affects Versions: 4.4.0, 4.5.0
Reporter: Wei Zhou
Assignee: Wei Zhou
 Fix For: 4.5.0, 4.4.1


 When I tried to remove a nic from a VM, an exception raised:
 2014-09-08 10:07:12,847 ERROR [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Unexpected exception while executing 
 org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
  com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from 
 VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated Port forwarding or 
 Load balancer or Static NAT rules.
  at 
 com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3129)
  at 
 com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1068)
  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:1146)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:701)
  2014-09-08 10:07:12,849 DEBUG [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Complete async job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ], 
 jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Failed to 
 remove nic from VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated 
 Port forwarding or Load balancer or Static NAT rules.
 This is because there is another vm (with same internal ip) having port 
 forward rules .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-7538) Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule

2014-09-12 Thread Saksham Srivastava (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14131279#comment-14131279
 ] 

Saksham Srivastava commented on CLOUDSTACK-7538:


https://issues.apache.org/jira/browse/CLOUDSTACK-6223 had tried to fix the 
issue, but I don't think the fix was complete.
The query should be include networkid IMO.


 Can not remove the vm nic due to there is another vm with same internal ip 
 having port forwording rule
 --

 Key: CLOUDSTACK-7538
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7538
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
Affects Versions: 4.4.0, 4.5.0
Reporter: Wei Zhou
Assignee: Wei Zhou
 Fix For: 4.5.0, 4.4.1


 When I tried to remove a nic from a VM, an exception raised:
 2014-09-08 10:07:12,847 ERROR [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Unexpected exception while executing 
 org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
  com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from 
 VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated Port forwarding or 
 Load balancer or Static NAT rules.
  at 
 com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3129)
  at 
 com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1068)
  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:1146)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:701)
  2014-09-08 10:07:12,849 DEBUG [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Complete async job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ], 
 jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Failed to 
 remove nic from VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated 
 Port forwarding or Load balancer or Static NAT rules.
 This is because there is another vm (with same internal ip) having port 
 forward rules .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-7538) Can not remove the vm nic due to there is another vm with same internal ip having port forwording rule

2014-09-12 Thread Wei Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14131288#comment-14131288
 ] 

Wei Zhou commented on CLOUDSTACK-7538:
--

Hi Saksham,

Thanks. good to hear that.  
I did not see any commit for fix this issue, so I thought nobody is working on 
this. I will close this issue.

I Agree with your comment. But it looks a bit complicated, as there is no 
network_id in port_forward_rules table.

-Wei



 Can not remove the vm nic due to there is another vm with same internal ip 
 having port forwording rule
 --

 Key: CLOUDSTACK-7538
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7538
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
Affects Versions: 4.4.0, 4.5.0
Reporter: Wei Zhou
Assignee: Wei Zhou
 Fix For: 4.5.0, 4.4.1


 When I tried to remove a nic from a VM, an exception raised:
 2014-09-08 10:07:12,847 ERROR [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Unexpected exception while executing 
 org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd
  com.cloud.utils.exception.CloudRuntimeException: Failed to remove nic from 
 VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated Port forwarding or 
 Load balancer or Static NAT rules.
  at 
 com.cloud.vm.VirtualMachineManagerImpl.removeNicFromVm(VirtualMachineManagerImpl.java:3129)
  at 
 com.cloud.vm.UserVmManagerImpl.removeNicFromVirtualMachine(UserVmManagerImpl.java:1068)
  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:1146)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:701)
  2014-09-08 10:07:12,849 DEBUG [cloud.async.AsyncJobManagerImpl] 
 (Job-Executor-109:job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ]) 
 Complete async job-11939 = [ 5c3c0d5b-6b48-45fe-ad36-a0aea13479c4 ], 
 jobStatus: 2, resultCode: 530, result: Error Code: 530 Error text: Failed to 
 remove nic from VM[User|CentOS65] in Ntwk[300|Guest|1], nic has associated 
 Port forwarding or Load balancer or Static NAT rules.
 This is because there is another vm (with same internal ip) having port 
 forward rules .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)