Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40AC3113D5 for ; Tue, 22 Apr 2014 08:03:00 +0000 (UTC) Received: (qmail 65693 invoked by uid 500); 22 Apr 2014 08:02:41 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 65424 invoked by uid 500); 22 Apr 2014 08:02:37 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 64994 invoked by uid 99); 22 Apr 2014 08:02:30 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 08:02:30 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CD0A08398E7; Tue, 22 Apr 2014 08:02:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dahn@apache.org To: commits@cloudstack.apache.org Date: Tue, 22 Apr 2014 08:02:36 -0000 Message-Id: In-Reply-To: <9a599e6555c64551b291de2c7a3f3ba6@git.apache.org> References: <9a599e6555c64551b291de2c7a3f3ba6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/26] git commit: updated refs/heads/4.4-forward to 0594598 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 Authored: Fri Apr 18 18:09:26 2014 +0530 Committer: Murali Reddy 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")