Skip to content

Commit 96c2493

Browse files
author
Murali Reddy
committed
Conflicts: server/src/com/cloud/network/NetworkManagerImpl.java
2 parents e7a554f + 33b87d8 commit 96c2493

77 files changed

Lines changed: 2456 additions & 539 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/agent/api/routing/DhcpEntryCommand.java

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public class DhcpEntryCommand extends NetworkElementCommand {
2828
String defaultRouter;
2929
String staticRoutes;
3030
String defaultDns;
31-
31+
String vmIp6Address;
32+
String ip6Gateway;
33+
String duid;
3234

3335
protected DhcpEntryCommand() {
3436

@@ -39,14 +41,15 @@ public boolean executeInSequence() {
3941
return true;
4042
}
4143

42-
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName) {
44+
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String vmIp6Address) {
4345
this.vmMac = vmMac;
4446
this.vmIpAddress = vmIpAddress;
4547
this.vmName = vmName;
48+
this.vmIp6Address = vmIp6Address;
4649
}
4750

48-
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String dns, String gateway) {
49-
this(vmMac, vmIpAddress, vmName);
51+
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String vmIp6Address, String dns, String gateway, String ip6Gateway) {
52+
this(vmMac, vmIpAddress, vmName, vmIp6Address);
5053
this.dns = dns;
5154
this.gateway = gateway;
5255
}
@@ -102,4 +105,28 @@ public String getDefaultDns() {
102105
public void setDefaultDns(String defaultDns) {
103106
this.defaultDns = defaultDns;
104107
}
108+
109+
public String getIp6Gateway() {
110+
return ip6Gateway;
111+
}
112+
113+
public void setIp6Gateway(String ip6Gateway) {
114+
this.ip6Gateway = ip6Gateway;
115+
}
116+
117+
public String getDuid() {
118+
return duid;
119+
}
120+
121+
public void setDuid(String duid) {
122+
this.duid = duid;
123+
}
124+
125+
public String getVmIp6Address() {
126+
return vmIp6Address;
127+
}
128+
129+
public void setVmIp6Address(String ip6Address) {
130+
this.vmIp6Address = ip6Address;
131+
}
105132
}

api/src/com/cloud/dc/Vlan.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ public enum VlanType {
4444

4545
public Long getPhysicalNetworkId();
4646

47+
public String getIp6Gateway();
48+
49+
public String getIp6Cidr();
50+
51+
public String getIp6Range();
4752
}

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,33 @@ private State(String description) {
232232
_description = description;
233233
}
234234
}
235-
235+
236+
public class IpAddresses {
237+
private String ip4Address;
238+
private String ip6Address;
239+
240+
public IpAddresses(String ip4Address, String ip6Address) {
241+
this.setIp4Address(ip4Address);
242+
this.setIp6Address(ip6Address);
243+
}
244+
245+
public String getIp4Address() {
246+
return ip4Address;
247+
}
248+
249+
public void setIp4Address(String ip4Address) {
250+
this.ip4Address = ip4Address;
251+
}
252+
253+
public String getIp6Address() {
254+
return ip6Address;
255+
}
256+
257+
public void setIp6Address(String ip6Address) {
258+
this.ip6Address = ip6Address;
259+
}
260+
}
261+
236262
String getName();
237263

