Skip to content

Commit 65277c3

Browse files
authored
Merge pull request #5 from apache/master
Updating fork master branch.
2 parents edc586e + e2aee99 commit 65277c3

124 files changed

Lines changed: 5918 additions & 805 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.

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ env:
9999
smoke/misc/test_vm_sync"
100100

101101
- TESTS="component/find_hosts_for_migration
102-
component/test_accounts
102+
smoke/test_accounts
103103
component/test_acl_isolatednetwork_delete
104104
component/test_acl_listsnapshot
105105
component/test_acl_listvm
@@ -124,28 +124,30 @@ env:
124124
component/test_non_contiguous_vlan
125125
component/test_persistent_networks"
126126

127-
- TESTS="component/test_projects
127+
- TESTS="smoke/test_projects
128128
component/test_project_configs
129129
component/test_project_usage
130-
component/test_regions
130+
smoke/test_regions
131131
component/test_regions_accounts
132132
component/test_routers
133133
component/test_snapshots"
134134

135135
- TESTS="component/test_project_limits
136-
component/test_resource_limits"
136+
component/test_resource_limits
137+
smoke/test_host_maintenance"
137138

138139
- TESTS="component/test_stopped_vm
139140
component/test_tags
140141
component/test_templates
141142
component/test_update_vm
142-
component/test_usage"
143+
smoke/test_usage"
143144

144145
- TESTS="component/test_volumes
145146
component/test_vpc_network
146147
component/test_vpc_offerings
147148
component/test_vpn_users"
148149

150+
149151
# FIXME: fix following tests and include them in Travis
150152
# - TESTS="component/test_affinity_groups_projects"
151153
# - TESTS="component/test_allocation_states"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static class Service {
4747
private static List<Service> supportedServices = new ArrayList<Service>();
4848

4949
public static final Service Vpn = new Service("Vpn", Capability.SupportedVpnProtocols, Capability.VpnTypes);
50-
public static final Service Dhcp = new Service("Dhcp");
50+
public static final Service Dhcp = new Service("Dhcp", Capability.ExtraDhcpOptions);
5151
public static final Service Dns = new Service("Dns", Capability.AllowDnsSuffixModification);
5252
public static final Service Gateway = new Service("Gateway");
5353
public static final Service Firewall = new Service("Firewall", Capability.SupportedProtocols, Capability.MultipleIps, Capability.TrafficStatistics,
@@ -218,6 +218,7 @@ public static class Capability {
218218
public static final Capability RegionLevelVpc = new Capability("RegionLevelVpc");
219219
public static final Capability NoVlan = new Capability("NoVlan");
220220
public static final Capability PublicAccess = new Capability("PublicAccess");
221+
public static final Capability ExtraDhcpOptions = new Capability("ExtraDhcpOptions");
221222

222223
private final String name;
223224

api/src/com/cloud/network/element/DhcpServiceProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// under the License.
1717
package com.cloud.network.element;
1818

19+
import java.util.Map;
20+
1921
import com.cloud.deploy.DeployDestination;
2022
import com.cloud.exception.ConcurrentOperationException;
2123
import com.cloud.exception.InsufficientCapacityException;
@@ -33,4 +35,6 @@ boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachi
3335
throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException;
3436

3537
boolean removeDhcpSupportForSubnet(Network network) throws ResourceUnavailableException;
38+
39+
boolean setExtraDhcpOptions(Network network, long nicId, Map<Integer, String> dhcpOptions);
3640
}

api/src/com/cloud/offering/NetworkOffering.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public enum Detail {
7878
*/
7979
Integer getMulticastRateMbps();
8080

81+
boolean getForVpc();
82+
8183
TrafficType getTrafficType();
8284

8385
boolean getSpecifyVlan();

api/src/com/cloud/storage/Storage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public boolean isShared() {
145145
}
146146

147147
public boolean supportsOverProvisioning() {
148-
return this == StoragePoolType.NetworkFilesystem || this == StoragePoolType.VMFS || this == StoragePoolType.PreSetup;
148+
return this == StoragePoolType.NetworkFilesystem || this == StoragePoolType.VMFS || this == StoragePoolType.PreSetup || this == StoragePoolType.EXT;
149149
}
150150
}
151151

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.vm;
18+
19+
import org.apache.cloudstack.api.Identity;
20+
import org.apache.cloudstack.api.InternalIdentity;
21+
22+
public interface NicExtraDhcpOption extends InternalIdentity, Identity {
23+
24+
/**
25+
* Returns the nic id for which the DHCP option applies
26+
* @return nic id
27+
*/
28+
long getNicId();
29+
30+
/**
31+
* Returns the DHCP option code
32+
* @return
33+
*/
34+
int getCode();
35+
36+
/**
37+
* Returns the Dhcp value
38+
* @return
39+
*/
40+
String getValue();
41+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public interface NicSecondaryIp extends ControlledEntity, Identity, InternalIden
3434

3535
String getIp4Address();
3636

37+
String getIp6Address();
38+
3739
long getNetworkId();
3840

3941
long getVmId();

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, E
194194
* @param memory
195195
* @param cpuNumber
196196
* @param customId
197+
* @param dhcpOptionMap
198+
* - Maps the dhcp option code and the dhcp value to the network uuid
197199
* @return UserVm object if successful.
198200
*
199201
* @throws InsufficientCapacityException
@@ -208,7 +210,7 @@ UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, E
208210
UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList,
209211
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod,
210212
String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard,
211-
List<Long> affinityGroupIdList, Map<String, String> customParameter, String customId) throws InsufficientCapacityException,
213+
List<Long> affinityGroupIdList, Map<String, String> customParameter, String customId, Map<String, Map<Integer, String>> dhcpOptionMap) throws InsufficientCapacityException,
212214
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
213215

