Change in vdsm[master]: Fix duplicate port mirrorring when reattaching vm

2013-09-24 Thread asegurap
Antoni Segura Puimedon has uploaded a new change for review.

Change subject: Fix duplicate port mirrorring when reattaching vm
..

Fix duplicate port mirrorring when reattaching vm

When there is a VM running with port mirrorring defined, the fact
that a vdsm restart re-attaches by "recreating" the vdsm vm object
makes it run setPortMirroring again. This caused every vdsm restart
to add a mirrorring duplication.

Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Bug-Url: https://bugzilla.redhat.com/1001704
Signed-off-by: Antoni S. Puimedon 
---
M vdsm/vm.py
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/19534/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index f356c08..b5a0126 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -2819,10 +2819,12 @@
 self._updateAgentChannels()
 
 #Currently there is no protection agains mirroring a network twice,
-for nic in self._devices[NIC_DEVICES]:
-if hasattr(nic, 'portMirroring'):
-for network in nic.portMirroring:
-supervdsm.getProxy().setPortMirroring(network, nic.name)
+if 'recover' not in self.conf:
+for nic in self._devices[NIC_DEVICES]:
+if hasattr(nic, 'portMirroring'):
+for network in nic.portMirroring:
+supervdsm.getProxy().setPortMirroring(network,
+  nic.name)
 
 # VmStatsThread may use block devices info from libvirt.
 # So, run it after you have this info


-- 
To view, visit http://gerrit.ovirt.org/19534
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: Fix duplicate port mirrorring when reattaching vm

2013-09-24 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: Fix duplicate port mirrorring when reattaching vm
..


Patch Set 1:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4606/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4528/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3721/ : SUCCESS

-- 
To view, visit http://gerrit.ovirt.org/19534
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: Fix duplicate port mirrorring when reattaching vm

2013-09-24 Thread amuller
Assaf Muller has posted comments on this change.

Change subject: Fix duplicate port mirrorring when reattaching vm
..


Patch Set 1:

(1 comment)


File vdsm/vm.py
Line 2817: self._getUnderlyingVmInfo()
Line 2818: self._getUnderlyingVmDevicesInfo()
Line 2819: self._updateAgentChannels()
Line 2820: 
Line 2821: #Currently there is no protection agains mirroring a network 
twice,
I think a comment is in order explaining what the 'recover' field has to do 
with port mirroring.
Line 2822: if 'recover' not in self.conf:
Line 2823: for nic in self._devices[NIC_DEVICES]:
Line 2824: if hasattr(nic, 'portMirroring'):
Line 2825: for network in nic.portMirroring:


-- 
To view, visit http://gerrit.ovirt.org/19534
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon 
Gerrit-Reviewer: Assaf Muller 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: Fix duplicate port mirrorring when reattaching vm

2013-09-24 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: Fix duplicate port mirrorring when reattaching vm
..


Patch Set 1: Code-Review+2

(1 comment)


File vdsm/vm.py
Line 2817: self._getUnderlyingVmInfo()
Line 2818: self._getUnderlyingVmDevicesInfo()
Line 2819: self._updateAgentChannels()
Line 2820: 
Line 2821: #Currently there is no protection agains mirroring a network 
twice,
I am afraid that the evil 'recover' element is too pervasive to be mentioned in 
a comments per each of its usages. I find the current commit message 
explanation enough.
Line 2822: if 'recover' not in self.conf:
Line 2823: for nic in self._devices[NIC_DEVICES]:
Line 2824: if hasattr(nic, 'portMirroring'):
Line 2825: for network in nic.portMirroring:


-- 
To view, visit http://gerrit.ovirt.org/19534
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon 
Gerrit-Reviewer: Assaf Muller 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: Fix duplicate port mirrorring when reattaching vm

2013-09-24 Thread asegurap
Antoni Segura Puimedon has posted comments on this change.

Change subject: Fix duplicate port mirrorring when reattaching vm
..


Patch Set 1: Verified+1

Verified by reproducing the setup described in Bug-Url. Reproducing a few times
(5) which leaves:
[root@dev-09 ~]# tc filter show dev foobar parent :
filter protocol ip pref 49152 u32 
filter protocol ip pref 49152 u32 fh 800: ht divisor 1 
filter protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 
terminal flowid ??? 
  match / at 0
action order 1: mirred (Egress Mirror to device vnet2) pipe
index 33 ref 1 bind 1
 
action order 2: mirred (Egress Mirror to device vnet2) pipe
index 34 ref 1 bind 1
 
action order 3: mirred (Egress Mirror to device vnet2) pipe
index 35 ref 1 bind 1
 
action order 4: mirred (Egress Mirror to device vnet2) pipe
index 36 ref 1 bind 1
 