238264
Mode getMode();
@@ -244,7 +270,11 @@ private State(String description) {
244270
String getGateway();
245271

246272
String getCidr();
247-
273+
274+
String getIp6Gateway();
275+
276+
String getIp6Cidr();
277+
248278
long getDataCenterId();
249279

250280
long getNetworkOfferingId();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,5 @@ Map<PublicIpAddress, Set<Service>> getIpToServices(List<? extends PublicIpAddres
249249

250250
boolean isNetworkInlineMode(Network network);
251251

252+
Vlan getVlanForNetwork(long networkId);
252253
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public class NetworkProfile implements Network {
3939
private TrafficType trafficType;
4040
private String gateway;
4141
private String cidr;
42+
private String ip6Gateway;
43+
private String ip6Cidr;
4244
private long networkOfferingId;
4345
private long related;
4446
private String displayText;
@@ -64,6 +66,8 @@ public NetworkProfile(Network network) {
6466
this.trafficType = network.getTrafficType();
6567
this.gateway = network.getGateway();
6668
this.cidr = network.getCidr();
69+
this.ip6Gateway = network.getIp6Gateway();
70+
this.ip6Cidr = network.getIp6Cidr();
6771
this.networkOfferingId = network.getNetworkOfferingId();
6872
this.related = network.getRelated();
6973
this.displayText = network.getDisplayText();
@@ -230,4 +234,14 @@ public Long getVpcId() {
230234
public void setTrafficType(TrafficType type) {
231235
this.trafficType = type;
232236
}
237+
238+
@Override
239+
public String getIp6Gateway() {
240+
return ip6Gateway;
241+
}
242+
243+
@Override
244+
public String getIp6Cidr() {
245+
return ip6Cidr;
246+
}
233247
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public enum Mode {
4848
public enum AddressFormat {
4949
Ip4,
5050
Ip6,
51-
Mixed
51+
DualStack
5252
}
5353

5454
/**

api/src/com/cloud/vm/Nic.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,10 @@ public enum ReservationStrategy {
144144
VirtualMachine.Type getVmType();
145145

146146
AddressFormat getAddressFormat();
147+
148+
String getIp6Gateway();
149+
150+
String getIp6Cidr();
151+
152+
String getIp6Address();
147153
}

api/src/com/cloud/vm/NicProfile.java

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public class NicProfile implements InternalIdentity {
3737
TrafficType trafficType;
3838
String ip4Address;
3939
String ip6Address;
40+
String ip6Gateway;
41+
String ip6Cidr;
4042
String macAddress;
4143
URI isolationUri;
4244
String netmask;
@@ -50,7 +52,8 @@ public class NicProfile implements InternalIdentity {
5052
Integer networkRate;
5153
boolean isSecurityGroupEnabled;
5254
String name;
53-
String requestedIp;
55+
String requestedIpv4;
56+
String requestedIpv6;
5457

5558
public String getDns1() {
5659
return dns1;
@@ -218,7 +221,7 @@ public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri,
218221
this.trafficType = network.getTrafficType();
219222
this.ip4Address = nic.getIp4Address();
220223
this.format = nic.getAddressFormat();
221-
this.ip6Address = null;
224+
this.ip6Address = nic.getIp6Address();
222225
this.macAddress = nic.getMacAddress();
223226
this.reservationId = nic.getReservationId();
224227
this.strategy = nic.getReservationStrategy();
@@ -230,6 +233,8 @@ public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri,
230233
this.isSecurityGroupEnabled = isSecurityGroupEnabled;
231234
this.vmId = nic.getInstanceId();
232235
this.name = name;
236+
this.ip6Cidr = nic.getIp6Cidr();
237+
this.ip6Gateway = nic.getIp6Gateway();
233238

234239
if (networkRate != null) {
235240
this.networkRate = networkRate;
@@ -245,8 +250,9 @@ public NicProfile(ReservationStrategy strategy, String ip4Address, String macAdd
245250
this.strategy = strategy;
246251
}
247252

248-
public NicProfile(String requestedIp) {
249-
this.requestedIp = requestedIp;
253+
public NicProfile(String requestedIpv4, String requestedIpv6) {
254+
this.requestedIpv4 = requestedIpv4;
255+
this.requestedIpv6 = requestedIpv6;
250256
}
251257

252258
public NicProfile() {
@@ -272,8 +278,8 @@ public void setSecurityGroupEnabled(boolean enabled) {
272278
this.isSecurityGroupEnabled = enabled;
273279
}
274280

275-
public String getRequestedIp() {
276-
return requestedIp;
281+
public String getRequestedIpv4() {
282+
return requestedIpv4;
277283
}
278284

279285
public void deallocate() {
@@ -301,4 +307,28 @@ public String toString() {
301307
append(reservationId).append("-").append(ip4Address).append("-").append(broadcastUri).toString();
302308
}
303309

310+
public String getIp6Gateway() {
311+
return ip6Gateway;
312+
}
313+
314+
public void setIp6Gateway(String ip6Gateway) {
315+
this.ip6Gateway = ip6Gateway;
316+
}
317+
318+
public String getIp6Cidr() {
319+
return ip6Cidr;
320+
}
321+
322+
public void setIp6Cidr(String ip6Cidr) {
323+
this.ip6Cidr = ip6Cidr;
324+
}
325+
326+
public String getRequestedIpv6() {
327+
return requestedIpv6;
328+
}
329+
330+
public void setRequestedIpv6(String requestedIpv6) {
331+
this.requestedIpv6 = requestedIpv6;
332+
}
333+
304334
}

api/src/com/cloud/vm/UserVmService.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.cloud.exception.VirtualMachineMigrationException;
4848
import com.cloud.host.Host;
4949
import com.cloud.hypervisor.Hypervisor.HypervisorType;
50+
import com.cloud.network.Network.IpAddresses;
5051
import com.cloud.offering.ServiceOffering;
5152
import com.cloud.storage.StoragePool;
5253
import com.cloud.storage.Volume;
@@ -228,7 +229,7 @@ UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, E
228229
* @throws InsufficientResourcesException
229230
*/
230231
UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner, String hostName,
231-
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps, String defaultIp, String keyboard)
232+
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, String keyboard)
232233
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
233234

234235
/**
@@ -275,7 +276,7 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
275276
* - name of the ssh key pair used to login to the virtual machine
276277
* @param requestedIps
277278
* TODO
278-
* @param defaultIp
279+
* @param defaultIps
279280
* TODO
280281
* @param accountName
281282
* - an optional account for the virtual machine. Must be used with domainId
@@ -293,8 +294,8 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
293294
* @throws InsufficientResourcesException
294295
*/
295296
UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, List<Long> securityGroupIdList,
296-
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps,
297-
String defaultIp, String keyboard)
297+
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps,
298+
IpAddresses defaultIps, String keyboard)
298299
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
299300

300301
/**
@@ -339,8 +340,7 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
339340
* - name of the ssh key pair used to login to the virtual machine
340341
* @param requestedIps
341342
* TODO
342-
* @param defaultIp
343-
* TODO
343+
* @param defaultIps TODO
344344
* @param accountName
345345
* - an optional account for the virtual machine. Must be used with domainId
346346
* @param domainId
@@ -357,7 +357,7 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
357357
* @throws InsufficientResourcesException
358358
*/
359359
UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner, String hostName,
360-
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps, String defaultIp, String keyboard)
360+
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, String keyboard)
361361
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
362362

