You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/06/10 08:30:34 UTC
[GitHub] [cloudstack] radu-todirica opened a new pull request #4205: Integrate Tungsten Fabric with CloudStack
radu-todirica opened a new pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205
## Description
WORK IN PROGRESS
Integration of TUNGSTEN SDN in Cloudstack
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
## Screenshots (if appropriate):
## How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on pull request #4205: WIP - Integrate tungsten with cloudstack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-665598103
Nice to see this moving on. Please let us know as soon as you need review or other feedback, @radu-todirica
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r648339865
##########
File path: client/pom.xml
##########
@@ -29,11 +29,17 @@
</parent>
<repositories>
<repository>
- <id>juniper-contrail</id>
- <url>https://juniper.github.io/contrail-maven/snapshots</url>
+ <id>juniper-tungsten-api</id>
+ <url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
Review comment:
Yes. This jar needs to be moved to a Cloudstack repository.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r637003113
##########
File path: utils/src/main/java/com/cloud/utils/TungstenUtils.java
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils;
+
+import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO : will determine later
+public class TungstenUtils {
+ private static final String tungstenBridge = "-tungsten";
+ private static final String proxyVm = "proxyvm";
+ private static final String secstoreVm = "secstorevm";
+ private static final String userVm = "userVm";
+ private static final String guestType = "guest";
+ private static final String publicType = "public";
+ private static final String managementType = "management";
+ private static final String controlType = "control";
+
+ public static final String INGRESS_RULE = "ingress";
+ public static final String EGRESS_RULE = "egress";
+
+ public static final int MAX_CIDR = 32;
+ public static final int WEB_SERVICE_PORT = 8080;
+ public static final String ALL_IP4_PREFIX = "0.0.0.0";
+ public static final String ANY_PROTO = "any";
+ public static final String DENY_ACTION = "deny";
+ public static final String PASS_ACTION = "pass";
+ public static final String ONE_WAY_DIRECTION = ">";
+ public static final String TWO_WAY_DIRECTION = "<>";
+ public static final String FABRIC_NETWORK_FQN = "default-domain:default-project:ip-fabric";
+
+ public static String getTapName(final String macAddress) {
+ return "tap" + macAddress.replace(":", "");
+ }
+
+ public static boolean isTungstenBridge(final String bridgeName) {
+ return bridgeName.contains(tungstenBridge);
+ }
+
+ public static String getBridgeName() {
+ return tungstenBridge;
+ }
+
+ public static String getVmiName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "vmi" + trafficType + vmType + nicId;
+ else
+ return "vmi" + trafficType + vmType + vmName;
+ }
+
+ public static String getInstanceIpName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "instanceIp" + trafficType + vmType + nicId;
+ else
+ return "instanceIp" + trafficType + vmType + vmName;
+ }
+
+ public static String getLogicalRouterName(long networkId) {
+ return "logicalRouter" + networkId;
+ }
+
+ public static String getNetworkGatewayVmiName(long vnId) {
+ return "internalGatewayVmi" + vnId;
+ }
+
+ public static String getNetworkGatewayIiName(long pvnId) {
+ return "internalGatewayIi" + pvnId;
+ }
+
+ public static String getPublicNetworkName(long zoneId) {
+ return "publicNetwork" + zoneId;
+ }
+
+ public static String getGuestNetworkName(String networkName) {
+ return networkName + "-" + RandomStringUtils.random(6, true, true);
+ }
+
+ public static String getManagementNetworkName(long mvnId) {
+ return "managementNetwork" + mvnId;
+ }
+
+ public static String getControlNetworkName(long cvnId) {
+ return "controlNetwork" + cvnId;
+ }
+
+ public static String getProxyVm() {
+ return proxyVm;
+ }
+
+ public static String getSecstoreVm() {
+ return secstoreVm;
+ }
+
+ public static String getUserVm() {
+ return userVm;
+ }
+
+ public static String getGuestType() {
+ return guestType;
+ }
+
+ public static String getPublicType() {
+ return publicType;
+ }
+
+ public static String getManagementType() {
+ return managementType;
+ }
+
+ public static String getVgwName(long zoneId) {
+ return "vgw" + zoneId;
+ }
+
+ public static String getVrfNetworkName(List<String> networkQualifiedName) {
+ List<String> vrfList = new ArrayList<>(networkQualifiedName);
+ vrfList.add(networkQualifiedName.get(networkQualifiedName.size() - 1));
+ return StringUtils.join(vrfList, ":");
+ }
+
+ public static String getFloatingIpPoolName(long zoneId) {
+ return "floating-ip-pool" + zoneId;
+ }
+
+ public static String getFloatingIpName(long nicId) {
+ return "floating-ip" + nicId;
+ }
+
+ public static String getSnatNetworkStartName(List<String> projectFqn, String logicalRouterUuid) {
+ return StringUtils.join(projectFqn, "__") + "__snat_" + logicalRouterUuid;
+ }
+
+ public static String getSnatNetworkEndName() {
+ return "right";
+ }
+
+ public static String getPublicNetworkPolicyName(long publicIpAddressId) {
+ return "public-network-policy" + publicIpAddressId;
+ }
+
+ public static String getVirtualNetworkPolicyName(long networkId) {
+ return "virtual-network-policy" + networkId;
+ }
+
+ public static String getDefaultPublicNetworkPolicyName(long vlanId) {
+ return "default-public-network-policy" + vlanId;
+ }
+
+ public static String getFabricNetworkPolicyName() {
+ return "fabric-network-policy";
+ }
+
+ public static String getRuleNetworkPolicyName(long ruleId) {
+ return "rule-network-policy" + ruleId;
+ }
+
+ public static String getSubnetName(long networkId) {
+ return "subnet-name" + networkId;
+ }
+
+ public static String getLoadBalancerVmiName(long publicIpId) {
+ return "loadbalancer-vmi" + publicIpId;
+ }
+
+ public static String getLoadBalancerIiName(long publicIpId) {
+ return "loadbalancer-ii" + publicIpId;
+ }
+
+ public static String getLoadBalancerName(long publicIpId) {
+ return "loadbalancer" + publicIpId;
+ }
+
+ public static String getLoadBalancerListenerName(long ruleId) {
+ return "loadbalancer-listener" + ruleId;
+ }
+
+ public static String getLoadBalancerHealthMonitorName(long publicIpId) {
+ return "loadbalancer-healthmonitor" + publicIpId;
+ }
+
+ public static String getLoadBalancerPoolName(long ruleId) {
+ return "loadbalancer-pool" + ruleId;
+ }
+
+ public static String getLoadBalancerMemberName(long ruleId, String memberIp) {
+ return "loadbalancer-member" + ruleId + memberIp;
+ }
+
+ public static String getLoadBalancerAlgorithm(String algorithm) {
+ switch (algorithm) {
+ case "leastconn":
+ return "LEAST_CONNECTIONS";
+ case "source":
+ return "SOURCE_IP";
+ default:
+ return "ROUND_ROBIN";
+ }
+ }
+
+ public static String getLoadBalancerSession(String stickiness) {
+ switch (stickiness) {
+ case "LbCookie":
+ return "HTTP_COOKIE";
+ case "AppCookie":
+ return "APP_COOKIE";
+ case "SourceBased":
+ return "SOURCE_IP";
+ default:
+ return null;
+ }
+ }
+
+ public static String getEthertTypeFromCidr(String cidr) {
+ if (NetUtils.isValidIp4Cidr(cidr)) {
+ return "IPv4";
+ } else {
+ return "IPv6";
+ }
+ }
+
+ public static String getTungstenAccessControl(String securityGroupRuleType) {
+ switch (securityGroupRuleType) {
+ case INGRESS_RULE:
+ return "ingress-access-control-list";
+ case EGRESS_RULE:
+ return "egress-access-control-list";
+ default:
+ return null;
+ }
+ }
+
+ public static String getTungstenProtocol(String protocol, String cidr) {
+ switch (protocol) {
+ case "tcp":
+ return "tcp";
+ case "udp":
+ return "udp";
+ case "icmp":
+ if(NetUtils.isValidIp4Cidr(cidr))
+ return "icmp";
Review comment:
Done
##########
File path: utils/src/main/java/com/cloud/utils/TungstenUtils.java
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils;
+
+import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO : will determine later
+public class TungstenUtils {
+ private static final String tungstenBridge = "-tungsten";
+ private static final String proxyVm = "proxyvm";
+ private static final String secstoreVm = "secstorevm";
+ private static final String userVm = "userVm";
+ private static final String guestType = "guest";
+ private static final String publicType = "public";
+ private static final String managementType = "management";
+ private static final String controlType = "control";
+
+ public static final String INGRESS_RULE = "ingress";
+ public static final String EGRESS_RULE = "egress";
+
+ public static final int MAX_CIDR = 32;
+ public static final int WEB_SERVICE_PORT = 8080;
+ public static final String ALL_IP4_PREFIX = "0.0.0.0";
+ public static final String ANY_PROTO = "any";
+ public static final String DENY_ACTION = "deny";
+ public static final String PASS_ACTION = "pass";
+ public static final String ONE_WAY_DIRECTION = ">";
+ public static final String TWO_WAY_DIRECTION = "<>";
+ public static final String FABRIC_NETWORK_FQN = "default-domain:default-project:ip-fabric";
+
+ public static String getTapName(final String macAddress) {
+ return "tap" + macAddress.replace(":", "");
+ }
+
+ public static boolean isTungstenBridge(final String bridgeName) {
+ return bridgeName.contains(tungstenBridge);
+ }
+
+ public static String getBridgeName() {
+ return tungstenBridge;
+ }
+
+ public static String getVmiName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "vmi" + trafficType + vmType + nicId;
+ else
+ return "vmi" + trafficType + vmType + vmName;
+ }
+
+ public static String getInstanceIpName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "instanceIp" + trafficType + vmType + nicId;
+ else
+ return "instanceIp" + trafficType + vmType + vmName;
+ }
+
+ public static String getLogicalRouterName(long networkId) {
+ return "logicalRouter" + networkId;
+ }
+
+ public static String getNetworkGatewayVmiName(long vnId) {
+ return "internalGatewayVmi" + vnId;
+ }
+
+ public static String getNetworkGatewayIiName(long pvnId) {
+ return "internalGatewayIi" + pvnId;
+ }
+
+ public static String getPublicNetworkName(long zoneId) {
+ return "publicNetwork" + zoneId;
+ }
+
+ public static String getGuestNetworkName(String networkName) {
+ return networkName + "-" + RandomStringUtils.random(6, true, true);
+ }
+
+ public static String getManagementNetworkName(long mvnId) {
+ return "managementNetwork" + mvnId;
+ }
+
+ public static String getControlNetworkName(long cvnId) {
+ return "controlNetwork" + cvnId;
+ }
+
+ public static String getProxyVm() {
+ return proxyVm;
+ }
+
+ public static String getSecstoreVm() {
+ return secstoreVm;
+ }
+
+ public static String getUserVm() {
+ return userVm;
+ }
+
+ public static String getGuestType() {
+ return guestType;
+ }
+
+ public static String getPublicType() {
+ return publicType;
+ }
+
+ public static String getManagementType() {
+ return managementType;
+ }
+
+ public static String getVgwName(long zoneId) {
+ return "vgw" + zoneId;
+ }
+
+ public static String getVrfNetworkName(List<String> networkQualifiedName) {
+ List<String> vrfList = new ArrayList<>(networkQualifiedName);
+ vrfList.add(networkQualifiedName.get(networkQualifiedName.size() - 1));
+ return StringUtils.join(vrfList, ":");
+ }
+
+ public static String getFloatingIpPoolName(long zoneId) {
+ return "floating-ip-pool" + zoneId;
+ }
+
+ public static String getFloatingIpName(long nicId) {
+ return "floating-ip" + nicId;
+ }
+
+ public static String getSnatNetworkStartName(List<String> projectFqn, String logicalRouterUuid) {
+ return StringUtils.join(projectFqn, "__") + "__snat_" + logicalRouterUuid;
+ }
+
+ public static String getSnatNetworkEndName() {
+ return "right";
+ }
+
+ public static String getPublicNetworkPolicyName(long publicIpAddressId) {
+ return "public-network-policy" + publicIpAddressId;
+ }
+
+ public static String getVirtualNetworkPolicyName(long networkId) {
+ return "virtual-network-policy" + networkId;
+ }
+
+ public static String getDefaultPublicNetworkPolicyName(long vlanId) {
+ return "default-public-network-policy" + vlanId;
+ }
+
+ public static String getFabricNetworkPolicyName() {
+ return "fabric-network-policy";
+ }
+
+ public static String getRuleNetworkPolicyName(long ruleId) {
+ return "rule-network-policy" + ruleId;
+ }
+
+ public static String getSubnetName(long networkId) {
+ return "subnet-name" + networkId;
+ }
+
+ public static String getLoadBalancerVmiName(long publicIpId) {
+ return "loadbalancer-vmi" + publicIpId;
+ }
+
+ public static String getLoadBalancerIiName(long publicIpId) {
+ return "loadbalancer-ii" + publicIpId;
+ }
+
+ public static String getLoadBalancerName(long publicIpId) {
+ return "loadbalancer" + publicIpId;
+ }
+
+ public static String getLoadBalancerListenerName(long ruleId) {
+ return "loadbalancer-listener" + ruleId;
+ }
+
+ public static String getLoadBalancerHealthMonitorName(long publicIpId) {
+ return "loadbalancer-healthmonitor" + publicIpId;
+ }
+
+ public static String getLoadBalancerPoolName(long ruleId) {
+ return "loadbalancer-pool" + ruleId;
+ }
+
+ public static String getLoadBalancerMemberName(long ruleId, String memberIp) {
+ return "loadbalancer-member" + ruleId + memberIp;
+ }
+
+ public static String getLoadBalancerAlgorithm(String algorithm) {
+ switch (algorithm) {
+ case "leastconn":
+ return "LEAST_CONNECTIONS";
+ case "source":
+ return "SOURCE_IP";
+ default:
+ return "ROUND_ROBIN";
+ }
+ }
+
+ public static String getLoadBalancerSession(String stickiness) {
+ switch (stickiness) {
+ case "LbCookie":
+ return "HTTP_COOKIE";
+ case "AppCookie":
+ return "APP_COOKIE";
+ case "SourceBased":
+ return "SOURCE_IP";
+ default:
+ return null;
+ }
+ }
+
+ public static String getEthertTypeFromCidr(String cidr) {
+ if (NetUtils.isValidIp4Cidr(cidr)) {
+ return "IPv4";
+ } else {
+ return "IPv6";
+ }
+ }
+
+ public static String getTungstenAccessControl(String securityGroupRuleType) {
+ switch (securityGroupRuleType) {
+ case INGRESS_RULE:
+ return "ingress-access-control-list";
+ case EGRESS_RULE:
+ return "egress-access-control-list";
+ default:
+ return null;
+ }
+ }
+
+ public static String getTungstenProtocol(String protocol, String cidr) {
+ switch (protocol) {
+ case "tcp":
+ return "tcp";
+ case "udp":
+ return "udp";
Review comment:
Done.
##########
File path: utils/src/main/java/com/cloud/utils/TungstenUtils.java
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils;
+
+import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO : will determine later
+public class TungstenUtils {
+ private static final String tungstenBridge = "-tungsten";
+ private static final String proxyVm = "proxyvm";
+ private static final String secstoreVm = "secstorevm";
+ private static final String userVm = "userVm";
+ private static final String guestType = "guest";
+ private static final String publicType = "public";
+ private static final String managementType = "management";
+ private static final String controlType = "control";
+
+ public static final String INGRESS_RULE = "ingress";
+ public static final String EGRESS_RULE = "egress";
+
+ public static final int MAX_CIDR = 32;
+ public static final int WEB_SERVICE_PORT = 8080;
+ public static final String ALL_IP4_PREFIX = "0.0.0.0";
+ public static final String ANY_PROTO = "any";
+ public static final String DENY_ACTION = "deny";
+ public static final String PASS_ACTION = "pass";
+ public static final String ONE_WAY_DIRECTION = ">";
+ public static final String TWO_WAY_DIRECTION = "<>";
+ public static final String FABRIC_NETWORK_FQN = "default-domain:default-project:ip-fabric";
+
+ public static String getTapName(final String macAddress) {
+ return "tap" + macAddress.replace(":", "");
+ }
+
+ public static boolean isTungstenBridge(final String bridgeName) {
+ return bridgeName.contains(tungstenBridge);
+ }
+
+ public static String getBridgeName() {
+ return tungstenBridge;
+ }
+
+ public static String getVmiName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "vmi" + trafficType + vmType + nicId;
+ else
+ return "vmi" + trafficType + vmType + vmName;
+ }
+
+ public static String getInstanceIpName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "instanceIp" + trafficType + vmType + nicId;
+ else
+ return "instanceIp" + trafficType + vmType + vmName;
+ }
+
+ public static String getLogicalRouterName(long networkId) {
+ return "logicalRouter" + networkId;
+ }
+
+ public static String getNetworkGatewayVmiName(long vnId) {
+ return "internalGatewayVmi" + vnId;
+ }
+
+ public static String getNetworkGatewayIiName(long pvnId) {
+ return "internalGatewayIi" + pvnId;
+ }
+
+ public static String getPublicNetworkName(long zoneId) {
+ return "publicNetwork" + zoneId;
+ }
+
+ public static String getGuestNetworkName(String networkName) {
+ return networkName + "-" + RandomStringUtils.random(6, true, true);
+ }
+
+ public static String getManagementNetworkName(long mvnId) {
+ return "managementNetwork" + mvnId;
+ }
+
+ public static String getControlNetworkName(long cvnId) {
+ return "controlNetwork" + cvnId;
+ }
+
+ public static String getProxyVm() {
+ return proxyVm;
+ }
+
+ public static String getSecstoreVm() {
+ return secstoreVm;
+ }
+
+ public static String getUserVm() {
+ return userVm;
+ }
+
+ public static String getGuestType() {
+ return guestType;
+ }
+
+ public static String getPublicType() {
+ return publicType;
+ }
+
+ public static String getManagementType() {
+ return managementType;
+ }
+
+ public static String getVgwName(long zoneId) {
+ return "vgw" + zoneId;
+ }
+
+ public static String getVrfNetworkName(List<String> networkQualifiedName) {
+ List<String> vrfList = new ArrayList<>(networkQualifiedName);
+ vrfList.add(networkQualifiedName.get(networkQualifiedName.size() - 1));
+ return StringUtils.join(vrfList, ":");
+ }
+
+ public static String getFloatingIpPoolName(long zoneId) {
+ return "floating-ip-pool" + zoneId;
+ }
+
+ public static String getFloatingIpName(long nicId) {
+ return "floating-ip" + nicId;
+ }
+
+ public static String getSnatNetworkStartName(List<String> projectFqn, String logicalRouterUuid) {
+ return StringUtils.join(projectFqn, "__") + "__snat_" + logicalRouterUuid;
+ }
+
+ public static String getSnatNetworkEndName() {
+ return "right";
+ }
+
+ public static String getPublicNetworkPolicyName(long publicIpAddressId) {
+ return "public-network-policy" + publicIpAddressId;
+ }
+
+ public static String getVirtualNetworkPolicyName(long networkId) {
+ return "virtual-network-policy" + networkId;
+ }
+
+ public static String getDefaultPublicNetworkPolicyName(long vlanId) {
+ return "default-public-network-policy" + vlanId;
+ }
+
+ public static String getFabricNetworkPolicyName() {
+ return "fabric-network-policy";
+ }
+
+ public static String getRuleNetworkPolicyName(long ruleId) {
+ return "rule-network-policy" + ruleId;
+ }
+
+ public static String getSubnetName(long networkId) {
+ return "subnet-name" + networkId;
+ }
+
+ public static String getLoadBalancerVmiName(long publicIpId) {
+ return "loadbalancer-vmi" + publicIpId;
+ }
+
+ public static String getLoadBalancerIiName(long publicIpId) {
+ return "loadbalancer-ii" + publicIpId;
+ }
+
+ public static String getLoadBalancerName(long publicIpId) {
+ return "loadbalancer" + publicIpId;
+ }
+
+ public static String getLoadBalancerListenerName(long ruleId) {
+ return "loadbalancer-listener" + ruleId;
+ }
+
+ public static String getLoadBalancerHealthMonitorName(long publicIpId) {
+ return "loadbalancer-healthmonitor" + publicIpId;
+ }
+
+ public static String getLoadBalancerPoolName(long ruleId) {
+ return "loadbalancer-pool" + ruleId;
+ }
+
+ public static String getLoadBalancerMemberName(long ruleId, String memberIp) {
+ return "loadbalancer-member" + ruleId + memberIp;
+ }
+
+ public static String getLoadBalancerAlgorithm(String algorithm) {
+ switch (algorithm) {
+ case "leastconn":
+ return "LEAST_CONNECTIONS";
+ case "source":
+ return "SOURCE_IP";
+ default:
+ return "ROUND_ROBIN";
+ }
+ }
+
+ public static String getLoadBalancerSession(String stickiness) {
+ switch (stickiness) {
+ case "LbCookie":
+ return "HTTP_COOKIE";
+ case "AppCookie":
+ return "APP_COOKIE";
+ case "SourceBased":
+ return "SOURCE_IP";
+ default:
+ return null;
+ }
+ }
+
+ public static String getEthertTypeFromCidr(String cidr) {
+ if (NetUtils.isValidIp4Cidr(cidr)) {
+ return "IPv4";
+ } else {
+ return "IPv6";
+ }
+ }
+
+ public static String getTungstenAccessControl(String securityGroupRuleType) {
+ switch (securityGroupRuleType) {
+ case INGRESS_RULE:
+ return "ingress-access-control-list";
+ case EGRESS_RULE:
+ return "egress-access-control-list";
+ default:
+ return null;
+ }
+ }
+
+ public static String getTungstenProtocol(String protocol, String cidr) {
+ switch (protocol) {
+ case "tcp":
+ return "tcp";
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r708969192
##########
File path: plugins/network-elements/tungsten/src/main/java/com/cloud/network/guru/TungstenGuestNetworkGuru.java
##########
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package org.apache.cloudstack.network.tungsten.service;
+package com.cloud.network.guru;
Review comment:
com.cloud is an old company that donated the larger part of the system (via via) to apache. new code should be under org.apache.cloudstack. Unless you are working for com.cloud please move it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-1000663038
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r530865124
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ListTungstenProvidersCmd.java
##########
@@ -0,0 +1,65 @@
+package org.apache.cloudstack.network.tungsten.api.command;
Review comment:
Done. Thank you for pointing that out.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-989886514
@radu-todirica @huyle-uni you have conflicts. How much more needs to be done here in terms of coding, before opening for review/merge?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-1000663489
Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 2012
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd closed pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
rhtyd closed pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r544409853
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -130,5 +130,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.6.1</version>
+ </dependency>
Review comment:
No, not really. I removed that dependency.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r637003670
##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -1775,6 +1786,16 @@ private void checkZoneParameters(final String zoneName, final String dns1, final
}
}
+ private boolean isTungstenZone(long zoneId){
+ boolean isTungsten = false;
+ List<PhysicalNetworkVO> physicalNetworks = _physicalNetworkDao.listByZone(zoneId);
+ for(PhysicalNetworkVO physicalNetwork : physicalNetworks){
+ if(physicalNetwork.getIsolationMethods().contains("TF"))
+ isTungsten = true;
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r636733549
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -0,0 +1,47 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cloud-plugin-network-tungsten</artifactId>
+ <name>Apache CloudStack Plugin - Tungsten Network</name>
+
+ <parent>
+ <groupId>org.apache.cloudstack</groupId>
+ <artifactId>cloudstack-plugins</artifactId>
+ <version>4.15.0.0-SNAPSHOT</version>
Review comment:
current version is 4.16.0.0-SNAPSHOT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r636731425
##########
File path: engine/schema/src/main/java/com/cloud/network/element/TungstenProviderVO.java
##########
@@ -0,0 +1,164 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.element;
+
+import com.cloud.network.TungstenProvider;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.UUID;
+
+@Entity
+@Table(name = ("tungsten_providers"))
Review comment:
```suggestion
@Table(name = "tungsten_providers")
```
Update the table name definition format ^^^, to be consistent with the convention as in the PR https://github.com/apache/cloudstack/pull/5004
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r636739958
##########
File path: utils/src/main/java/com/cloud/utils/TungstenUtils.java
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils;
+
+import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO : will determine later
+public class TungstenUtils {
+ private static final String tungstenBridge = "-tungsten";
+ private static final String proxyVm = "proxyvm";
+ private static final String secstoreVm = "secstorevm";
+ private static final String userVm = "userVm";
+ private static final String guestType = "guest";
+ private static final String publicType = "public";
+ private static final String managementType = "management";
+ private static final String controlType = "control";
+
+ public static final String INGRESS_RULE = "ingress";
+ public static final String EGRESS_RULE = "egress";
+
+ public static final int MAX_CIDR = 32;
+ public static final int WEB_SERVICE_PORT = 8080;
+ public static final String ALL_IP4_PREFIX = "0.0.0.0";
+ public static final String ANY_PROTO = "any";
+ public static final String DENY_ACTION = "deny";
+ public static final String PASS_ACTION = "pass";
+ public static final String ONE_WAY_DIRECTION = ">";
+ public static final String TWO_WAY_DIRECTION = "<>";
+ public static final String FABRIC_NETWORK_FQN = "default-domain:default-project:ip-fabric";
+
+ public static String getTapName(final String macAddress) {
+ return "tap" + macAddress.replace(":", "");
+ }
+
+ public static boolean isTungstenBridge(final String bridgeName) {
+ return bridgeName.contains(tungstenBridge);
+ }
+
+ public static String getBridgeName() {
+ return tungstenBridge;
+ }
+
+ public static String getVmiName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "vmi" + trafficType + vmType + nicId;
+ else
+ return "vmi" + trafficType + vmType + vmName;
+ }
+
+ public static String getInstanceIpName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "instanceIp" + trafficType + vmType + nicId;
+ else
+ return "instanceIp" + trafficType + vmType + vmName;
+ }
+
+ public static String getLogicalRouterName(long networkId) {
+ return "logicalRouter" + networkId;
+ }
+
+ public static String getNetworkGatewayVmiName(long vnId) {
+ return "internalGatewayVmi" + vnId;
+ }
+
+ public static String getNetworkGatewayIiName(long pvnId) {
+ return "internalGatewayIi" + pvnId;
+ }
+
+ public static String getPublicNetworkName(long zoneId) {
+ return "publicNetwork" + zoneId;
+ }
+
+ public static String getGuestNetworkName(String networkName) {
+ return networkName + "-" + RandomStringUtils.random(6, true, true);
+ }
+
+ public static String getManagementNetworkName(long mvnId) {
+ return "managementNetwork" + mvnId;
+ }
+
+ public static String getControlNetworkName(long cvnId) {
+ return "controlNetwork" + cvnId;
+ }
+
+ public static String getProxyVm() {
+ return proxyVm;
+ }
+
+ public static String getSecstoreVm() {
+ return secstoreVm;
+ }
+
+ public static String getUserVm() {
+ return userVm;
+ }
+
+ public static String getGuestType() {
+ return guestType;
+ }
+
+ public static String getPublicType() {
+ return publicType;
+ }
+
+ public static String getManagementType() {
+ return managementType;
+ }
+
+ public static String getVgwName(long zoneId) {
+ return "vgw" + zoneId;
+ }
+
+ public static String getVrfNetworkName(List<String> networkQualifiedName) {
+ List<String> vrfList = new ArrayList<>(networkQualifiedName);
+ vrfList.add(networkQualifiedName.get(networkQualifiedName.size() - 1));
+ return StringUtils.join(vrfList, ":");
+ }
+
+ public static String getFloatingIpPoolName(long zoneId) {
+ return "floating-ip-pool" + zoneId;
+ }
+
+ public static String getFloatingIpName(long nicId) {
+ return "floating-ip" + nicId;
+ }
+
+ public static String getSnatNetworkStartName(List<String> projectFqn, String logicalRouterUuid) {
+ return StringUtils.join(projectFqn, "__") + "__snat_" + logicalRouterUuid;
+ }
+
+ public static String getSnatNetworkEndName() {
+ return "right";
+ }
+
+ public static String getPublicNetworkPolicyName(long publicIpAddressId) {
+ return "public-network-policy" + publicIpAddressId;
+ }
+
+ public static String getVirtualNetworkPolicyName(long networkId) {
+ return "virtual-network-policy" + networkId;
+ }
+
+ public static String getDefaultPublicNetworkPolicyName(long vlanId) {
+ return "default-public-network-policy" + vlanId;
+ }
+
+ public static String getFabricNetworkPolicyName() {
+ return "fabric-network-policy";
+ }
+
+ public static String getRuleNetworkPolicyName(long ruleId) {
+ return "rule-network-policy" + ruleId;
+ }
+
+ public static String getSubnetName(long networkId) {
+ return "subnet-name" + networkId;
+ }
+
+ public static String getLoadBalancerVmiName(long publicIpId) {
+ return "loadbalancer-vmi" + publicIpId;
+ }
+
+ public static String getLoadBalancerIiName(long publicIpId) {
+ return "loadbalancer-ii" + publicIpId;
+ }
+
+ public static String getLoadBalancerName(long publicIpId) {
+ return "loadbalancer" + publicIpId;
+ }
+
+ public static String getLoadBalancerListenerName(long ruleId) {
+ return "loadbalancer-listener" + ruleId;
+ }
+
+ public static String getLoadBalancerHealthMonitorName(long publicIpId) {
+ return "loadbalancer-healthmonitor" + publicIpId;
+ }
+
+ public static String getLoadBalancerPoolName(long ruleId) {
+ return "loadbalancer-pool" + ruleId;
+ }
+
+ public static String getLoadBalancerMemberName(long ruleId, String memberIp) {
+ return "loadbalancer-member" + ruleId + memberIp;
+ }
+
+ public static String getLoadBalancerAlgorithm(String algorithm) {
+ switch (algorithm) {
+ case "leastconn":
+ return "LEAST_CONNECTIONS";
+ case "source":
+ return "SOURCE_IP";
+ default:
+ return "ROUND_ROBIN";
+ }
+ }
+
+ public static String getLoadBalancerSession(String stickiness) {
+ switch (stickiness) {
+ case "LbCookie":
+ return "HTTP_COOKIE";
+ case "AppCookie":
+ return "APP_COOKIE";
+ case "SourceBased":
+ return "SOURCE_IP";
+ default:
+ return null;
+ }
+ }
+
+ public static String getEthertTypeFromCidr(String cidr) {
+ if (NetUtils.isValidIp4Cidr(cidr)) {
+ return "IPv4";
+ } else {
+ return "IPv6";
+ }
+ }
+
+ public static String getTungstenAccessControl(String securityGroupRuleType) {
+ switch (securityGroupRuleType) {
+ case INGRESS_RULE:
+ return "ingress-access-control-list";
+ case EGRESS_RULE:
+ return "egress-access-control-list";
+ default:
+ return null;
+ }
+ }
+
+ public static String getTungstenProtocol(String protocol, String cidr) {
+ switch (protocol) {
+ case "tcp":
+ return "tcp";
+ case "udp":
+ return "udp";
+ case "icmp":
+ if(NetUtils.isValidIp4Cidr(cidr))
+ return "icmp";
Review comment:
Use the constants defined in NetUtils , define one for "icmp6".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-989673847
Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 1867
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r636723297
##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -1775,6 +1786,16 @@ private void checkZoneParameters(final String zoneName, final String dns1, final
}
}
+ private boolean isTungstenZone(long zoneId){
+ boolean isTungsten = false;
+ List<PhysicalNetworkVO> physicalNetworks = _physicalNetworkDao.listByZone(zoneId);
+ for(PhysicalNetworkVO physicalNetwork : physicalNetworks){
+ if(physicalNetwork.getIsolationMethods().contains("TF"))
+ isTungsten = true;
Review comment:
@radu-todirica can 'return true' / 'break' here, instead of looping through other physical networks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r596812977
##########
File path: engine/schema/src/main/java/com/cloud/network/TungstenGuestNetworkIpAddressVO.java
##########
@@ -0,0 +1,78 @@
+package com.cloud.network;
Review comment:
@DaanHoogland regarding your first change that param have been moved in GuestNetworkGuru. It's not there anymore.
Regarding the license i already spoked with Huy and he will add them soon.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r682873183
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -243,10 +246,12 @@
private KVMStoragePoolManager _storagePoolMgr;
private VifDriver _defaultVifDriver;
+ private VifDriver _tungstenVifDriver;
Review comment:
@huyle-uni I totally understand your point, we have too much of these "_" in the codebase from the old days and this does not make it easy for newcomers.
Thanks for addressing the review :+1:.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] huyle-uni commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
huyle-uni commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r708814042
##########
File path: plugins/network-elements/tungsten/src/main/java/com/cloud/network/guru/TungstenGuestNetworkGuru.java
##########
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package org.apache.cloudstack.network.tungsten.service;
+package com.cloud.network.guru;
Review comment:
Could you please explain me why we can not have new in com.cloud ?
I saw some plugin like BigSwitchBcf, BrocadeVcs, cisco, ElasticLb, ... in com.cloud. And they have unit test for NetworkGuru.
While some plugin like Opendaylight, SspGuest not in com.cloud. And they have no unit test for NetworkGuru.
So does it have any difference between them ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] huyle-uni commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
huyle-uni commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r708977962
##########
File path: plugins/network-elements/tungsten/src/main/java/com/cloud/network/guru/TungstenGuestNetworkGuru.java
##########
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package org.apache.cloudstack.network.tungsten.service;
+package com.cloud.network.guru;
Review comment:
Thanks for your explanation. I will roll it back in the next commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r731596096
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/AddTungstenFabricRoutingPolicyToNetworkCmd.java
##########
@@ -0,0 +1,72 @@
+package org.apache.cloudstack.network.tungsten.api.command;
Review comment:
please add the license notice
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r708987964
##########
File path: plugins/network-elements/tungsten/src/main/java/com/cloud/network/guru/TungstenGuestNetworkGuru.java
##########
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package org.apache.cloudstack.network.tungsten.service;
+package com.cloud.network.guru;
Review comment:
thanks @huyle-uni
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] swill commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
swill commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r642585874
##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
##########
@@ -122,6 +122,11 @@
description = "true if network offering is meant to be used for VPC, false otherwise.")
private Boolean forVpc;
+ @Parameter(name = ApiConstants.FOR_TUNGSTEN,
+ type = CommandType.BOOLEAN,
+ description = "true if network offering is meant to be used for TUNGSTEN, false otherwise.")
Review comment:
Consider calling out "Tungsten Fabric" instead of just TUNGSTEN as this is end user facing and may not be obvious for users what Tungsten is otherwise.
##########
File path: ui/scripts/docs.js
##########
@@ -629,6 +629,10 @@ cloudStack.docs = {
desc: 'Specify whether this offering is for a virtual private cloud',
externalLink: ''
},
+ helpNetworkOfferingTungsten: {
+ desc: 'Specify whether this offering is for tungsten SDN',
Review comment:
Again, for end user facing docs, I would recommend using "tungsten fabric" instead of just "tungsten"
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/VRouterVifDriver.java
##########
@@ -0,0 +1,95 @@
+package com.cloud.hypervisor.kvm.resource;
Review comment:
Missing the license header on this file.
##########
File path: api/src/main/java/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
##########
@@ -99,6 +99,10 @@
@Param(description = "true if network offering can be used by VPC networks only")
private Boolean forVpc;
+ @SerializedName(ApiConstants.FOR_TUNGSTEN)
+ @Param(description = "true if network offering can be used by tungsten networks only")
Review comment:
Another example of "tungsten" used in end user docs vs "tungsten fabric"
##########
File path: api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java
##########
@@ -190,6 +190,10 @@
@Param(description = "VPC the network belongs to")
private String vpcId;
+ @SerializedName(ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID)
+ @Param(description = "Tungsten virtual router the network belongs to")
Review comment:
Again, end user docs should have full name of "tungsten fabric"
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ConfigTungstenServiceCmd.java
##########
@@ -0,0 +1,169 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.Network;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.dao.NetworkServiceMapDao;
+import com.cloud.network.dao.NetworkServiceMapVO;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offerings.NetworkOfferingServiceMapVO;
+import com.cloud.offerings.NetworkOfferingVO;
+import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
+import com.cloud.user.Account;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.db.TransactionCallbackNoReturn;
+import com.cloud.utils.db.TransactionStatus;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.log4j.Logger;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+@APICommand(name = "configTungstenService", description = "config tungsten service", responseObject =
+ SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class ConfigTungstenServiceCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(ConfigTungstenServiceCmd.class.getName());
+ private static final String s_name = "configtungstenserviceresponse";
+ public final static String DefaultTungstenNetworkOffering = "DefaultTungstenNetworkOffering";
+
+ @Inject
+ NetworkModel _networkModel;
+ @Inject
+ NetworkOfferingDao _networkOfferingDao;
+ @Inject
+ NetworkOfferingServiceMapDao _networkOfferingServiceMapDao;
+ @Inject
+ NetworkServiceMapDao _networkServiceMapDao;
+ @Inject
+ PhysicalNetworkServiceProviderDao _physicalNetworkServiceProviderDao;
+
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true
+ , description = "the ID of zone")
+ private Long zoneId;
+
+ @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type = CommandType.UUID, entityType =
+ PhysicalNetworkResponse.class, required = true, description = "the ID of physical network")
+ private Long physicalNetworkId;
+
+ public Long getZoneId() {
+ return zoneId;
+ }
+
+ public void setZoneId(final Long zoneId) {
+ this.zoneId = zoneId;
+ }
+
+ public Long getPhysicalNetworkId() {
+ return physicalNetworkId;
+ }
+
+ public void setPhysicalNetworkId(final Long physicalNetworkId) {
+ this.physicalNetworkId = physicalNetworkId;
+ }
+
+ @Override
+ public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException,
+ ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
+ Transaction.execute(new TransactionCallbackNoReturn() {
+ @Override
+ public void doInTransactionWithoutResult(final TransactionStatus status) {
+ NetworkOfferingVO networkOfferingVO = _networkOfferingDao.findByUniqueName(
+ DefaultTungstenNetworkOffering);
+ if (networkOfferingVO == null) {
+ networkOfferingVO = new NetworkOfferingVO(DefaultTungstenNetworkOffering,
+ "Default offering for Tungsten Network", Networks.TrafficType.Guest, false, false, null, null,
+ true, NetworkOffering.Availability.Optional, null, Network.GuestType.Isolated, true, false,
+ false, false, true, false);
+ networkOfferingVO.setForTungsten(true);
+ networkOfferingVO.setState(NetworkOffering.State.Enabled);
+ _networkOfferingDao.persist(networkOfferingVO);
+
+ Map<Network.Service, Network.Provider> tungstenServiceProvider = new HashMap<>();
+ tungstenServiceProvider.put(Network.Service.Dhcp, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Dns, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.UserData, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.SourceNat, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.StaticNat, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Connectivity, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Firewall, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Lb, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.PortForwarding, Network.Provider.Tungsten);
+
+ for (Network.Service service : tungstenServiceProvider.keySet()) {
+ NetworkOfferingServiceMapVO networkOfferingServiceMapVO = new NetworkOfferingServiceMapVO(
+ networkOfferingVO.getId(), service, tungstenServiceProvider.get(service));
+ _networkOfferingServiceMapDao.persist(networkOfferingServiceMapVO);
+ }
+ }
+
+ PhysicalNetworkServiceProviderVO physicalNetworkServiceProvider =
+ _physicalNetworkServiceProviderDao.findByServiceProvider(
+ physicalNetworkId, Network.Provider.Tungsten.getName());
+ physicalNetworkServiceProvider.setState(PhysicalNetworkServiceProvider.State.Enabled);
+ _physicalNetworkServiceProviderDao.persist(physicalNetworkServiceProvider);
+
+ Network publicNetwork = _networkModel.getSystemNetworkByZoneAndTrafficType(zoneId,
+ Networks.TrafficType.Public);
+ NetworkServiceMapVO publicNetworkServiceMapVO = new NetworkServiceMapVO(publicNetwork.getId(),
+ Network.Service.Connectivity, Network.Provider.Tungsten);
+ _networkServiceMapDao.persist(publicNetworkServiceMapVO);
+
+ Network managementNetwork = _networkModel.getSystemNetworkByZoneAndTrafficType(zoneId,
+ Networks.TrafficType.Management);
+ NetworkServiceMapVO managementNetworkServiceMapVO = new NetworkServiceMapVO(managementNetwork.getId(),
+ Network.Service.Connectivity, Network.Provider.Tungsten);
+ _networkServiceMapDao.persist(managementNetworkServiceMapVO);
+ }
+ });
+
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ response.setDisplayText("config tungsten service successfully");
Review comment:
spelling? "configured tungsten service successfully". not a very important change, but figured I would mention it as I noticed it.
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenProviderCmd.java
##########
@@ -0,0 +1,137 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.TungstenProvider;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenProvider", description = "Create tungsten provider in cloudstack", responseObject =
Review comment:
consider referencing "tungsten fabric" instead of "tungsten" in the end user facing api docs. implementation is fine, it is just what we show to the users I am talking about.
##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
##########
@@ -119,14 +117,17 @@
private Long domainId;
@Parameter(name = ApiConstants.SUBDOMAIN_ACCESS,
- type = CommandType.BOOLEAN,
- description = "Defines whether to allow"
- + " subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified")
+ type = CommandType.BOOLEAN,
+ description = "Defines whether to allow"
+ + " subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified")
private Boolean subdomainAccess;
@Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC network belongs to")
private Long vpcId;
+ @Parameter(name = ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID, type = CommandType.STRING, description = "tungsten virtual router the network belongs to")
Review comment:
Again, given that it is end user facing, the description should probably reference "Tungsten Fabric" instead of just Tungsten.
##########
File path: pom.xml
##########
@@ -131,6 +131,7 @@
<cs.google-http-client>1.34.2</cs.google-http-client>
<cs.groovy.version>2.4.17</cs.groovy.version>
<cs.gson.version>1.7.2</cs.gson.version>
+ <cs.solidfire.gson.version>2.6.2</cs.solidfire.gson.version>
Review comment:
I am not entirely sure why there is solidfire changes in this PR? Maybe I am missing something?
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -0,0 +1,47 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cloud-plugin-network-tungsten</artifactId>
+ <name>Apache CloudStack Plugin - Tungsten Network</name>
Review comment:
Maybe consider updating the human readable name to "Apache CloudStack Plugin - Tungsten Fabric Network".
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ListTungstenProvidersCmd.java
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+import java.util.Arrays;
+
+@APICommand(name = "listTungstenProviders", responseObject = TungstenProviderResponse.class, description = "Lists Tungsten providers",
Review comment:
again, consider using "tungsten fabric" when referencing it in user facing docs.
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenProviderCmd.java
##########
@@ -0,0 +1,137 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.TungstenProvider;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenProvider", description = "Create tungsten provider in cloudstack", responseObject =
Review comment:
I am not going to call out all the times it happens in this file. If you take the suggestion, please update the other user facing api doc lines in this doc as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r530548412
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ListTungstenProvidersCmd.java
##########
@@ -0,0 +1,65 @@
+package org.apache.cloudstack.network.tungsten.api.command;
Review comment:
don't forget the license
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r645489863
##########
File path: client/pom.xml
##########
@@ -29,11 +29,17 @@
</parent>
<repositories>
<repository>
- <id>juniper-contrail</id>
- <url>https://juniper.github.io/contrail-maven/snapshots</url>
+ <id>juniper-tungsten-api</id>
+ <url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
Review comment:
is this going to be moved elsewhere?
##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
##########
@@ -122,6 +122,11 @@
description = "true if network offering is meant to be used for VPC, false otherwise.")
private Boolean forVpc;
+ @Parameter(name = ApiConstants.FOR_TUNGSTEN,
+ type = CommandType.BOOLEAN,
+ description = "true if network offering is meant to be used for TUNGSTEN, false otherwise.")
Review comment:
```suggestion
description = "true if network offering is meant to be used for Tungsten-Fabric, false otherwise.")
```
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenPublicNetworkCmd.java
##########
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.dc.VlanVO;
+import com.cloud.dc.dao.VlanDao;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.Network;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks;
+import com.cloud.user.Account;
+import com.cloud.utils.db.SearchCriteria;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenService;
+import org.apache.log4j.Logger;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenPublicNetwork", description = "create tungsten public network", responseObject =
Review comment:
```suggestion
@APICommand(name = "createTungstenFabricPublicNetwork", description = "create a Tungsten-Fabric public network", responseObject =
```
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/GetLoadBalancerSslCertificateCmd.java
##########
@@ -0,0 +1,82 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.lb.LoadBalancingRule;
+import com.cloud.network.lb.LoadBalancingRulesManager;
+import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.network.tungsten.api.response.TlsDataResponse;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "getLoadBalancerSslCertificate", description = "get load balancer certificate", responseObject =
+ TlsDataResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class GetLoadBalancerSslCertificateCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(GetLoadBalancerSslCertificateCmd.class.getName());
+ private static final String s_name = "response";
+
+ @Inject
+ private LoadBalancingRulesManager _lbMgr;
+
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TlsDataResponse.class, required = true,
+ description = "the ID of Lb")
+ private Long id;
+
+ @Override
+ public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException,
+ ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
+ LoadBalancingRule.LbSslCert lbSslCert = _lbMgr.getLbSslCert(id);
+ if (lbSslCert != null) {
+ TlsDataResponse tlsDataResponse = new TlsDataResponse();
+ tlsDataResponse.setCrt(Base64.encodeBase64String(lbSslCert.getCert().getBytes()));
+ tlsDataResponse.setKey(Base64.encodeBase64String(lbSslCert.getKey().getBytes()));
+ tlsDataResponse.setResponseName(s_name);
+ tlsDataResponse.setObjectName("data");
+ setResponseObject(tlsDataResponse);
+ } else {
+ throw new CloudRuntimeException("can not get tls data");
+ }
+ }
+
+ @Override
+ public String getCommandName() {
+ return s_name;
Review comment:
ususally this is
```suggestion
return s_name.toLower() + "response";
```
there is a lof of Cmd.java classes here that could be more conformant is this way.
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/GetLoadBalancerSslCertificateCmd.java
##########
@@ -0,0 +1,82 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.lb.LoadBalancingRule;
+import com.cloud.network.lb.LoadBalancingRulesManager;
+import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.network.tungsten.api.response.TlsDataResponse;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "getLoadBalancerSslCertificate", description = "get load balancer certificate", responseObject =
+ TlsDataResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class GetLoadBalancerSslCertificateCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(GetLoadBalancerSslCertificateCmd.class.getName());
+ private static final String s_name = "response";
Review comment:
this can't be good. what was the intention, here?
##########
File path: engine/schema/src/main/java/com/cloud/network/TungstenGuestNetworkIpAddressVO.java
##########
@@ -0,0 +1,78 @@
+package com.cloud.network;
Review comment:
```suggestion
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.network;
```
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenManagementNetworkCmd.java
##########
@@ -0,0 +1,91 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.dc.HostPodVO;
+import com.cloud.dc.dao.HostPodDao;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenService;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenManagementNetwork", description = "create tungsten management network",
+ responseObject = SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class CreateTungstenManagementNetworkCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(CreateTungstenManagementNetworkCmd.class.getName());
+
+ private static final String s_name = "createtungstenmanagementnetworkresponse";
Review comment:
this has a clever constuction pattern, see othe APIs and copy cleverly at your will.
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenManagementNetworkCmd.java
##########
@@ -0,0 +1,91 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.dc.HostPodVO;
+import com.cloud.dc.dao.HostPodDao;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenService;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenManagementNetwork", description = "create tungsten management network",
Review comment:
```suggestion
@APICommand(name = "createTungstenFabricManagementNetwork", description = "create a Tungsten-Fabric management network",
```
##########
File path: api/src/main/java/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
##########
@@ -99,6 +99,10 @@
@Param(description = "true if network offering can be used by VPC networks only")
private Boolean forVpc;
+ @SerializedName(ApiConstants.FOR_TUNGSTEN)
+ @Param(description = "true if network offering can be used by tungsten networks only")
Review comment:
```suggestion
@Param(description = "true if network offering can be used by Tungsten-Fabric networks only")
```
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ConfigTungstenServiceCmd.java
##########
@@ -0,0 +1,169 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.Network;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.dao.NetworkServiceMapDao;
+import com.cloud.network.dao.NetworkServiceMapVO;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offerings.NetworkOfferingServiceMapVO;
+import com.cloud.offerings.NetworkOfferingVO;
+import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
+import com.cloud.user.Account;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.db.TransactionCallbackNoReturn;
+import com.cloud.utils.db.TransactionStatus;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.log4j.Logger;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+@APICommand(name = "configTungstenService", description = "config tungsten service", responseObject =
+ SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class ConfigTungstenServiceCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(ConfigTungstenServiceCmd.class.getName());
+ private static final String s_name = "configtungstenserviceresponse";
+ public final static String DefaultTungstenNetworkOffering = "DefaultTungstenNetworkOffering";
+
+ @Inject
+ NetworkModel _networkModel;
+ @Inject
+ NetworkOfferingDao _networkOfferingDao;
+ @Inject
+ NetworkOfferingServiceMapDao _networkOfferingServiceMapDao;
+ @Inject
+ NetworkServiceMapDao _networkServiceMapDao;
+ @Inject
+ PhysicalNetworkServiceProviderDao _physicalNetworkServiceProviderDao;
+
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true
+ , description = "the ID of zone")
+ private Long zoneId;
+
+ @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type = CommandType.UUID, entityType =
+ PhysicalNetworkResponse.class, required = true, description = "the ID of physical network")
+ private Long physicalNetworkId;
+
+ public Long getZoneId() {
+ return zoneId;
+ }
+
+ public void setZoneId(final Long zoneId) {
+ this.zoneId = zoneId;
+ }
+
+ public Long getPhysicalNetworkId() {
+ return physicalNetworkId;
+ }
+
+ public void setPhysicalNetworkId(final Long physicalNetworkId) {
+ this.physicalNetworkId = physicalNetworkId;
+ }
+
+ @Override
+ public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException,
+ ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
+ Transaction.execute(new TransactionCallbackNoReturn() {
+ @Override
+ public void doInTransactionWithoutResult(final TransactionStatus status) {
+ NetworkOfferingVO networkOfferingVO = _networkOfferingDao.findByUniqueName(
+ DefaultTungstenNetworkOffering);
+ if (networkOfferingVO == null) {
+ networkOfferingVO = new NetworkOfferingVO(DefaultTungstenNetworkOffering,
+ "Default offering for Tungsten Network", Networks.TrafficType.Guest, false, false, null, null,
+ true, NetworkOffering.Availability.Optional, null, Network.GuestType.Isolated, true, false,
+ false, false, true, false);
+ networkOfferingVO.setForTungsten(true);
+ networkOfferingVO.setState(NetworkOffering.State.Enabled);
+ _networkOfferingDao.persist(networkOfferingVO);
+
+ Map<Network.Service, Network.Provider> tungstenServiceProvider = new HashMap<>();
+ tungstenServiceProvider.put(Network.Service.Dhcp, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Dns, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.UserData, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.SourceNat, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.StaticNat, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Connectivity, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Firewall, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Lb, Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.PortForwarding, Network.Provider.Tungsten);
+
+ for (Network.Service service : tungstenServiceProvider.keySet()) {
+ NetworkOfferingServiceMapVO networkOfferingServiceMapVO = new NetworkOfferingServiceMapVO(
+ networkOfferingVO.getId(), service, tungstenServiceProvider.get(service));
+ _networkOfferingServiceMapDao.persist(networkOfferingServiceMapVO);
+ }
+ }
+
+ PhysicalNetworkServiceProviderVO physicalNetworkServiceProvider =
+ _physicalNetworkServiceProviderDao.findByServiceProvider(
+ physicalNetworkId, Network.Provider.Tungsten.getName());
+ physicalNetworkServiceProvider.setState(PhysicalNetworkServiceProvider.State.Enabled);
+ _physicalNetworkServiceProviderDao.persist(physicalNetworkServiceProvider);
+
+ Network publicNetwork = _networkModel.getSystemNetworkByZoneAndTrafficType(zoneId,
+ Networks.TrafficType.Public);
+ NetworkServiceMapVO publicNetworkServiceMapVO = new NetworkServiceMapVO(publicNetwork.getId(),
+ Network.Service.Connectivity, Network.Provider.Tungsten);
+ _networkServiceMapDao.persist(publicNetworkServiceMapVO);
+
+ Network managementNetwork = _networkModel.getSystemNetworkByZoneAndTrafficType(zoneId,
+ Networks.TrafficType.Management);
+ NetworkServiceMapVO managementNetworkServiceMapVO = new NetworkServiceMapVO(managementNetwork.getId(),
+ Network.Service.Connectivity, Network.Provider.Tungsten);
+ _networkServiceMapDao.persist(managementNetworkServiceMapVO);
+ }
+ });
+
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ response.setDisplayText("config tungsten service successfully");
Review comment:
```suggestion
response.setDisplayText("configered Tungsten-Fabric service successfully");
```
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/VRouterVifDriver.java
##########
@@ -0,0 +1,95 @@
+package com.cloud.hypervisor.kvm.resource;
Review comment:
```suggestion
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.hypervisor.kvm.resource;
```
##########
File path: api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
##########
@@ -119,14 +117,17 @@
private Long domainId;
@Parameter(name = ApiConstants.SUBDOMAIN_ACCESS,
- type = CommandType.BOOLEAN,
- description = "Defines whether to allow"
- + " subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified")
+ type = CommandType.BOOLEAN,
+ description = "Defines whether to allow"
+ + " subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified")
private Boolean subdomainAccess;
@Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC network belongs to")
private Long vpcId;
+ @Parameter(name = ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID, type = CommandType.STRING, description = "tungsten virtual router the network belongs to")
Review comment:
```suggestion
@Parameter(name = ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID, type = CommandType.STRING, description = "Tungsten-Fabric virtual router the network belongs to")
```
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -0,0 +1,47 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cloud-plugin-network-tungsten</artifactId>
+ <name>Apache CloudStack Plugin - Tungsten Network</name>
Review comment:
```suggestion
<name>Apache CloudStack Plugin - Tungsten-Fabric Network</name>
```
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenProviderCmd.java
##########
@@ -0,0 +1,137 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.TungstenProvider;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenProvider", description = "Create tungsten provider in cloudstack", responseObject =
Review comment:
I agree with @swill and would advice to remove all instances of "tungsten" also internal one, for a better chance of automated maintenance, i.e.
tungsten -> tungstenFabric | TungstenFabric | Tungsten-Fabric, what ever is the most applicable.
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ListTungstenProvidersCmd.java
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.tungsten.api.command;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+import java.util.Arrays;
+
+@APICommand(name = "listTungstenProviders", responseObject = TungstenProviderResponse.class, description = "Lists Tungsten providers",
Review comment:
```suggestion
@APICommand(name = "listTungstenFabricProviders", responseObject = TungstenProviderResponse.class, description = "Lists Tungsten-Fabric providers",
```
##########
File path: api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java
##########
@@ -190,6 +190,10 @@
@Param(description = "VPC the network belongs to")
private String vpcId;
+ @SerializedName(ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID)
+ @Param(description = "Tungsten virtual router the network belongs to")
Review comment:
```suggestion
@Param(description = "Tungsten-Fabric virtual router the network belongs to")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r682873183
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -243,10 +246,12 @@
private KVMStoragePoolManager _storagePoolMgr;
private VifDriver _defaultVifDriver;
+ private VifDriver _tungstenVifDriver;
Review comment:
@huyle-uni I totally understand your point, we have too much of these "_" in the codebase from the old days and this does not make it easy for newcomers.
Thanks for addressing the review :+1:.
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -646,6 +651,9 @@ protected String getNetworkDirectDevice() {
return _networkDirectDevice;
}
+ protected String getDefaultTungstenScriptsDir() {
+ return "scripts/vm/network/tungsten";
Review comment:
Got it, thanks for the update @huyle-uni!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r648341378
##########
File path: pom.xml
##########
@@ -131,6 +131,7 @@
<cs.google-http-client>1.34.2</cs.google-http-client>
<cs.groovy.version>2.4.17</cs.groovy.version>
<cs.gson.version>1.7.2</cs.gson.version>
+ <cs.solidfire.gson.version>2.6.2</cs.solidfire.gson.version>
Review comment:
No. It's not used. I remove it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] huyle-uni commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
huyle-uni commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r658460238
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -243,10 +246,12 @@
private KVMStoragePoolManager _storagePoolMgr;
private VifDriver _defaultVifDriver;
+ private VifDriver _tungstenVifDriver;
Review comment:
It is done, but to me, this "_" is like a special rule of Cloudstack when I first read Cloudstack code. And I'm pretty sure that 90% of newcomers will have the same thinking as I do
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-989644471
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-989642345
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r731595552
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/AddTungstenRoutingPolicyToNetworkCommand.java
##########
@@ -0,0 +1,19 @@
+package org.apache.cloudstack.network.tungsten.agent.api;
Review comment:
don't forget the license
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/RemoveTungstenRoutingPolicyFromNetworkCommand.java
##########
@@ -0,0 +1,19 @@
+package org.apache.cloudstack.network.tungsten.agent.api;
Review comment:
license
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r596808922
##########
File path: engine/schema/src/main/java/com/cloud/network/TungstenGuestNetworkIpAddressVO.java
##########
@@ -0,0 +1,78 @@
+package com.cloud.network;
Review comment:
don't forget license headers, the integration builds will fail on ommision.
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/service/TungstenGuestNetworkGuru.java
##########
@@ -71,7 +71,7 @@
private static final Logger s_logger = Logger.getLogger(TungstenGuestNetworkGuru.class);
@Inject
- NetworkOfferingServiceMapDao ntwkOfferingSrvcDao;
+ public NetworkOfferingServiceMapDao _ntwkOfferingSrvcDao;
Review comment:
and please remove the _
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-859670570
@rhtyd i know there are a lot of conflicts but i'm not sure if it's a good idea to merge the latest master because there's not the old UI anymore so you will not have the UI changes since we did those changes on the old UI. I know there is someone working on implementing the UI changes on the new UI but right now those changes are not merged yet. So if i will merge the latest master the UI changes will not be available anymore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] huyle-uni commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
huyle-uni commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r658459984
##########
File path: api/src/main/java/com/cloud/network/TungstenProvider.java
##########
@@ -0,0 +1,9 @@
+package com.cloud.network;
Review comment:
Done
##########
File path: engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
##########
@@ -148,6 +148,7 @@
<bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
<bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
<bean id="ovsProviderDaoImpl" class="com.cloud.network.dao.OvsProviderDaoImpl" />
+ <bean id="TungstenControllerDaoImpl" class="com.cloud.network.dao.TungstenProviderDaoImpl"/>
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r544411790
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/service/TungstenGuestNetworkGuru.java
##########
@@ -71,7 +71,7 @@
private static final Logger s_logger = Logger.getLogger(TungstenGuestNetworkGuru.class);
@Inject
- NetworkOfferingServiceMapDao ntwkOfferingSrvcDao;
+ public NetworkOfferingServiceMapDao _ntwkOfferingSrvcDao;
Review comment:
I moved that in GuestNetworkGuru
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r708344785
##########
File path: plugins/network-elements/tungsten/src/main/java/com/cloud/network/guru/TungstenGuestNetworkGuru.java
##########
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package org.apache.cloudstack.network.tungsten.service;
+package com.cloud.network.guru;
Review comment:
this move does not seem right. are you sure you want this? nothing new should go under `com.cloud`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r636739279
##########
File path: utils/src/main/java/com/cloud/utils/TungstenUtils.java
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils;
+
+import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO : will determine later
+public class TungstenUtils {
+ private static final String tungstenBridge = "-tungsten";
+ private static final String proxyVm = "proxyvm";
+ private static final String secstoreVm = "secstorevm";
+ private static final String userVm = "userVm";
+ private static final String guestType = "guest";
+ private static final String publicType = "public";
+ private static final String managementType = "management";
+ private static final String controlType = "control";
+
+ public static final String INGRESS_RULE = "ingress";
+ public static final String EGRESS_RULE = "egress";
+
+ public static final int MAX_CIDR = 32;
+ public static final int WEB_SERVICE_PORT = 8080;
+ public static final String ALL_IP4_PREFIX = "0.0.0.0";
+ public static final String ANY_PROTO = "any";
+ public static final String DENY_ACTION = "deny";
+ public static final String PASS_ACTION = "pass";
+ public static final String ONE_WAY_DIRECTION = ">";
+ public static final String TWO_WAY_DIRECTION = "<>";
+ public static final String FABRIC_NETWORK_FQN = "default-domain:default-project:ip-fabric";
+
+ public static String getTapName(final String macAddress) {
+ return "tap" + macAddress.replace(":", "");
+ }
+
+ public static boolean isTungstenBridge(final String bridgeName) {
+ return bridgeName.contains(tungstenBridge);
+ }
+
+ public static String getBridgeName() {
+ return tungstenBridge;
+ }
+
+ public static String getVmiName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "vmi" + trafficType + vmType + nicId;
+ else
+ return "vmi" + trafficType + vmType + vmName;
+ }
+
+ public static String getInstanceIpName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "instanceIp" + trafficType + vmType + nicId;
+ else
+ return "instanceIp" + trafficType + vmType + vmName;
+ }
+
+ public static String getLogicalRouterName(long networkId) {
+ return "logicalRouter" + networkId;
+ }
+
+ public static String getNetworkGatewayVmiName(long vnId) {
+ return "internalGatewayVmi" + vnId;
+ }
+
+ public static String getNetworkGatewayIiName(long pvnId) {
+ return "internalGatewayIi" + pvnId;
+ }
+
+ public static String getPublicNetworkName(long zoneId) {
+ return "publicNetwork" + zoneId;
+ }
+
+ public static String getGuestNetworkName(String networkName) {
+ return networkName + "-" + RandomStringUtils.random(6, true, true);
+ }
+
+ public static String getManagementNetworkName(long mvnId) {
+ return "managementNetwork" + mvnId;
+ }
+
+ public static String getControlNetworkName(long cvnId) {
+ return "controlNetwork" + cvnId;
+ }
+
+ public static String getProxyVm() {
+ return proxyVm;
+ }
+
+ public static String getSecstoreVm() {
+ return secstoreVm;
+ }
+
+ public static String getUserVm() {
+ return userVm;
+ }
+
+ public static String getGuestType() {
+ return guestType;
+ }
+
+ public static String getPublicType() {
+ return publicType;
+ }
+
+ public static String getManagementType() {
+ return managementType;
+ }
+
+ public static String getVgwName(long zoneId) {
+ return "vgw" + zoneId;
+ }
+
+ public static String getVrfNetworkName(List<String> networkQualifiedName) {
+ List<String> vrfList = new ArrayList<>(networkQualifiedName);
+ vrfList.add(networkQualifiedName.get(networkQualifiedName.size() - 1));
+ return StringUtils.join(vrfList, ":");
+ }
+
+ public static String getFloatingIpPoolName(long zoneId) {
+ return "floating-ip-pool" + zoneId;
+ }
+
+ public static String getFloatingIpName(long nicId) {
+ return "floating-ip" + nicId;
+ }
+
+ public static String getSnatNetworkStartName(List<String> projectFqn, String logicalRouterUuid) {
+ return StringUtils.join(projectFqn, "__") + "__snat_" + logicalRouterUuid;
+ }
+
+ public static String getSnatNetworkEndName() {
+ return "right";
+ }
+
+ public static String getPublicNetworkPolicyName(long publicIpAddressId) {
+ return "public-network-policy" + publicIpAddressId;
+ }
+
+ public static String getVirtualNetworkPolicyName(long networkId) {
+ return "virtual-network-policy" + networkId;
+ }
+
+ public static String getDefaultPublicNetworkPolicyName(long vlanId) {
+ return "default-public-network-policy" + vlanId;
+ }
+
+ public static String getFabricNetworkPolicyName() {
+ return "fabric-network-policy";
+ }
+
+ public static String getRuleNetworkPolicyName(long ruleId) {
+ return "rule-network-policy" + ruleId;
+ }
+
+ public static String getSubnetName(long networkId) {
+ return "subnet-name" + networkId;
+ }
+
+ public static String getLoadBalancerVmiName(long publicIpId) {
+ return "loadbalancer-vmi" + publicIpId;
+ }
+
+ public static String getLoadBalancerIiName(long publicIpId) {
+ return "loadbalancer-ii" + publicIpId;
+ }
+
+ public static String getLoadBalancerName(long publicIpId) {
+ return "loadbalancer" + publicIpId;
+ }
+
+ public static String getLoadBalancerListenerName(long ruleId) {
+ return "loadbalancer-listener" + ruleId;
+ }
+
+ public static String getLoadBalancerHealthMonitorName(long publicIpId) {
+ return "loadbalancer-healthmonitor" + publicIpId;
+ }
+
+ public static String getLoadBalancerPoolName(long ruleId) {
+ return "loadbalancer-pool" + ruleId;
+ }
+
+ public static String getLoadBalancerMemberName(long ruleId, String memberIp) {
+ return "loadbalancer-member" + ruleId + memberIp;
+ }
+
+ public static String getLoadBalancerAlgorithm(String algorithm) {
+ switch (algorithm) {
+ case "leastconn":
+ return "LEAST_CONNECTIONS";
+ case "source":
+ return "SOURCE_IP";
+ default:
+ return "ROUND_ROBIN";
+ }
+ }
+
+ public static String getLoadBalancerSession(String stickiness) {
+ switch (stickiness) {
+ case "LbCookie":
+ return "HTTP_COOKIE";
+ case "AppCookie":
+ return "APP_COOKIE";
+ case "SourceBased":
+ return "SOURCE_IP";
+ default:
+ return null;
+ }
+ }
+
+ public static String getEthertTypeFromCidr(String cidr) {
+ if (NetUtils.isValidIp4Cidr(cidr)) {
+ return "IPv4";
+ } else {
+ return "IPv6";
+ }
+ }
+
+ public static String getTungstenAccessControl(String securityGroupRuleType) {
+ switch (securityGroupRuleType) {
+ case INGRESS_RULE:
+ return "ingress-access-control-list";
+ case EGRESS_RULE:
+ return "egress-access-control-list";
+ default:
+ return null;
+ }
+ }
+
+ public static String getTungstenProtocol(String protocol, String cidr) {
+ switch (protocol) {
+ case "tcp":
+ return "tcp";
+ case "udp":
+ return "udp";
Review comment:
```suggestion
return NetUtils.UDP_PROTO;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] svenvogel commented on pull request #4205: WIP - Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
svenvogel commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-666381361
@radu-todirica @huyle-uni changed name to Tungsten Fabric. 👍
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r544336252
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -130,5 +130,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.6.1</version>
+ </dependency>
Review comment:
do we really need this? we are trying to phase out all non log4j to than procy that and have a single point of upgrade. I would like to not introduce extra logging proxies/facades/frameworks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r654736915
##########
File path: api/src/main/java/com/cloud/network/TungstenProvider.java
##########
@@ -0,0 +1,9 @@
+package com.cloud.network;
Review comment:
Can you please add the license header?
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -243,10 +246,12 @@
private KVMStoragePoolManager _storagePoolMgr;
private VifDriver _defaultVifDriver;
+ private VifDriver _tungstenVifDriver;
Review comment:
Can you please remove all occurrences of underscore `_` at the beginning of the variable name?
Many variables on the codebase have `_` at the beginning but it is not aligned with the [Java variable naming convention](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html).
According to [Java variable naming convention](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html):
> A similar convention exists for the underscore character; while it's technically legal to begin your variable's name with "_", this practice is discouraged. White space is not permitted.
##########
File path: engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
##########
@@ -148,6 +148,7 @@
<bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
<bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
<bean id="ovsProviderDaoImpl" class="com.cloud.network.dao.OvsProviderDaoImpl" />
+ <bean id="TungstenControllerDaoImpl" class="com.cloud.network.dao.TungstenProviderDaoImpl"/>
Review comment:
`TungstenControllerDaoImpl` -> `tungstenControllerDaoImpl`
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -646,6 +651,9 @@ protected String getNetworkDirectDevice() {
return _networkDirectDevice;
}
+ protected String getDefaultTungstenScriptsDir() {
+ return "scripts/vm/network/tungsten";
Review comment:
What do you think of making it a constant instead of a method?
A method would be interesting if necessary outside of this class (as it is protected instead of private I assume that this is the idea).
I was not able to find occurrences outside of this class but I might be missing something here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-858425297
@radu-todirica can you also merge latest master on this? (many conflicts)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r682873998
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -646,6 +651,9 @@ protected String getNetworkDirectDevice() {
return _networkDirectDevice;
}
+ protected String getDefaultTungstenScriptsDir() {
+ return "scripts/vm/network/tungsten";
Review comment:
Got it, thanks for the update @huyle-uni!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r637003589
##########
File path: engine/schema/src/main/java/com/cloud/network/element/TungstenProviderVO.java
##########
@@ -0,0 +1,164 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.element;
+
+import com.cloud.network.TungstenProvider;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.UUID;
+
+@Entity
+@Table(name = ("tungsten_providers"))
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r654738862
##########
File path: engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
##########
@@ -148,6 +148,7 @@
<bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
<bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
<bean id="ovsProviderDaoImpl" class="com.cloud.network.dao.OvsProviderDaoImpl" />
+ <bean id="TungstenControllerDaoImpl" class="com.cloud.network.dao.TungstenProviderDaoImpl"/>
Review comment:
`<bean id="TungstenControllerDaoImpl" class...` -> `<bean id="tungstenControllerDaoImpl" class...`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] weizhouapache commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
weizhouapache commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-1039130477
@radu-todirica
can you merge latest main into your branch and fix conflicts ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-1000663177
@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r544336823
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/service/TungstenGuestNetworkGuru.java
##########
@@ -104,11 +104,11 @@ public boolean isMyTrafficType(Networks.TrafficType type) {
}
@Override
- protected boolean canHandle(NetworkOffering offering, DataCenter.NetworkType networkType,
+ public boolean canHandle(NetworkOffering offering, DataCenter.NetworkType networkType,
PhysicalNetwork physicalNetwork) {
if (networkType == DataCenter.NetworkType.Advanced && isMyTrafficType(offering.getTrafficType())
&& offering.getGuestType() == Network.GuestType.Isolated && isMyIsolationMethod(physicalNetwork)
- && ntwkOfferingSrvcDao.isProviderForNetworkOffering(offering.getId(), Network.Provider.Tungsten)) {
+ && _ntwkOfferingSrvcDao.isProviderForNetworkOffering(offering.getId(), Network.Provider.Tungsten)) {
Review comment:
please use member names without _
##########
File path: plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/service/TungstenGuestNetworkGuru.java
##########
@@ -71,7 +71,7 @@
private static final Logger s_logger = Logger.getLogger(TungstenGuestNetworkGuru.class);
@Inject
- NetworkOfferingServiceMapDao ntwkOfferingSrvcDao;
+ public NetworkOfferingServiceMapDao _ntwkOfferingSrvcDao;
Review comment:
why make this public?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r636738491
##########
File path: utils/src/main/java/com/cloud/utils/TungstenUtils.java
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.utils;
+
+import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO : will determine later
+public class TungstenUtils {
+ private static final String tungstenBridge = "-tungsten";
+ private static final String proxyVm = "proxyvm";
+ private static final String secstoreVm = "secstorevm";
+ private static final String userVm = "userVm";
+ private static final String guestType = "guest";
+ private static final String publicType = "public";
+ private static final String managementType = "management";
+ private static final String controlType = "control";
+
+ public static final String INGRESS_RULE = "ingress";
+ public static final String EGRESS_RULE = "egress";
+
+ public static final int MAX_CIDR = 32;
+ public static final int WEB_SERVICE_PORT = 8080;
+ public static final String ALL_IP4_PREFIX = "0.0.0.0";
+ public static final String ANY_PROTO = "any";
+ public static final String DENY_ACTION = "deny";
+ public static final String PASS_ACTION = "pass";
+ public static final String ONE_WAY_DIRECTION = ">";
+ public static final String TWO_WAY_DIRECTION = "<>";
+ public static final String FABRIC_NETWORK_FQN = "default-domain:default-project:ip-fabric";
+
+ public static String getTapName(final String macAddress) {
+ return "tap" + macAddress.replace(":", "");
+ }
+
+ public static boolean isTungstenBridge(final String bridgeName) {
+ return bridgeName.contains(tungstenBridge);
+ }
+
+ public static String getBridgeName() {
+ return tungstenBridge;
+ }
+
+ public static String getVmiName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "vmi" + trafficType + vmType + nicId;
+ else
+ return "vmi" + trafficType + vmType + vmName;
+ }
+
+ public static String getInstanceIpName(String trafficType, String vmType, String vmName, long nicId) {
+ if (nicId != 0 && trafficType == getGuestType())
+ return "instanceIp" + trafficType + vmType + nicId;
+ else
+ return "instanceIp" + trafficType + vmType + vmName;
+ }
+
+ public static String getLogicalRouterName(long networkId) {
+ return "logicalRouter" + networkId;
+ }
+
+ public static String getNetworkGatewayVmiName(long vnId) {
+ return "internalGatewayVmi" + vnId;
+ }
+
+ public static String getNetworkGatewayIiName(long pvnId) {
+ return "internalGatewayIi" + pvnId;
+ }
+
+ public static String getPublicNetworkName(long zoneId) {
+ return "publicNetwork" + zoneId;
+ }
+
+ public static String getGuestNetworkName(String networkName) {
+ return networkName + "-" + RandomStringUtils.random(6, true, true);
+ }
+
+ public static String getManagementNetworkName(long mvnId) {
+ return "managementNetwork" + mvnId;
+ }
+
+ public static String getControlNetworkName(long cvnId) {
+ return "controlNetwork" + cvnId;
+ }
+
+ public static String getProxyVm() {
+ return proxyVm;
+ }
+
+ public static String getSecstoreVm() {
+ return secstoreVm;
+ }
+
+ public static String getUserVm() {
+ return userVm;
+ }
+
+ public static String getGuestType() {
+ return guestType;
+ }
+
+ public static String getPublicType() {
+ return publicType;
+ }
+
+ public static String getManagementType() {
+ return managementType;
+ }
+
+ public static String getVgwName(long zoneId) {
+ return "vgw" + zoneId;
+ }
+
+ public static String getVrfNetworkName(List<String> networkQualifiedName) {
+ List<String> vrfList = new ArrayList<>(networkQualifiedName);
+ vrfList.add(networkQualifiedName.get(networkQualifiedName.size() - 1));
+ return StringUtils.join(vrfList, ":");
+ }
+
+ public static String getFloatingIpPoolName(long zoneId) {
+ return "floating-ip-pool" + zoneId;
+ }
+
+ public static String getFloatingIpName(long nicId) {
+ return "floating-ip" + nicId;
+ }
+
+ public static String getSnatNetworkStartName(List<String> projectFqn, String logicalRouterUuid) {
+ return StringUtils.join(projectFqn, "__") + "__snat_" + logicalRouterUuid;
+ }
+
+ public static String getSnatNetworkEndName() {
+ return "right";
+ }
+
+ public static String getPublicNetworkPolicyName(long publicIpAddressId) {
+ return "public-network-policy" + publicIpAddressId;
+ }
+
+ public static String getVirtualNetworkPolicyName(long networkId) {
+ return "virtual-network-policy" + networkId;
+ }
+
+ public static String getDefaultPublicNetworkPolicyName(long vlanId) {
+ return "default-public-network-policy" + vlanId;
+ }
+
+ public static String getFabricNetworkPolicyName() {
+ return "fabric-network-policy";
+ }
+
+ public static String getRuleNetworkPolicyName(long ruleId) {
+ return "rule-network-policy" + ruleId;
+ }
+
+ public static String getSubnetName(long networkId) {
+ return "subnet-name" + networkId;
+ }
+
+ public static String getLoadBalancerVmiName(long publicIpId) {
+ return "loadbalancer-vmi" + publicIpId;
+ }
+
+ public static String getLoadBalancerIiName(long publicIpId) {
+ return "loadbalancer-ii" + publicIpId;
+ }
+
+ public static String getLoadBalancerName(long publicIpId) {
+ return "loadbalancer" + publicIpId;
+ }
+
+ public static String getLoadBalancerListenerName(long ruleId) {
+ return "loadbalancer-listener" + ruleId;
+ }
+
+ public static String getLoadBalancerHealthMonitorName(long publicIpId) {
+ return "loadbalancer-healthmonitor" + publicIpId;
+ }
+
+ public static String getLoadBalancerPoolName(long ruleId) {
+ return "loadbalancer-pool" + ruleId;
+ }
+
+ public static String getLoadBalancerMemberName(long ruleId, String memberIp) {
+ return "loadbalancer-member" + ruleId + memberIp;
+ }
+
+ public static String getLoadBalancerAlgorithm(String algorithm) {
+ switch (algorithm) {
+ case "leastconn":
+ return "LEAST_CONNECTIONS";
+ case "source":
+ return "SOURCE_IP";
+ default:
+ return "ROUND_ROBIN";
+ }
+ }
+
+ public static String getLoadBalancerSession(String stickiness) {
+ switch (stickiness) {
+ case "LbCookie":
+ return "HTTP_COOKIE";
+ case "AppCookie":
+ return "APP_COOKIE";
+ case "SourceBased":
+ return "SOURCE_IP";
+ default:
+ return null;
+ }
+ }
+
+ public static String getEthertTypeFromCidr(String cidr) {
+ if (NetUtils.isValidIp4Cidr(cidr)) {
+ return "IPv4";
+ } else {
+ return "IPv6";
+ }
+ }
+
+ public static String getTungstenAccessControl(String securityGroupRuleType) {
+ switch (securityGroupRuleType) {
+ case INGRESS_RULE:
+ return "ingress-access-control-list";
+ case EGRESS_RULE:
+ return "egress-access-control-list";
+ default:
+ return null;
+ }
+ }
+
+ public static String getTungstenProtocol(String protocol, String cidr) {
+ switch (protocol) {
+ case "tcp":
+ return "tcp";
Review comment:
use constant 'NetUtils.TCP_PROTO' here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] huyle-uni commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
huyle-uni commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r658460366
##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -646,6 +651,9 @@ protected String getNetworkDirectDevice() {
return _networkDirectDevice;
}
+ protected String getDefaultTungstenScriptsDir() {
+ return "scripts/vm/network/tungsten";
Review comment:
Done. I added a function call that was missing before
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] radu-todirica commented on a change in pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
radu-todirica commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r637003448
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -0,0 +1,47 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cloud-plugin-network-tungsten</artifactId>
+ <name>Apache CloudStack Plugin - Tungsten Network</name>
+
+ <parent>
+ <groupId>org.apache.cloudstack</groupId>
+ <artifactId>cloudstack-plugins</artifactId>
+ <version>4.15.0.0-SNAPSHOT</version>
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-858424335
Hi @radu-todirica @kiwiflyer can you advise the current state and (future) plans on supported hypervisors (does it only support KVM, or also or have plans to support for VMware and XenServer)? I'm asking as we're exploring a feature around general-purpose NFVs and servicing chaining framework in CloudStack (that would allow users to BYO router/appliance).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] kiwiflyer commented on pull request #4205: Integrate Tungsten Fabric with CloudStack
Posted by GitBox <gi...@apache.org>.
kiwiflyer commented on pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#issuecomment-1065416234
@radu-todirica Can we work on getting this PR rebased to main?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org