action order 5: mirred (Egress Mirror to device vnet2) pipe
index 37 ref 1 bind 1
 
Which means that mirrorring was set 5 times. Then verified that this is the
issue by running once more the restart:
[root@dev-09 ~]# tc filter show dev foobar parent :
filter protocol ip pref 49152 u32 
filter protocol ip pref 49152 u32 fh 800: ht divisor 1 
filter protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 
terminal flowid ??? 
  match / at 0
action order 1: mirred (Egress Mirror to device vnet2) pipe
index 43 ref 1 bind 1
 
action order 2: mirred (Egress Mirror to device vnet2) pipe
index 44 ref 1 bind 1
 
action order 3: mirred (Egress Mirror to device vnet2) pipe
index 45 ref 1 bind 1
 
action order 4: mirred (Egress Mirror to device vnet2) pipe
index 46 ref 1 bind 1
 
action order 5: mirred (Egress Mirror to device vnet2) pipe
index 47 ref 1 bind 1
 
action order 6: mirred (Egress Mirror to device vnet2) pipe
index 48 ref 1 bind 1
 
Now there are 6 mirrorrings as expected. Now, swap the new vm.py for the old
one start vdsmd and supervdsmd again and check that there are still just 6
occurrences:
[root@dev-09 ~]# service supervdsmd stop && service vdsmd stop && service 
vdsmd start
Shutting down supervdsm daemon: 
supervdsm watchdog stop[  OK  ]
supervdsm stop [  OK  ]
Shutting down vdsm daemon: 
vdsm watchdog stop [  OK  ]
vdsm: Running run_final_hooks  [  OK  ]
vdsm stop  [  OK  ]
Please enter your authentication name: Please enter your password: 

Can't connect to default. Skipping.
libvirtd start/running, process 19559
supervdsm start[  OK  ]
vdsm: Running run_init_hooks
vdsm: Running gencerts
vdsm: Running reconfigure_sanlock
vdsm: Running reconfigure_libvirt
libvirt is already configured for vdsm
vdsm: Running syslog_available
vdsm: Running nwfilter
libvir: Network Filter Driver error : Requested operation is not valid: 
nwfilter is in use
vdsm: Running dummybr
vdsm: Running load_needed_modules
vdsm: Running tune_system
vdsm: Running mkdirs
vdsm: Running test_space
vdsm: Running test_lo
vdsm: Running test_conflicting_conf
SUCCESS: ssl configured to true. No conflicts
Starting up vdsm daemon: 
vdsm start [  OK  ]
[root@dev-09 ~]# tc filter show dev foobar parent :
filter protocol ip pref 49152 u32 
filter protocol ip pref 49152 u32 fh 800: ht divisor 1 
filter protocol ip pref 49152 u32 fh 800::800 order 2048 key ht 800 bkt 0 
terminal flowid ??? 
  match / at 0
action order 1: mirred (Egress Mirror to device vnet2) pipe
index 43 ref 1 bind 1
 
action order 2: mirred (Egress Mirror to device vnet2) pipe
index 44 ref 1 bind 1
 
action order 3: mirred (Egress Mirror to device vnet2) pipe
index 45 ref 1 bind 1
 
action order 4: mirred (Egress Mirror to device vnet2) pipe
index 46 ref 1 bind 1
 
action order 5: mirred (Egress Mirror to device vnet2) pipe
index 47 ref 1 bind 1
 
action order 6: mirred (Egress Mirror to device vnet2) pipe
index 48 ref 1 bind 1
 
SUCCESS :-)

-- 
To view, visit http://gerrit.ovirt.org/19534
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: 

Change in vdsm[master]: Fix duplicate port mirrorring when reattaching vm

2013-09-25 Thread danken
Dan Kenigsberg has submitted this change and it was merged.

Change subject: Fix duplicate port mirrorring when reattaching vm
..


Fix duplicate port mirrorring when reattaching vm

When there is a VM running with port mirrorring defined, the fact
that a vdsm restart re-attaches by "recreating" the vdsm vm object
makes it run setPortMirroring again. This caused every vdsm restart
to add a mirrorring duplication.

Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Bug-Url: https://bugzilla.redhat.com/1001704
Signed-off-by: Antoni S. Puimedon 
Reviewed-on: http://gerrit.ovirt.org/19534
Reviewed-by: Dan Kenigsberg 
---
M vdsm/vm.py
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Antoni Segura Puimedon: Verified
  Dan Kenigsberg: Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/19534
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I63deb5e703060f1891779d6697eaf17cd06ce8d3
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon 
Gerrit-Reviewer: Antoni Segura Puimedon 
Gerrit-Reviewer: Assaf Muller 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: oVirt Jenkins CI Server
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches