cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [09/26] git commit: updated refs/heads/4.4-forward to 0594598
Date Tue, 22 Apr 2014 08:02:36 GMT
fix KVM plug-in for OVS tunnel network. Fix addreses two issues.

fix  mismatch of ovs-host-setup, ovs_host_setup used Libvirt resource and
scripts

plug the nic to OVS bridges created for the tunnel network.


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

Branch: refs/heads/4.4-forward
Commit: 18c269a57597c1071054caf0b5e201cf5fcdaae6
Parents: 192856f
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Fri Apr 18 18:09:26 2014 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Fri Apr 18 18:14:14 2014 +0530

----------------------------------------------------------------------
 .../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java | 4 ++--
 .../kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java | 5 +++++
 scripts/vm/network/vnet/ovstunnel.py                            | 5 ++---
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18c269a5/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 34c1b6d..345a8ee 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1484,7 +1484,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
             otherConfig.put("ovs-host-setup", "");
             Script.runSimpleBashScript("ovs-vsctl -- --may-exist add-br "
                     + nwName + " -- set bridge " + nwName
-                    + " other_config:ovs_host_setup='-1'");
+                    + " other_config:ovs-host-setup='-1'");
             s_logger.debug("### KVM network for tunnels created:" + nwName);
         } catch (Exception e) {
             s_logger.warn("createTunnelNetwork failed", e);
@@ -1498,7 +1498,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
             findOrCreateTunnelNetwork(nwName);
             String configuredHosts = Script
                     .runSimpleBashScript("ovs-vsctl get bridge " + nwName
-                            + " other_config:ovs_host_setup");
+                            + " other_config:ovs-host-setup");
             boolean configured = false;
             if (configuredHosts != null) {
                 String hostIdsStr[] = configuredHosts.split(",");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18c269a5/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
index c64a472..6b482bf 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
@@ -88,6 +88,11 @@ public class OvsVifDriver extends VifDriverBase {
                 intf.setVirtualPortInterfaceId(nic.getUuid());
                 String brName = (trafficLabel != null && !trafficLabel.isEmpty())
? _pifs.get(trafficLabel) : _pifs.get("private");
                 intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+            } else if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vswitch) {
+                String vnetId = Networks.BroadcastDomainType.getValue(nic.getBroadcastUri());
+                String brName = "OVSTunnel" + vnetId;
+                s_logger.debug("nic " + nic + " needs to be connected to LogicalSwitch "
+ brName);
+                intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
             } else {
                 intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18c269a5/scripts/vm/network/vnet/ovstunnel.py
----------------------------------------------------------------------
diff --git a/scripts/vm/network/vnet/ovstunnel.py b/scripts/vm/network/vnet/ovstunnel.py
index 57085d8..c108c29 100755
--- a/scripts/vm/network/vnet/ovstunnel.py
+++ b/scripts/vm/network/vnet/ovstunnel.py
@@ -27,7 +27,7 @@ import os
 import sys
 import subprocess
 import time
-import simplejson as json
+import json
 from optparse import OptionParser, OptionGroup, OptParseError, BadOptionError, OptionError,
OptionConflictError, OptionValueError
 
 from time import localtime as _localtime, asctime as _asctime
@@ -73,7 +73,6 @@ def setup_ovs_bridge(bridge, key, cs_host_id):
     logging.debug("Setup_ovs_bridge completed with result:%s" % result)
     return result
 
-@echo
 def setup_ovs_bridge_for_distributed_routing(bridge, cs_host_id):
 
     res = lib.check_switch()
@@ -281,7 +280,7 @@ if __name__ == '__main__':
     parser.add_option("--src_host", dest="src_host")
     parser.add_option("--dst_host", dest="dst_host")
     parser.add_option("--iface_name", dest="iface_name")
-    parser.ad_option("--config", dest="config")
+    parser.add_option("--config", dest="config")
     (option, args) = parser.parse_args()
     if len(args) == 0:
         logging.debug("No command to execute")


Mime
View raw message