214216
/**
@@ -267,6 +269,8 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
267269
* @param memory
268270
* @param cpuNumber
269271
* @param customId
272+
* @param dhcpOptionMap
273+
* - Maps the dhcp option code and the dhcp value to the network uuid
270274
* @return UserVm object if successful.
271275
*
272276
* @throws InsufficientCapacityException
@@ -281,7 +285,7 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
281285
UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList,
282286
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor,
283287
HTTPMethod httpmethod, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard,
284-
List<Long> affinityGroupIdList, Map<String, String> customParameters, String customId) throws InsufficientCapacityException,
288+
List<Long> affinityGroupIdList, Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap) throws InsufficientCapacityException,
285289
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
286290

287291
/**
@@ -338,6 +342,8 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
338342
* @param memory
339343
* @param cpuNumber
340344
* @param customId
345+
* @param dhcpOptionMap
346+
* - Map that maps the DhcpOption code and their value on the Network uuid
341347
* @return UserVm object if successful.
342348
*
343349
* @throws InsufficientCapacityException
@@ -352,7 +358,7 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
352358
UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner,
353359
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
354360
String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList,
355-
Map<String, String> customParameters, String customId)
361+
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap)
356362

357363
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
358364

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public class ApiConstants {
8888
public static final String UTILIZATION = "utilization";
8989
public static final String DRIVER = "driver";
9090
public static final String ROOT_DISK_SIZE = "rootdisksize";
91+
public static final String DHCP_OPTIONS_NETWORK_LIST = "dhcpoptionsnetworklist";
92+
public static final String DHCP_OPTIONS = "dhcpoptions";
93+
public static final String DHCP_PREFIX = "dhcp:";
9194
public static final String DISPLAY_NAME = "displayname";
9295
public static final String DISPLAY_NETWORK = "displaynetwork";
9396
public static final String DISPLAY_NIC = "displaynic";
@@ -111,6 +114,10 @@ public class ApiConstants {
111114
public static final String END_PORT = "endport";
112115
public static final String ENTRY_TIME = "entrytime";
113116
public static final String EXPIRES = "expires";
117+
public static final String EXTRA_DHCP_OPTION = "extradhcpoption";
118+
public static final String EXTRA_DHCP_OPTION_NAME = "extradhcpoptionname";
119+
public static final String EXTRA_DHCP_OPTION_CODE = "extradhcpoptioncode";
120+
public static final String EXTRA_DHCP_OPTION_VALUE = "extradhcpvalue";
114121
public static final String FENCE = "fence";
115122
public static final String FETCH_LATEST = "fetchlatest";
116123
public static final String FIRSTNAME = "firstname";
@@ -242,6 +249,7 @@ public class ApiConstants {
242249
public static final String SCHEDULE = "schedule";
243250
public static final String SCOPE = "scope";
244251
public static final String SECRET_KEY = "usersecretkey";
252+
public static final String SECONDARY_IP = "secondaryip";
245253
public static final String SINCE = "since";
246254
public static final String KEY = "key";
247255
public static final String SEARCH_BASE = "searchbase";
@@ -309,6 +317,7 @@ public class ApiConstants {
309317
public static final String REMOVE_VLAN = "removevlan";
310318
public static final String VLAN_ID = "vlanid";
311319
public static final String ISOLATED_PVLAN = "isolatedpvlan";
320+
public static final String ISOLATION_URI = "isolationuri";
312321
public static final String VM_AVAILABLE = "vmavailable";
313322
public static final String VM_LIMIT = "vmlimit";
314323
public static final String VM_TOTAL = "vmtotal";
@@ -410,6 +419,7 @@ public class ApiConstants {
410419
public static final String CAPACITY_IOPS = "capacityiops";
411420
public static final String NETWORK_SPEED = "networkspeed";
412421
public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";
422+
public static final String BROADCAST_URI = "broadcasturi";
413423
public static final String ISOLATION_METHOD = "isolationmethod";
414424
public static final String ISOLATION_METHODS = "isolationmethods";
415425
public static final String PHYSICAL_NETWORK_ID = "physicalnetworkid";
@@ -536,6 +546,8 @@ public class ApiConstants {
536546
public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
537547
public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
538548
public static final String NICIRA_NVP_L2_GATEWAYSERVICE_UUID = "l2gatewayserviceuuid";
549+
public static final String NSX_LOGICAL_SWITCH = "nsxlogicalswitch";
550+
public static final String NSX_LOGICAL_SWITCH_PORT = "nsxlogicalswitchport";
539551
public static final String S3_ACCESS_KEY = "accesskey";
540552
public static final String S3_SECRET_KEY = "secretkey";
541553
public static final String S3_END_POINT = "endpoint";
@@ -665,6 +677,7 @@ public class ApiConstants {
665677
public static final String SUPPORTS_PUBLIC_ACCESS = "supportspublicaccess";
666678
public static final String REGION_LEVEL_VPC = "regionlevelvpc";
667679
public static final String STRECHED_L2_SUBNET = "strechedl2subnet";
680+
public static final String NETWORK_NAME = "networkname";
668681
public static final String NETWORK_SPANNED_ZONES = "zonesnetworkspans";
669682
public static final String METADATA = "metadata";
670683
public static final String PHYSICAL_SIZE = "physicalsize";

api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
112112
description = "true if network offering supports persistent networks; defaulted to false if not specified")
113113
private Boolean isPersistent;
114114

115+
@Parameter(name = ApiConstants.FOR_VPC,
116+
type = CommandType.BOOLEAN,
117+
description = "true if network offering is meant to be used for VPC, false otherwise.")
118+
private Boolean forVpc;
119+
115120
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, since = "4.2.0", description = "Network offering details in key/value pairs."
116121
+ " Supported keys are internallbprovider/publiclbprovider with service provider as a value, and"
117122
+ " promiscuousmode/macaddresschanges/forgedtransmits with true/false as value to accept/reject the security settings if available for a nic/portgroup")
@@ -196,6 +201,10 @@ public Boolean getIsPersistent() {
196201
return isPersistent == null ? false : isPersistent;
197202
}
198203

204+
public Boolean getForVpc() {
205+
return forVpc;
206+
}
207+
199208
public Boolean getEgressDefaultPolicy() {
200209
if (egressDefaultPolicy == null) {
201210
return true;

0 commit comments

Comments
 (0)