You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security Group rules not applied at all for XenServer 6.5 / Advanced Zone #3192
Advanced Zone with Security Groups enabled, VM deployed inside Shared Network
OS / ENVIRONMENT
Hypervisor: XenServer 6.5(sp1)
SUMMARY
Security Group rules (iptable rules) not applied at all on XenServer 6.5 / 6.5SP1, in Advanced Zone with SG enabled on 4.11+ (FYI: works in 4.9.3 release)
Also migrating a VM to another host, does NOT remove rules from source host and does NOT create rules (just an empty iptable chains) on the destination host
STEPS TO REPRODUCE
Deploy a VM in a Shared Network with Security Groups (Advanced Zone with Security Groups enabled) will result in no rules being applied on the Hypervisor side (XenServer 6.5 / 6.5SP1)
Edit default Security Group and add a few rules for incoming/outgoing traffic
On XenServer 6.5 do "iptables -L -n | grep i-2-3-VM" and observe no rules for specific ports are present (i-2-3-VM being VM in test; specific ports being ports you added to default SG previously)
For migration issue - simply migrate VM to another host and run "iptables -L -n | grep i-2-3-VM" and observe no rules on destination host are created.
EXPECTED RESULTS
Security Group rules (iptable rules) applied properly on XenServer 6.5
ACTUAL RESULTS
no rules applied. cloud.log from XenServer on 4.9.3.1 vs 4.11.2 below (confirmed issue also for 4.12-RC2/RC3)
Activity
Fix XenServer Security Groups 'vmops' script
GabrielBrascher commentedon Feb 28, 2019
@andrijapanicsb please review PR #3197. Thanks!
Fix XenServer Security Groups 'vmops' script
Fix XenServer Security Groups 'vmops' script
Fix XenServer Security Groups 'vmops' script
Fix XenServer Security Groups 'vmops' script
andrijapanicsb commentedon Mar 1, 2019
Give me 5min @GabrielBrascher ...
GabrielBrascher commentedon Mar 1, 2019
No problem @andrijapanicsb
GabrielBrascher commentedon Mar 1, 2019
Are you ok with PR #3197 @andrijapanic?
Fix XenServer Security Groups 'vmops' script
andrijapanicsb commentedon Mar 1, 2019
Nope, not OK (also related to an email on mailing list today/yesterday) :
Migrating a VM from host A to host B, does NOT remove iptable rules on host A (source) and does NOT create iptables rules on host B (destination host)
(after VM migration done)
SOURCE HOST (no more VM running here)
iptables-save | grep i-2-3-VM
:i-2-3-VM - [0:0]
:i-2-3-VM-def - [0:0]
:i-2-3-VM-eg - [0:0]
-A BRIDGE-FIREWALL -m physdev --physdev-in vif3.0 --physdev-is-bridged -j i-2-3-VM-def
-A BRIDGE-FIREWALL -m physdev --physdev-out vif3.0 --physdev-is-bridged -j i-2-3-VM-def
-A i-2-3-VM -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
-A i-2-3-VM -j DROP
-A i-2-3-VM-def -p udp -m physdev --physdev-in vif3.0 --physdev-is-bridged -m set --match-set i-2-3-VM src -m udp --dport 53 -j RETURN
-A i-2-3-VM-def -m physdev --physdev-in vif3.0 --physdev-is-bridged -m set ! --match-set i-2-3-VM src -j DROP
-A i-2-3-VM-def -m physdev --physdev-out vif3.0 --physdev-is-bridged -m set ! --match-set i-2-3-VM dst -j DROP
-A i-2-3-VM-def -m physdev --physdev-in vif3.0 --physdev-is-bridged -m set --match-set i-2-3-VM src -j i-2-3-VM-eg
-A i-2-3-VM-def -m physdev --physdev-out vif3.0 --physdev-is-bridged -j i-2-3-VM
-A i-2-3-VM-eg -p tcp -m tcp --dport 88 -m conntrack --ctstate NEW -j RETURN
-A i-2-3-VM-eg -j DROP
DESTINATION HOST (VM now running here)
iptables-save | grep i-2-3-VM
:i-2-3-VM - [0:0]
:i-2-3-VM-def - [0:0]
:i-2-3-VM-eg - [0:0]
I prefer this is fixed in this PR please, since this is also a blocker thing - updating the issue desc with migration thing...
andrijapanicsb commentedon Mar 1, 2019
Might be a related issue: #3088
andrijapanicsb commentedon Mar 1, 2019
or #2990
GabrielBrascher commentedon Mar 1, 2019
Just pointing that the issue #3088 and PR #2990 addressed KVM (security_group.py); thus, that PR did not break XenServer (vmops).
@andrijapanicsb I will perform some tests here and debug it. Did you test migrating between XenServer 6.5 hosts?
andrijapanicsb commentedon Mar 1, 2019
@GabrielBrascher - that is the only thing I have tested (XenServer 6.5sp1) - didn't do any tests with KVM at all. Thx for looking into this.
GabrielBrascher commentedon Mar 1, 2019
Ok @andrijapanicsb, just checking. Thanks for pointing that!
Fix XenServer Security Groups 'vmops' script (#3197)
GabrielBrascher commentedon Mar 6, 2019
Closing this issue as PR #3197 has been merged.
Fix XenServer Security Groups 'vmops' script (apache#3197)
yadvr commentedon Aug 13, 2019
Checked, not available in 4.11.3.0; but will be available in master/4.13