Skip to content

Commit eddf7b9

Browse files
davecahillspark404
authored andcommitted
MidoNet Networking Plugin
- Supports DHCP, Source NAT, Static NAT, Firewall rules, Port Forwarding - Renamed MidokuraMidonet to MidoNet - Related Jira ticket is CLOUDSTACK-996 Signed-off-by: Dave Cahill <dcahill@midokura.com> Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
1 parent d392445 commit eddf7b9

19 files changed

Lines changed: 2720 additions & 80 deletions

File tree

api/src/com/cloud/network/Network.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ public static class Provider {
136136
public static final Provider VPCVirtualRouter = new Provider("VpcVirtualRouter", false);
137137
public static final Provider None = new Provider("None", false);
138138
// NiciraNvp is not an "External" provider, otherwise we get in trouble with NetworkServiceImpl.providersConfiguredForExternalNetworking
139-
public static final Provider NiciraNvp = new Provider("NiciraNvp", false);
140-
public static final Provider MidokuraMidonet = new Provider("MidokuraMidonet", true);
139+
public static final Provider NiciraNvp = new Provider("NiciraNvp", false);
141140

142141
private String name;
143142
private boolean isExternal;

api/src/com/cloud/network/Networks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public enum BroadcastDomainType {
6262
Vnet("vnet", Long.class),
6363
Storage("storage", Integer.class),
6464
Lswitch("lswitch", String.class),
65+
Mido("mido", String.class),
6566
UnDecided(null, null);
6667

6768
private String scheme;

api/src/com/cloud/network/PhysicalNetwork.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public enum IsolationMethod {
3636
L3,
3737
GRE,
3838
STT,
39-
VNS;
39+
VNS,
40+
MIDO;
4041
}
4142

4243
public enum BroadcastDomainRange {

api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public static class NetworkDevice {
4343
public static final NetworkDevice F5BigIpLoadBalancer = new NetworkDevice("F5BigIpLoadBalancer", Network.Provider.F5BigIp.getName());
4444
public static final NetworkDevice JuniperSRXFirewall = new NetworkDevice("JuniperSRXFirewall", Network.Provider.JuniperSRX.getName());
4545
public static final NetworkDevice NiciraNvp = new NetworkDevice("NiciraNvp", Network.Provider.NiciraNvp.getName());
46-
public static final NetworkDevice MidokuraMidonet = new NetworkDevice("MidokuraMidonet", Network.Provider.MidokuraMidonet.getName());
4746

4847
public NetworkDevice(String deviceName, String ntwkServiceprovider) {
4948
_name = deviceName;

client/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
<artifactId>cloud-plugin-network-vns</artifactId>
8181
<version>${project.version}</version>
8282
</dependency>
83+
<dependency>
84+
<groupId>org.apache.cloudstack</groupId>
85+
<artifactId>cloud-plugin-network-midonet</artifactId>
86+
<version>${project.version}</version>
87+
</dependency>
8388
<dependency>
8489
<groupId>org.apache.cloudstack</groupId>
8590
<artifactId>cloud-plugin-hypervisor-xen</artifactId>

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtDomainXMLParser.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ public boolean parseDomainXML(String domXML) {
111111
String bridge = getAttrValue("source", "bridge", nic);
112112
def.defBridgeNet(bridge, dev, mac,
113113
nicModel.valueOf(model.toUpperCase()));
114+
} else if (type.equalsIgnoreCase("ethernet")) {
115+
String scriptPath = getAttrValue("script", "path", nic);
116+
def.defEthernet(dev, mac, nicModel.valueOf(model.toUpperCase()), scriptPath);
114117
}
115118
interfaces.add(def);
116119
}

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,13 +711,19 @@ public void defPrivateNet(String networkName, String targetName,
711711
_model = model;
712712
}
713713

714-
public void defEthernet(String targetName, String macAddr, nicModel model) {
714+
public void defEthernet(String targetName, String macAddr, nicModel model, String scriptPath) {
715715
_netType = guestNetType.ETHERNET;
716716
_networkName = targetName;
717+
_sourceName = targetName;
717718
_macAddr = macAddr;
718719
_model = model;
720+
_scriptPath = scriptPath;
719721
}
720722

723+
public void defEthernet(String targetName, String macAddr, nicModel model) {
724+
defEthernet(targetName, macAddr, model, null);
725+
}
726+
721727
public void setHostNetType(hostNicType hostNetType) {
722728
_hostNetType = hostNetType;
723729
}
@@ -790,6 +796,9 @@ public String toString() {
790796
if (_model != null) {
791797
netBuilder.append("<model type='" + _model + "'/>\n");
792798
}
799+
if (_scriptPath != null) {
800+
netBuilder.append("<script path='" + _scriptPath + "'/>\n");
801+
}
793802
if (_virtualPortType != null) {
794803
netBuilder.append("<virtualport type='" + _virtualPortType + "'>\n");
795804
if (_virtualPortInterfaceId != null) {

plugins/network-elements/midokura-midonet/pom.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
<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">
20+
<modelVersion>4.0.0</modelVersion>
21+
<artifactId>cloud-plugin-network-midonet</artifactId>
22+
<name>Apache CloudStack Plugin - Midokura Midonet</name>
23+
<parent>
24+
<groupId>org.apache.cloudstack</groupId>
25+
<artifactId>cloudstack-plugins</artifactId>
26+
<version>4.2.0-SNAPSHOT</version>
27+
<relativePath>../../pom.xml</relativePath>
28+
</parent>
29+
<repositories>
30+
<repository>
31+
<id>mido-maven-public-releases</id>
32+
<name>mido-maven-public-releases</name>
33+
<url>https://googledrive.com/host/0B7iVfAZ_5GmJTk9PUDFNLTl5MVk/releases</url>
34+
</repository>
35+
</repositories>
36+
<dependencies>
37+
<dependency>
38+
<groupId>com.midokura</groupId>
39+
<artifactId>midonet-client</artifactId>
40+
<version>12.12.2</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.mockito</groupId>
44+
<artifactId>mockito-all</artifactId>
45+
<version>1.9.5</version>
46+
<scope>test</scope>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.apache.cloudstack</groupId>
50+
<artifactId>cloud-plugin-hypervisor-kvm</artifactId>
51+
<version>${project.version}</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.codehaus.jackson</groupId>
55+
<artifactId>jackson-core-asl</artifactId>
56+
<version>1.9.3</version>
57+
<scope>runtime</scope>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.codehaus.jackson</groupId>
61+
<artifactId>jackson-mapper-asl</artifactId>
62+
<version>1.9.3</version>
63+
<scope>runtime</scope>
64+
</dependency>
65+
</dependencies>
66+
</project>

0 commit comments

Comments
 (0)