Skip to content

Commit 03de9cc

Browse files
Suresh Ramamurthyspark404
authored andcommitted
CLOUDSTACK-6845 : NuageVsp Network plugin
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
1 parent 43dffaa commit 03de9cc

75 files changed

Lines changed: 6424 additions & 35 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/src/com/cloud/event/EventTypes.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ public class EventTypes {
428428
public static final String EVENT_EXTERNAL_OVS_CONTROLLER_ADD = "PHYSICAL.OVSCONTROLLER.ADD";
429429
public static final String EVENT_EXTERNAL_OVS_CONTROLLER_DELETE = "PHYSICAL.OVSCONTROLLER.DELETE";
430430

431+
// external network mapping events
432+
public static final String EVENT_EXTERNAL_VSP_VSD_ADD = "PHYSICAL.NUAGE.VSD.ADD";
433+
public static final String EVENT_EXTERNAL_VSP_VSD_DELETE = "PHYSICAL.NUAGE.VSD.DELETE";
431434
// AutoScale
432435
public static final String EVENT_COUNTER_CREATE = "COUNTER.CREATE";
433436
public static final String EVENT_COUNTER_DELETE = "COUNTER.DELETE";
@@ -824,6 +827,10 @@ public class EventTypes {
824827
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_DELETE, "NvpController");
825828
entityEventDetails.put(EVENT_EXTERNAL_NVP_CONTROLLER_CONFIGURE, "NvpController");
826829

830+
// external network mapping events
831+
entityEventDetails.put(EVENT_EXTERNAL_VSP_VSD_ADD, "NuageVsp");
832+
entityEventDetails.put(EVENT_EXTERNAL_VSP_VSD_DELETE, "NuageVsp");
833+
827834
// AutoScale
828835
entityEventDetails.put(EVENT_COUNTER_CREATE, AutoScaleCounter.class);
829836
entityEventDetails.put(EVENT_COUNTER_DELETE, AutoScaleCounter.class);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ public static class Provider {
132132
// add new Ovs provider
133133
public static final Provider Ovs = new Provider("Ovs", false);
134134
public static final Provider Opendaylight = new Provider("Opendaylight", false);
135+
// add Nuage Vsp Providers
136+
public static final Provider NuageVsp = new Provider("NuageVsp", false);
137+
public static final Provider NuageVspVpc = new Provider("NuageVspVpc", false);
135138

136139
private final String name;
137140
private final boolean isExternal;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ public <T> URI toUri(T value) {
109109
}
110110
}
111111
},
112-
UnDecided(null, null), OpenDaylight("opendaylight", String.class);
112+
UnDecided(null, null), OpenDaylight("opendaylight", String.class),
113+
Vsp("vsp", String.class),;
113114

114115
private final String scheme;
115116
private final Class<?> type;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public enum State {
3333
}
3434

3535
public enum IsolationMethod {
36-
VLAN, L3, GRE, STT, VNS, MIDO, SSP, VXLAN, ODL, L3VPN;
36+
VLAN, L3, GRE, STT, VNS, MIDO, SSP, VXLAN, ODL, L3VPN, VSP;
3737
}
3838

