incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [2/2] git commit: bug 13733: fix vm after reboot can't get ipaddress; status 13733: resolved fixed. Reviewed-by: Chiradeep
Date Tue, 10 Jul 2012 23:21:17 GMT
bug 13733: fix vm after reboot can't get ipaddress; status 13733: resolved fixed. Reviewed-by:
Chiradeep


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/a3d6ddd0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/a3d6ddd0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/a3d6ddd0

Branch: refs/heads/3.0.x
Commit: a3d6ddd0b584083dbb4d0a3e5b0377816eb17e46
Parents: 496929b
Author: Edison Su <disheng.su@gmail.com>
Authored: Thu Jun 7 21:42:34 2012 -0700
Committer: Edison Su <disheng.su@gmail.com>
Committed: Tue Jul 10 15:45:32 2012 -0700

----------------------------------------------------------------------
 scripts/vm/hypervisor/xenserver/vmops |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a3d6ddd0/scripts/vm/hypervisor/xenserver/vmops
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops
index 0872edb..edef619 100755
--- a/scripts/vm/hypervisor/xenserver/vmops
+++ b/scripts/vm/hypervisor/xenserver/vmops
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Version @VERSION@
+# Version 2.2.8.2012-02-28T23:50:03Z
 #
 # A plugin for executing script needed by vmops cloud 
 
@@ -757,7 +757,7 @@ def default_network_rules_systemvm(session, args):
     for vif in vifs:
         try:
             util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',
'--physdev-out', vif, '-j', vmchain])
-            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged',
'--physdev-in', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '4', '-m', 'physdev', '--physdev-is-bridged',
'--physdev-in', vif, '-j', vmchain])
             util.pread2(['iptables', '-I', vmchain, '-m', 'physdev', '--physdev-is-bridged',
'--physdev-in', vif, '-j', 'RETURN'])
         except:
             util.SMlog("Failed to program default rules")
@@ -940,16 +940,16 @@ def network_rules_for_rebooted_vm(session, vmName):
 
     for v in vifs:
         util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',
'--physdev-out', v, '-j', vmchain_default])
-        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',
'--physdev-in', v, '-j', vmchain_default])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged',
'--physdev-in', v, '-j', vmchain_default])
 
     #change antispoof rule in vmchain
     try:
         delcmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in
| sed 's/-A/-D/'"
         delcmd2 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out
| sed 's/-A/-D/'"
-        inscmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in
| grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/-A/-I/'"
-        inscmd2 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-in
| grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' | sed 's/-A/-I/'"
-        inscmd3 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out
| grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/-A/-I/'"
-        inscmd4 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-out
| grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' | sed 's/-A/-I/'"
+        inscmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in
| grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' "
+        inscmd2 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-in
| grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' "
+        inscmd3 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out
| grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' "
+        inscmd4 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-out
| grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' "
         
         ipts = []
         for cmd in [delcmd, delcmd2, inscmd, inscmd2, inscmd3, inscmd4]:
@@ -966,6 +966,9 @@ def network_rules_for_rebooted_vm(session, vmName):
                 util.pread2(filter(None,ipt))
             except:
                 util.SMlog("Failed to rewrite antispoofing rules for vm " + vm_name)
+        
+        util.pread2(['/bin/bash', '-c', 'iptables -D ' + vmchain_default + " -j " + vmchain])
+        util.pread2(['/bin/bash', '-c', 'iptables -A ' + vmchain_default + " -j " + vmchain])
     except:
         util.SMlog("No rules found for vm " + vm_name)
 


Mime
View raw message