363363
/**

api/src/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class ApiConstants {
3838
public static final String DOMAIN_SUFFIX = "domainsuffix";
3939
public static final String DNS_SEARCH_ORDER = "dnssearchorder";
4040
public static final String CIDR = "cidr";
41+
public static final String IP6_CIDR = "ip6cidr";
4142
public static final String CIDR_LIST = "cidrlist";
4243
public static final String CLEANUP = "cleanup";
4344
public static final String CLUSTER_ID = "clusterid";
@@ -64,6 +65,7 @@ public class ApiConstants {
6465
public static final String EMAIL = "email";
6566
public static final String END_DATE = "enddate";
6667
public static final String END_IP = "endip";
68+
public static final String END_IPV6 = "endipv6";
6769
public static final String END_PORT = "endport";
6870
public static final String ENTRY_TIME = "entrytime";
6971
public static final String FETCH_LATEST = "fetchlatest";
@@ -73,6 +75,7 @@ public class ApiConstants {
7375
public static final String FORMAT = "format";
7476
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
7577
public static final String GATEWAY = "gateway";
78+
public static final String IP6_GATEWAY = "ip6gateway";
7679
public static final String GROUP = "group";
7780
public static final String GROUP_ID = "groupid";
7881
public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
@@ -90,6 +93,7 @@ public class ApiConstants {
9093
public static final String INTERNAL_DNS2 = "internaldns2";
9194
public static final String INTERVAL_TYPE = "intervaltype";
9295
public static final String IP_ADDRESS = "ipaddress";
96+
public static final String IP6_ADDRESS = "ip6address";
9397
public static final String IP_ADDRESS_ID = "ipaddressid";
9498
public static final String IS_ASYNC = "isasync";
9599
public static final String IP_AVAILABLE = "ipavailable";
@@ -181,6 +185,7 @@ public class ApiConstants {
181185
public static final String SOURCE_ZONE_ID = "sourcezoneid";
182186
public static final String START_DATE = "startdate";
183187
public static final String START_IP = "startip";
188+
public static final String START_IPV6 = "startipv6";
184189
public static final String START_PORT = "startport";
185190
public static final String STATE = "state";
186191
public static final String STATUS = "status";

0 commit comments

Comments
 (0)