3939
public enum BroadcastDomainRange {

client/WEB-INF/classes/resources/messages.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ label.add.new.SRX=Add new SRX
327327
label.add.new.PA=Add new Palo Alto
328328
label.add.new.tier=Add new tier
329329
label.add.NiciraNvp.device=Add Nvp Controller
330+
label.add.NuageVsp.device=Add Nuage Virtualized Services Directory (VSD)
330331
label.add.physical.network=Add physical network
331332
label.add.pod=Add Pod
332333
label.add.port.forwarding.rule=Add port forwarding rule
@@ -387,6 +388,7 @@ label.anti.affinity.group=Anti-affinity Group
387388
label.anti.affinity.groups=Anti-affinity Groups
388389
label.anti.affinity=Anti-affinity
389390
label.api.key=API Key
391+
label.api.version=API Version
390392
label.apply=Apply
391393
label.assign.to.load.balancer=Assigning instance to load balancer
392394
label.assign=Assign
@@ -501,6 +503,7 @@ label.delete.F5=Delete F5
501503
label.delete.gateway=delete gateway
502504
label.delete.NetScaler=Delete NetScaler
503505
label.delete.NiciraNvp=Remove Nvp Controller
506+
label.delete.NuageVsp=Remove Nuage VSD
504507
label.delete.project=Delete project
505508
label.delete.SRX=Delete SRX
506509
label.delete.PA=Delete Palo Alto
@@ -1009,6 +1012,7 @@ label.restart.network=Restart network
10091012
label.restart.required=Restart required
10101013
label.restart.vpc=restart VPC
10111014
label.restore=Restore
1015+
label.retry.interval=Retry Interval
10121016
label.review=Review
10131017
label.revoke.project.invite=Revoke invitation
10141018
label.role=Role
@@ -1631,6 +1635,7 @@ message.configuring.storage.traffic=Configuring storage traffic
16311635
message.confirm.action.force.reconnect=Please confirm that you want to force reconnect this host.
16321636
message.confirm.delete.F5=Please confirm that you would like to delete F5
16331637
message.confirm.delete.NetScaler=Please confirm that you would like to delete NetScaler
1638+
message.confirm.delete.NuageVsp=Please confirm that you would like to delete Nuage Virtualized Services Directory
16341639
message.confirm.delete.SRX=Please confirm that you would like to delete SRX
16351640
message.confirm.delete.PA=Please confirm that you would like to delete Palo Alto
16361641
message.confirm.destroy.router=Please confirm that you would like to destroy this router

client/WEB-INF/classes/resources/messages_zh_CN.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ label.add.new.SRX=\u6dfb\u52a0\u65b0 SRX
297297
label.add.new.tier=\u6dfb\u52a0\u65b0\u5c42
298298
label.add.nfs.secondary.staging.store=\u6dfb\u52a0 NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8
299299
label.add.NiciraNvp.device=\u6dfb\u52a0 Nvp \u63a7\u5236\u5668
300+
label.add.NuageVsp.device=\u6DFB\u52A0 Nuage \u865A\u62DF\u670D\u52A1\u76EE\u5F55 (VSD)
300301
label.add.OpenDaylight.device=\u6dfb\u52a0 OpenDaylight \u63a7\u5236\u5668
301302
label.add.PA.device=\u6dfb\u52a0 Palo Alto \u8bbe\u5907
302303
label.add.physical.network=\u6dfb\u52a0\u7269\u7406\u7f51\u7edc
@@ -355,6 +356,7 @@ label.anti.affinity.groups=\u53cd\u5173\u8054\u6027\u7ec4
355356
label.anti.affinity.group=\u53cd\u5173\u8054\u6027\u7ec4
356357
label.anti.affinity=\u53cd\u5173\u8054\u6027
357358
label.api.key=API \u5bc6\u94a5
359+
label.api.version=API \u7248\u672C
358360
label.apply=\u5e94\u7528
359361
label.app.name=CloudStack
360362
label.archive.alerts=\u5b58\u6863\u8b66\u62a5
@@ -508,6 +510,7 @@ label.delete.F5=\u5220\u9664 F5
508510
label.delete.gateway=\u5220\u9664\u7f51\u5173
509511
label.delete.NetScaler=\u5220\u9664 NetScaler
510512
label.delete.NiciraNvp=\u79fb\u9664 Nvp \u63a7\u5236\u5668
513+
label.delete.NuageVsp=\u5220\u9664 Nuage VSD
511514
label.delete.OpenDaylight.device=\u5220\u9664 OpenDaylight \u63a7\u5236\u5668
512515
label.delete.PA=\u5220\u9664 Palo Alto
513516
label.delete.portable.ip.range=\u5220\u9664\u53ef\u79fb\u690d IP \u8303\u56f4
@@ -1142,6 +1145,7 @@ label.restart.network=\u91cd\u65b0\u542f\u52a8\u7f51\u7edc
11421145
label.restart.required=\u9700\u8981\u91cd\u65b0\u542f\u52a8
11431146
label.restart.vpc=\u91cd\u65b0\u542f\u52a8 VPC
11441147
label.restore=\u8fd8\u539f
1148+
label.retry.interval=\u91cd\u8bd5\u95f4\u9694
11451149
label.review=\u6838\u5bf9
11461150
label.revoke.project.invite=\u64a4\u9500\u9080\u8bf7
11471151
label.role=\u89d2\u8272
@@ -1607,6 +1611,7 @@ message.confirm.dedicate.zone=\u662f\u5426\u8981\u5c06\u6b64\u8d44\u6e90\u57df\u
16071611
message.confirm.delete.ciscovnmc.resource=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 CiscoVNMC \u8d44\u6e90
16081612
message.confirm.delete.F5=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 F5
16091613
message.confirm.delete.NetScaler=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 NetScaler
1614+
message.confirm.delete.NuageVsp=\u8BF7\u786E\u8BA4\u5220\u9664 Nuage \u865A\u62DF\u670D\u52A1\u76EE\u5F55
16101615
message.confirm.delete.PA=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 Palo Alto
16111616
message.confirm.delete.secondary.staging.store=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8\u3002
16121617
message.confirm.delete.SRX=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 SRX

client/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@
105105
<artifactId>cloud-plugin-network-netscaler</artifactId>
106106
<version>${project.version}</version>
107107
</dependency>
108+
<dependency>
109+
<groupId>org.apache.cloudstack</groupId>
110+
<artifactId>cloud-plugin-network-vsp</artifactId>
111+
<version>${project.version}</version>
112+
</dependency>
108113
<dependency>
109114
<groupId>org.apache.cloudstack</groupId>
110115
<artifactId>cloud-plugin-network-ovs</artifactId>
@@ -943,6 +948,21 @@
943948
</dependency>
944949
</dependencies>
945950
</profile>
951+
<profile>
952+
<id>nuagevsp</id>
953+
<activation>
954+
<property>
955+
<name>noredist</name>
956+
</property>
957+
</activation>
958+
<dependencies>
959+
<dependency>
960+
<groupId>org.apache.cloudstack</groupId>
961+
<artifactId>cloud-plugin-network-vsp</artifactId>
962+
<version>${project.version}</version>
963+
</dependency>
964+
</dependencies>
965+
</profile>
946966
<profile>
947967
<id>srx</id>
948968
<activation>

client/tomcatconf/commands.properties.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ listBigSwitchVnsDevices=1
618618
addStratosphereSsp=1
619619
deleteStratoshereSsp=1
620620

621+
#### nuage vsp commands
622+
623+
addNuageVspDevice=1
624+
deleteNuageVspDevice=1
625+
listNuageVspDevices=1
626+
issueNuageVspResourceRequest=15
627+
621628
#### host simulator commands
622629

623630
configureSimulator=1

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter) throw
9393
String brName = "OVSTunnel" + vnetId;
9494
s_logger.debug("nic " + nic + " needs to be connected to LogicalSwitch " + brName);
9595
intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter), networkRateKBps);
96+
} else if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vsp) {
97+
intf.setVirtualPortInterfaceId(nic.getUuid());
98+
String brName = (trafficLabel != null && !trafficLabel.isEmpty()) ? _pifs.get(trafficLabel) : _pifs.get("private");
99+
intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter), networkRateKBps);
96100
} else {
97101
intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter), networkRateKBps);
98102
}

plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ private PlugNicAnswer execute(PlugNicCommand cmd) {
931931
deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
932932

933933
vmConfigSpec.getDeviceChange().add(deviceConfigSpec);
934+
setNuageVspVrIpInExtraConfig(vmConfigSpec.getExtraConfig(), nicTo);
934935
if (!vmMo.configureVm(vmConfigSpec)) {
935936
throw new Exception("Failed to configure devices when running PlugNicCommand");
936937
}
@@ -1900,11 +1901,23 @@ private static void configNvpExtraOption(List<OptionValue> extraOptions, Virtual
19001901
newVal.setKey("nvp.iface-id." + nicNum);
19011902
newVal.setValue(nicTo.getUuid());
19021903
extraOptions.add(newVal);
1904+
setNuageVspVrIpInExtraConfig(extraOptions, nicTo);
19031905
}
19041906
nicNum++;
19051907
}
19061908
}
19071909

1910+
private static void setNuageVspVrIpInExtraConfig(List<OptionValue> extraOptions, NicTO nicTo) {
1911+
URI broadcastUri = nicTo.getBroadcastUri();
1912+
if (broadcastUri != null && broadcastUri.getScheme().equalsIgnoreCase(Networks.BroadcastDomainType.Vsp.scheme())) {
1913+
String path = broadcastUri.getPath();
1914+
OptionValue newVal = new OptionValue();
1915+
newVal.setKey("vsp.vr-ip." + nicTo.getMac());
1916+
newVal.setValue(path.substring(1));
1917+
extraOptions.add(newVal);
1918+
}
1919+
}
1920+
19081921
private static void configCustomExtraOption(List<OptionValue> extraOptions, VirtualMachineTO vmSpec) {
19091922
// we no longer to validation anymore
19101923
for (Map.Entry<String, String> entry : vmSpec.getDetails().entrySet()) {

0 commit comments

Comments
 (0)