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 E20CA17E9F for ; Tue, 14 Oct 2014 18:15:48 +0000 (UTC) Received: (qmail 57182 invoked by uid 500); 14 Oct 2014 18:15:21 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 57109 invoked by uid 500); 14 Oct 2014 18:15:21 -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 56202 invoked by uid 99); 14 Oct 2014 18:15:20 -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, 14 Oct 2014 18:15:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4CD2A822005; Tue, 14 Oct 2014 18:15:20 +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, 14 Oct 2014 18:16:03 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [45/50] [abbrv] git commit: updated refs/heads/master to 771d052 CLOUDSTACK-6278 Baremetal Advanced Networking support from commit id e06fa18ed2ee2ee6a417e089cf5ac6bde11d0079 by Frank Zhang Conflicts: server/src/com/cloud/network/router/NetworkHelperImpl.java Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3ac2e222 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3ac2e222 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3ac2e222 Branch: refs/heads/master Commit: 3ac2e222e8b9196aef21cd79dbb19844700e43c3 Parents: 4e21948 Author: wrodrigues Authored: Thu Sep 11 22:17:02 2014 +0200 Committer: wilderrodrigues Committed: Tue Oct 14 15:08:13 2014 +0200 ---------------------------------------------------------------------- .../cloud/network/router/NetworkHelperImpl.java | 35 +++++++------------- 1 file changed, 12 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ac2e222/server/src/com/cloud/network/router/NetworkHelperImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/router/NetworkHelperImpl.java b/server/src/com/cloud/network/router/NetworkHelperImpl.java index f589394..5acad2c 100644 --- a/server/src/com/cloud/network/router/NetworkHelperImpl.java +++ b/server/src/com/cloud/network/router/NetworkHelperImpl.java @@ -30,7 +30,6 @@ import javax.inject.Inject; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.framework.config.ConfigKey; -import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.log4j.Logger; import org.cloud.network.router.deployment.RouterDeploymentDefinition; @@ -41,7 +40,6 @@ import com.cloud.agent.api.routing.NetworkElementCommand; import com.cloud.agent.api.to.NicTO; import com.cloud.agent.manager.Commands; import com.cloud.alert.AlertManager; -import com.cloud.configuration.Config; import com.cloud.dc.ClusterVO; import com.cloud.dc.DataCenter; import com.cloud.dc.Pod; @@ -148,8 +146,6 @@ public class NetworkHelperImpl implements NetworkHelper { @Inject private RouterControlHelper _routerControlHelper; @Inject - private ConfigurationDao _configDao; - @Inject protected NetworkOrchestrationService _networkMgr; protected final Map> hypervisorsMap = new HashMap<>(); @@ -481,30 +477,23 @@ public class NetworkHelperImpl implements NetworkHelper { return result; } - protected String retrieveTemplateName(HypervisorType hType, final long datacenterId) { + protected String retrieveTemplateName(final HypervisorType hType, final long datacenterId) { + String templateName = null; + if (hType == HypervisorType.BareMetal) { - String peerHvType = _configDao.getValue(Config.BaremetalPeerHypervisorType.key()); - if (peerHvType == null) { - throw new CloudRuntimeException(String.format("To use baremetal in advanced networking, you must set %s to type of hypervisor(e.g XenServer)" - + " that exists in the same zone with baremetal host. That hyperivsor is used to spring up virtual router for baremetal instance", - Config.BaremetalPeerHypervisorType.key())); - } + ConfigKey hypervisorConfigKey = hypervisorsMap.get(HypervisorType.VMware); + templateName = hypervisorConfigKey.valueIn(datacenterId); + } else { + // Returning NULL is fine because the simulator will need it when + // being used instead of a real hypervisor. + // The hypervisorsMap contains only real hypervisors. + ConfigKey hypervisorConfigKey = hypervisorsMap.get(hType); - hType = HypervisorType.getType(peerHvType); - if (HypervisorType.XenServer != hType && HypervisorType.KVM != hType && HypervisorType.VMware != hType) { - throw new CloudRuntimeException(String.format("Baremetal only supports peer hypervisor(XenServer/KVM/VMWare) right now, you specified %s", peerHvType)); + if (hypervisorConfigKey != null) { + templateName = hypervisorConfigKey.valueIn(datacenterId); } } - // Returning NULL is fine because the simulator will need it when being - // used instead of a real hypervisor. - // The hypervisorsMap contains only real hypervisors. - String templateName = null; - ConfigKey hypervisorConfigKey = hypervisorsMap.get(hType); - - if (hypervisorConfigKey != null) { - templateName = hypervisorConfigKey.valueIn(datacenterId); - } return templateName; }