Skip to content

Commit 4947bba

Browse files
authored
Merge branch '4.20' into usage-server-ha
2 parents d9d3a21 + 0dcbe57 commit 4947bba

71 files changed

Lines changed: 702 additions & 211 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.

agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, fi
331331
final Object resource = this;
332332
logger.info("Building class loader for com.cloud.consoleproxy.ConsoleProxy");
333333
if (consoleProxyMain == null) {
334-
logger.info("Running com.cloud.consoleproxy.ConsoleProxy with encryptor password={}", encryptorPassword);
334+
logger.info("Running com.cloud.consoleproxy.ConsoleProxy");
335335
consoleProxyMain = new Thread(new ManagedContextRunnable() {
336336
@Override
337337
protected void runInContext() {

api/src/main/java/com/cloud/network/NetworkService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ Network createGuestNetwork(long networkOfferingId, String name, String displayTe
107107
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType) throws
108108
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
109109

110+
Network createGuestNetwork(long networkOfferingId, String name, String displayText, Account owner,
111+
PhysicalNetwork physicalNetwork, long zoneId, ControlledEntity.ACLType aclType, Pair<Integer, Integer> vrIfaceMTUs) throws
112+
InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException;
113+
110114
Pair<List<? extends Network>, Integer> searchForNetworks(ListNetworksCmd cmd);
111115

112116
boolean deleteNetwork(long networkId, boolean forced);

api/src/main/java/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
4242
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "The ID of the image file")
4343
private Long id;
4444

45-
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "The name of the image file")
45+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, length = 251, description = "The name of the image file")
4646
private String templateName;
4747

4848
@Parameter(name = ApiConstants.OS_TYPE_ID,

api/src/main/java/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public class ListHostsCmd extends BaseListCmd {
109109
@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING, description = "CPU Arch of the host", since = "4.20.1")
110110
private String arch;
111111

112+
@Parameter(name = ApiConstants.VERSION, type = CommandType.STRING, description = "the host version", since = "4.20.3")
113+
private String version;
114+
112115
/////////////////////////////////////////////////////
113116
/////////////////// Accessors ///////////////////////
114117
/////////////////////////////////////////////////////
@@ -197,6 +200,10 @@ public CPU.CPUArch getArch() {
197200
return StringUtils.isBlank(arch) ? null : CPU.CPUArch.fromType(arch);
198201
}
199202

203+
public String getVersion() {
204+
return version;
205+
}
206+
200207
/////////////////////////////////////////////////////
201208
/////////////// API Implementation///////////////////
202209
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/admin/management/ListMgmtsCmd.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public class ListMgmtsCmd extends BaseListCmd {
4545
since = "4.20.1.0")
4646
private Boolean peers;
4747

48+
@Parameter(name = ApiConstants.VERSION, type = CommandType.STRING,
49+
description = "the version of the management server", since = "4.20.3")
50+
private String version;
51+
4852
/////////////////////////////////////////////////////
4953
/////////////////// Accessors ///////////////////////
5054
/////////////////////////////////////////////////////
@@ -61,6 +65,10 @@ public Boolean getPeers() {
6165
return BooleanUtils.toBooleanDefaultIfNull(peers, false);
6266
}
6367

68+
public String getVersion() {
69+
return version;
70+
}
71+
6472
/////////////////////////////////////////////////////
6573
/////////////// API Implementation///////////////////
6674
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class RegisterIsoCmd extends BaseCmd implements UserCmd {
7070
@Parameter(name = ApiConstants.IS_EXTRACTABLE, type = CommandType.BOOLEAN, description = "True if the ISO or its derivatives are extractable; default is false")
7171
private Boolean extractable;
7272

73-
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "The name of the ISO")
73+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, length = 251, description = "The name of the ISO")
7474
private String isoName;
7575

7676
@Parameter(name = ApiConstants.OS_TYPE_ID,

api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVnfApplianceCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public class DeployVnfApplianceCmd extends DeployVMCmd implements UserCmd {
4444

4545
@Parameter(name = ApiConstants.VNF_CONFIGURE_MANAGEMENT, type = CommandType.BOOLEAN, required = false,
46-
description = "True by default, security group or network rules (source nat and firewall rules) will be configured for VNF management interfaces. False otherwise. " +
46+
description = "False by default, security group or network rules (source nat and firewall rules) will be configured for VNF management interfaces. True otherwise. " +
4747
"Network rules are configured if management network is an isolated network or shared network with security groups.")
4848
private Boolean vnfConfigureManagement;
4949

api/src/main/java/org/apache/cloudstack/query/QueryService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public interface QueryService {
118118

119119
ConfigKey<String> UserVMReadOnlyDetails = new ConfigKey<>(String.class,
120120
"user.vm.readonly.details", "Advanced", "dataDiskController, rootDiskController",
121-
"List of read-only VM settings/details as comma separated string", true, ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.CSV, null);
121+
"List of read-only VM settings/details as comma separated string", true, ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.CSV, null, "");
122122

123123
ConfigKey<Boolean> SortKeyAscending = new ConfigKey<>("Advanced", Boolean.class, "sortkey.algorithm", "true",
124124
"Sort algorithm - ascending or descending - to use. For entities that use sort key(template, disk offering, service offering, " +

api/src/main/java/org/apache/cloudstack/storage/template/VnfTemplateManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.cloudstack.api.command.user.vm.DeployVnfApplianceCmd;
3030
import org.apache.cloudstack.framework.config.ConfigKey;
3131
import java.util.List;
32+
import java.util.Map;
3233

3334
public interface VnfTemplateManager {
3435

@@ -42,11 +43,12 @@ public interface VnfTemplateManager {
4243

4344
void updateVnfTemplate(long templateId, UpdateVnfTemplateCmd cmd);
4445

45-
void validateVnfApplianceNics(VirtualMachineTemplate template, List<Long> networkIds);
46+
void validateVnfApplianceNics(VirtualMachineTemplate template, List<Long> networkIds, Map<Integer, Long> vmNetworkMap);
4647

4748
SecurityGroup createSecurityGroupForVnfAppliance(DataCenter zone, VirtualMachineTemplate template, Account owner, DeployVnfApplianceCmd cmd);
4849

4950
void createIsolatedNetworkRulesForVnfAppliance(DataCenter zone, VirtualMachineTemplate template, Account owner,
5051
UserVm vm, DeployVnfApplianceCmd cmd)
5152
throws InsufficientAddressCapacityException, ResourceAllocationException, ResourceUnavailableException;
53+
5254
}

api/src/main/java/org/apache/cloudstack/storage/template/VnfTemplateUtils.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.storage.template;
1818

19+
import com.cloud.agent.api.to.deployasis.OVFNetworkTO;
1920
import com.cloud.exception.InvalidParameterValueException;
2021
import com.cloud.network.VNF;
2122
import com.cloud.storage.Storage;
@@ -124,6 +125,9 @@ public static void validateVnfNics(List<VNF.VnfNic> nicsList) {
124125
public static void validateApiCommandParams(BaseCmd cmd, VirtualMachineTemplate template) {
125126
if (cmd instanceof RegisterVnfTemplateCmd) {
126127
RegisterVnfTemplateCmd registerCmd = (RegisterVnfTemplateCmd) cmd;
128+
if (registerCmd.isDeployAsIs() && CollectionUtils.isNotEmpty(registerCmd.getVnfNics())) {
129+
throw new InvalidParameterValueException("VNF nics cannot be specified when register a deploy-as-is Template. Please wait until Template settings are read from OVA.");
130+
}
127131
validateApiCommandParams(registerCmd.getVnfDetails(), registerCmd.getVnfNics(), registerCmd.getTemplateType());
128132
} else if (cmd instanceof UpdateVnfTemplateCmd) {
129133
UpdateVnfTemplateCmd updateCmd = (UpdateVnfTemplateCmd) cmd;
@@ -149,4 +153,18 @@ public static void validateVnfCidrList(List<String> cidrList) {
149153
}
150154
}
151155
}
156+
157+
public static void validateDeployAsIsTemplateVnfNics(List<OVFNetworkTO> ovfNetworks, List<VNF.VnfNic> vnfNics) {
158+
if (CollectionUtils.isEmpty(vnfNics)) {
159+
return;
160+
}
161+
if (CollectionUtils.isEmpty(ovfNetworks)) {
162+
throw new InvalidParameterValueException("The list of networks read from OVA is empty. Please wait until the template is fully downloaded and processed.");
163+
}
164+
for (VNF.VnfNic vnfNic : vnfNics) {
165+
if (vnfNic.getDeviceId() < ovfNetworks.size() && !vnfNic.isRequired()) {
166+
throw new InvalidParameterValueException(String.format("The VNF nic [device ID: %s ] is required as it is defined in the OVA template.", vnfNic.getDeviceId()));
167+
}
168+
}
169+
}
152170
}

0 commit comments

Comments
 (0)