Bug #4219
Open vSwtich flows are deleted for all VM with the same MAC address
Status: | Closed | Start date: | 12/01/2015 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Drivers - Network | |||
Target version: | Release 5.0 | |||
Resolution: | fixed | Pull request: | ||
Affected Versions: | OpenNebula 4.14 |
Description
Hello,
In our environment, all users have the same networks (page 17 of the PDF) with the same IP addresses.
When two users instantiate a VM template, they both get the same IP, so the same MAC address, in their own respective networks differenciated by VLAN ID.
When one of them delete her VM, the flow is removed for the other VM too since the flows are selected only by matching MAC address.
- VM1 log
Tue Dec 1 13:16:47 2015 [Z0][VM][I]: New state is PENDING Tue Dec 1 13:17:12 2015 [Z0][VM][I]: New state is ACTIVE Tue Dec 1 13:17:12 2015 [Z0][VM][I]: New LCM state is PROLOG Tue Dec 1 13:17:12 2015 [Z0][VM][I]: New LCM state is BOOT Tue Dec 1 13:17:12 2015 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/91/deployment.0 Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: ExitCode: 0 Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: Successfully execute network driver operation: pre. Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: ExitCode: 0 Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy. Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-vsctl set Port vnet0 tag=9". Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=3,arp,dl_src=02:00:c0:a8:00:01,priority=45000,actions=drop". Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=3,arp,dl_src=02:00:c0:a8:00:01,nw_src=192.168.0.1,priority=46000,actions=normal". Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=3,dl_src=02:00:c0:a8:00:01,priority=40000,actions=normal". Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=3,priority=39000,actions=drop". Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: ExitCode: 0 Tue Dec 1 13:17:13 2015 [Z0][VMM][I]: Successfully execute network driver operation: post. Tue Dec 1 13:17:13 2015 [Z0][VM][I]: New LCM state is RUNNING
- VM2 log
Tue Dec 1 13:18:12 2015 [Z0][VM][I]: New state is ACTIVE Tue Dec 1 13:18:12 2015 [Z0][VM][I]: New LCM state is PROLOG Tue Dec 1 13:18:12 2015 [Z0][VM][I]: New LCM state is BOOT Tue Dec 1 13:18:12 2015 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/93/deployment.0 Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: ExitCode: 0 Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: Successfully execute network driver operation: pre. Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: ExitCode: 0 Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy. Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-vsctl set Port vnet2 tag=10". Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=5,arp,dl_src=02:00:c0:a8:00:01,priority=45000,actions=drop". Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=5,arp,dl_src=02:00:c0:a8:00:01,nw_src=192.168.0.1,priority=46000,actions=normal". Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=5,dl_src=02:00:c0:a8:00:01,priority=40000,actions=normal". Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: post: Executed "sudo ovs-ofctl add-flow nebula in_port=5,priority=39000,actions=drop". Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: ExitCode: 0 Tue Dec 1 13:18:13 2015 [Z0][VMM][I]: Successfully execute network driver operation: post. Tue Dec 1 13:18:13 2015 [Z0][VM][I]: New LCM state is RUNNING
We can see that each VM has the same MAC and IP addresses, on different VLAN IDs.
Now, the log of VM1 when I delete it:
Tue Dec 1 13:19:19 2015 [Z0][VM][I]: New LCM state is CLEANUP_DELETE Tue Dec 1 13:19:20 2015 [Z0][VM][I]: New state is DONE Tue Dec 1 13:19:20 2015 [Z0][VM][I]: New LCM state is LCM_INIT Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 Driver command for 91 cancelled Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 error: failed to get domain 'one-91' Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 error: Domain not found: no domain with matching name 'one-91' Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 ExitCode: 0 Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 Successfully execute virtualization driver operation: cancel. Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula ,in_port=5,dl_src=02:00:c0:a8:00:01". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula ,in_port=3,dl_src=02:00:c0:a8:00:01". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula ,arp,in_port=5,dl_src=02:00:c0:a8:00:01,arp_spa=192.168.0.1". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula ,arp,in_port=3,dl_src=02:00:c0:a8:00:01,arp_spa=192.168.0.1". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula ,arp,in_port=5,dl_src=02:00:c0:a8:00:01". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula ,arp,in_port=3,dl_src=02:00:c0:a8:00:01". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 clean: Executed "sudo ovs-ofctl del-flows nebula in_port=5". Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 ExitCode: 0 Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 Successfully execute network driver operation: clean. Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 Successfully execute transfer manager driver operation: tm_delete. Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: LOG I 91 Successfully execute transfer manager driver operation: tm_delete. Tue Dec 1 13:19:20 2015 [Z0][VMM][W]: Ignored: CLEANUP SUCCESS 91
The solution is to only delete the flows of a specific Open vSwitch port but the information is not available when deleting flows.
I added some debug output to the port()
method (source:src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb@f1c922e#L192) and I found:
- At startup:
Nic is {:ar_id=>"0", :bridge=>"nebula", :ip=>"192.168.0.4", :mac=>"02:00:c0:a8:00:04", :network=>"test1", :network_id=>"7", :nic_id=>"0", :security_groups=>"0", :vlan=>"YES", :tap=>"vnet0"}
- At shutdown
Nic is {:ar_id=>"0", :bridge=>"nebula", :ip=>"192.168.0.4", :mac=>"02:00:c0:a8:00:04", :network=>"test1", :network_id=>"7", :nic_id=>"0", :security_groups=>"0", :vlan=>"YES"}
My commit is not sufficient and can not be merged :-/
Regards.
Associated revisions
Bug #4219 - OVS delete flows with same VLAN_ID
History
#1 Updated by Ruben S. Montero over 5 years ago
- Target version set to Release 5.0
#2 Updated by Jaime Melis over 5 years ago
- Status changed from Pending to Closed
- Resolution set to fixed