Skip to content

Commit 698b4ce

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
Merge branch 'main' of https://github.com/NetApp/cloudstack into feature/CSTACKEX-46-new
2 parents 2e8c287 + 8a2c7fb commit 698b4ce

File tree

131 files changed

+3817
-2843
lines changed

Some content is hidden

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

131 files changed

+3817
-2843
lines changed

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,13 +1331,14 @@ public void doTask(final Task task) throws TaskExecutionException {
13311331
}
13321332
} else if (task.getType() == Task.Type.DISCONNECT) {
13331333
try {
1334-
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
1334+
// an issue has been found if reconnect immediately after disconnecting.
13351335
// wait 5 seconds before reconnecting
1336+
logger.debug("Wait for 5 secs before reconnecting, disconnect task - {}", () -> getLinkLog(task.getLink()));
13361337
Thread.sleep(5000);
13371338
} catch (InterruptedException e) {
13381339
}
13391340
shell.setConnectionTransfer(false);
1340-
logger.debug("Executing disconnect task - {}", () -> getLinkLog(task.getLink()));
1341+
logger.debug("Executing disconnect task - {} and reconnecting", () -> getLinkLog(task.getLink()));
13411342
reconnect(task.getLink());
13421343
} else if (task.getType() == Task.Type.OTHER) {
13431344
processOtherTask(task);

api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ private DatadiskTO generateDiskTO(OVFFile file, OVFDisk disk, String ovfParentPa
277277
if (StringUtils.isNotBlank(path)) {
278278
File f = new File(path);
279279
if (!f.exists() || f.isDirectory()) {
280-
logger.error("One of the attached disk or iso does not exists {}", path);
281-
throw new InternalErrorException("One of the attached disk or iso as stated on OVF does not exists " + path);
280+
logger.error("One of the attached disk or ISOs does not exists {}", path);
281+
throw new InternalErrorException("One of the attached disk or ISOs as stated on OVF does not exists " + path);
282282
}
283283
}
284284
Long capacity = disk != null ? disk._capacity : file._size;
@@ -541,7 +541,7 @@ private void matchNicsToNets(Map<String, OVFNetworkTO> nets, Node systemElement)
541541
nicCount++;
542542
String name = e.getTextContent(); // should be in our nets
543543
if(nets.get(name) == null) {
544-
logger.info("Found a nic definition without a network definition by name {}, adding it to the list.", name);
544+
logger.info("Found a NIC definition without a Network definition by name {}, adding it to the list.", name);
545545
nets.put(name, new OVFNetworkTO());
546546
}
547547
OVFNetworkTO thisNet = nets.get(name);
@@ -617,7 +617,7 @@ private Map<String, OVFNetworkTO> getNetworksFromDocumentTree(Document doc) {
617617

618618
nets.put(networkName,network);
619619
}
620-
logger.trace("Found {} networks in template", nets.size());
620+
logger.trace("Found {} Networks in Template", nets.size());
621621
return nets;
622622
}
623623

api/src/main/java/com/cloud/vm/snapshot/VMSnapshot.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity, StateObject<VMSnapshot.State> {
3030

3131
enum State {
32-
Allocated("The VM snapshot is allocated but has not been created yet."), Creating("The VM snapshot is being created."), Ready(
33-
"The VM snapshot is ready to be used."), Reverting("The VM snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
32+
Allocated("The Instance Snapshot is allocated but has not been created yet."), Creating("The Instance Snapshot is being created."), Ready(
33+
"The Instance Snapshot is ready to be used."), Reverting("The Instance Snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
3434
"The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered"),
35-
Hidden("The VM snapshot is hidden from the user and cannot be recovered.");
35+
Hidden("The Instance snapshot is hidden from the user and cannot be recovered.");
3636

3737
String _description;
3838

api/src/main/java/org/apache/cloudstack/acl/RoleType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ public static Set<RoleType> fromCombinedMask(int combinedMask) {
132132
* */
133133
public static Account.Type getAccountTypeByRole(final Role role, final Account.Type defautAccountType) {
134134
if (role != null) {
135-
LOGGER.debug("Role [{}] is not null; therefore, we use its account type [{}].", role, defautAccountType);
135+
LOGGER.debug("Role [{}] is not null; therefore, we use its Account type [{}].", role, defautAccountType);
136136
return role.getRoleType().getAccountType();
137137
}
138-
LOGGER.debug("Role is null; therefore, we use the default account type [{}] value.", defautAccountType);
138+
LOGGER.debug("Role is null; therefore, we use the default Account type [{}] value.", defautAccountType);
139139
return defautAccountType;
140140
}
141141
}

api/src/main/java/org/apache/cloudstack/alert/AlertService.java

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@
2424

2525
public interface AlertService {
2626
public static class AlertType {
27-
private static Set<AlertType> defaultAlertTypes = new HashSet<AlertType>();
27+
private static final Set<AlertType> defaultAlertTypes = new HashSet<>();
2828
private final String name;
2929
private final short type;
30+
private final boolean repetitionAllowed;
3031

31-
private AlertType(short type, String name, boolean isDefault) {
32+
private AlertType(short type, String name, boolean isDefault, boolean repetitionAllowed) {
3233
this.name = name;
3334
this.type = type;
35+
this.repetitionAllowed = repetitionAllowed;
3436
if (isDefault) {
3537
defaultAlertTypes.add(this);
3638
}
3739
}
3840

41+
private AlertType(short type, String name, boolean isDefault) {
42+
this(type, name, isDefault, false);
43+
}
44+
3945
public static final AlertType ALERT_TYPE_MEMORY = new AlertType(Capacity.CAPACITY_TYPE_MEMORY, "ALERT.MEMORY", true);
4046
public static final AlertType ALERT_TYPE_CPU = new AlertType(Capacity.CAPACITY_TYPE_CPU, "ALERT.CPU", true);
4147
public static final AlertType ALERT_TYPE_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_STORAGE, "ALERT.STORAGE", true);
@@ -45,36 +51,36 @@ private AlertType(short type, String name, boolean isDefault) {
4551
public static final AlertType ALERT_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = new AlertType(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET, "ALERT.NETWORK.IPV6SUBNET", true);
4652
public static final AlertType ALERT_TYPE_PRIVATE_IP = new AlertType(Capacity.CAPACITY_TYPE_PRIVATE_IP, "ALERT.NETWORK.PRIVATEIP", true);
4753
public static final AlertType ALERT_TYPE_SECONDARY_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE, "ALERT.STORAGE.SECONDARY", true);
48-
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true);
49-
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true);
50-
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true);
51-
public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true);
54+
public static final AlertType ALERT_TYPE_HOST = new AlertType((short)7, "ALERT.COMPUTE.HOST", true, true);
55+
public static final AlertType ALERT_TYPE_USERVM = new AlertType((short)8, "ALERT.USERVM", true, true);
56+
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER = new AlertType((short)9, "ALERT.SERVICE.DOMAINROUTER", true, true);
57+
public static final AlertType ALERT_TYPE_CONSOLE_PROXY = new AlertType((short)10, "ALERT.SERVICE.CONSOLEPROXY", true, true);
5258
public static final AlertType ALERT_TYPE_ROUTING = new AlertType((short)11, "ALERT.NETWORK.ROUTING", true);
53-
public static final AlertType ALERT_TYPE_STORAGE_MISC = new AlertType((short)12, "ALERT.STORAGE.MISC", true);
59+
public static final AlertType ALERT_TYPE_STORAGE_MISC = new AlertType((short)12, "ALERT.STORAGE.MISC", true, true);
5460
public static final AlertType ALERT_TYPE_USAGE_SERVER = new AlertType((short)13, "ALERT.USAGE", true);
55-
public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new AlertType((short)14, "ALERT.MANAGEMENT", true);
61+
public static final AlertType ALERT_TYPE_MANAGEMENT_NODE = new AlertType((short)14, "ALERT.MANAGEMENT", true, true);
5662
public static final AlertType ALERT_TYPE_DOMAIN_ROUTER_MIGRATE = new AlertType((short)15, "ALERT.NETWORK.DOMAINROUTERMIGRATE", true);
5763
public static final AlertType ALERT_TYPE_CONSOLE_PROXY_MIGRATE = new AlertType((short)16, "ALERT.SERVICE.CONSOLEPROXYMIGRATE", true);
5864
public static final AlertType ALERT_TYPE_USERVM_MIGRATE = new AlertType((short)17, "ALERT.USERVM.MIGRATE", true);
5965
public static final AlertType ALERT_TYPE_VLAN = new AlertType((short)18, "ALERT.NETWORK.VLAN", true);
60-
public static final AlertType ALERT_TYPE_SSVM = new AlertType((short)19, "ALERT.SERVICE.SSVM", true);
66+
public static final AlertType ALERT_TYPE_SSVM = new AlertType((short)19, "ALERT.SERVICE.SSVM", true, true);
6167
public static final AlertType ALERT_TYPE_USAGE_SERVER_RESULT = new AlertType((short)20, "ALERT.USAGE.RESULT", true);
6268
public static final AlertType ALERT_TYPE_STORAGE_DELETE = new AlertType((short)21, "ALERT.STORAGE.DELETE", true);
6369
public static final AlertType ALERT_TYPE_UPDATE_RESOURCE_COUNT = new AlertType((short)22, "ALERT.RESOURCE.COUNT", true);
6470
public static final AlertType ALERT_TYPE_USAGE_SANITY_RESULT = new AlertType((short)23, "ALERT.USAGE.SANITY", true);
6571
public static final AlertType ALERT_TYPE_DIRECT_ATTACHED_PUBLIC_IP = new AlertType((short)24, "ALERT.NETWORK.DIRECTPUBLICIP", true);
6672
public static final AlertType ALERT_TYPE_LOCAL_STORAGE = new AlertType((short)25, "ALERT.STORAGE.LOCAL", true);
67-
public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new AlertType((short)26, "ALERT.RESOURCE.EXCEED", true);
73+
public static final AlertType ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED = new AlertType((short)26, "ALERT.RESOURCE.EXCEED", true, true);
6874
public static final AlertType ALERT_TYPE_SYNC = new AlertType((short)27, "ALERT.TYPE.SYNC", true);
69-
public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new AlertType((short)28, "ALERT.UPLOAD.FAILED", true);
70-
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true);
71-
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true);
72-
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true);
75+
public static final AlertType ALERT_TYPE_UPLOAD_FAILED = new AlertType((short)28, "ALERT.UPLOAD.FAILED", true, true);
76+
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true, true);
77+
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true, true);
78+
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true, true);
7379
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
74-
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
75-
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
76-
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);
77-
public static final AlertType ALERT_TYPE_VPN_GATEWAY_OBSOLETE_PARAMETERS = new AlertType((short)34, "ALERT.S2S.VPN.GATEWAY.OBSOLETE.PARAMETERS", true);
80+
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)33, "ALERT.VR.PUBLIC.IFACE.MTU", true);
81+
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)34, "ALERT.VR.PRIVATE.IFACE.MTU", true);
82+
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true, true);
83+
public static final AlertType ALERT_TYPE_VPN_GATEWAY_OBSOLETE_PARAMETERS = new AlertType((short)34, "ALERT.S2S.VPN.GATEWAY.OBSOLETE.PARAMETERS", true, true);
7884
public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_BACKUP_STORAGE, "ALERT.STORAGE.BACKUP", true);
7985
public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_OBJECT_STORAGE, "ALERT.STORAGE.OBJECT", true);
8086

@@ -86,6 +92,10 @@ public String getName() {
8692
return name;
8793
}
8894

95+
public boolean isRepetitionAllowed() {
96+
return repetitionAllowed;
97+
}
98+
8999
private static AlertType getAlertType(short type) {
90100
for (AlertType alertType : defaultAlertTypes) {
91101
if (alertType.getType() == type) {
@@ -109,7 +119,7 @@ public static AlertType generateAlert(short type, String name) {
109119
if (defaultAlert != null && !defaultAlert.getName().equalsIgnoreCase(name)) {
110120
throw new InvalidParameterValueException("There is a default alert having type " + type + " and name " + defaultAlert.getName());
111121
} else {
112-
return new AlertType(type, name, false);
122+
return new AlertType(type, name, false, false);
113123
}
114124
}
115125
}

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,57 +30,57 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
3030
//////////////// API parameters /////////////////////
3131
/////////////////////////////////////////////////////
3232

33-
@Parameter(name = ApiConstants.BOOTABLE, type = CommandType.BOOLEAN, description = "true if image is bootable, false otherwise; available only for updateIso API")
33+
@Parameter(name = ApiConstants.BOOTABLE, type = CommandType.BOOLEAN, description = "True if image is bootable, false otherwise; available only for updateIso API")
3434
private Boolean bootable;
3535

36-
@Parameter(name = ApiConstants.REQUIRES_HVM, type = CommandType.BOOLEAN, description = "true if the template requires HVM, false otherwise; available only for updateTemplate API")
36+
@Parameter(name = ApiConstants.REQUIRES_HVM, type = CommandType.BOOLEAN, description = "True if the Template requires HVM, false otherwise; available only for updateTemplate API")
3737
private Boolean requiresHvm;
3838

39-
@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "the display text of the image", length = 4096)
39+
@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "The display text of the image", length = 4096)
4040
private String displayText;
4141

42-
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "the ID of the image file")
42+
@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,
4949
type = CommandType.UUID,
5050
entityType = GuestOSResponse.class,
51-
description = "the ID of the OS type that best represents the OS of this image.")
51+
description = "The ID of the OS type that best represents the OS of this image.")
5252
private Long osTypeId;
5353

5454
@Parameter(name = ApiConstants.FORCE_UPDATE_OS_TYPE, type = CommandType.BOOLEAN, since = "4.21", description = "Force OS type update. Warning: Updating OS type will " +
5555
"update the guest OS configuration for all the existing Instances deployed with this template/iso, which may affect their behavior.")
5656
private Boolean forceUpdateOsType;
5757

58-
@Parameter(name = ApiConstants.FORMAT, type = CommandType.STRING, description = "the format for the image")
58+
@Parameter(name = ApiConstants.FORMAT, type = CommandType.STRING, description = "The format for the image")
5959
private String format;
6060

61-
@Parameter(name = ApiConstants.PASSWORD_ENABLED, type = CommandType.BOOLEAN, description = "true if the image supports the password reset feature; default is false")
61+
@Parameter(name = ApiConstants.PASSWORD_ENABLED, type = CommandType.BOOLEAN, description = "True if the image supports the password reset feature; default is false")
6262
private Boolean passwordEnabled;
6363

64-
@Parameter(name = ApiConstants.SSHKEY_ENABLED, type = CommandType.BOOLEAN, description = "true if the template supports the sshkey upload feature; default is false")
64+
@Parameter(name = ApiConstants.SSHKEY_ENABLED, type = CommandType.BOOLEAN, description = "True if the Template supports the SSHkey upload feature; default is false")
6565
private Boolean sshKeyEnabled;
6666

67-
@Parameter(name = ApiConstants.SORT_KEY, type = CommandType.INTEGER, description = "sort key of the template, integer")
67+
@Parameter(name = ApiConstants.SORT_KEY, type = CommandType.INTEGER, description = "Sort key of the Template, integer")
6868
private Integer sortKey;
6969

7070
@Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE,
7171
type = CommandType.BOOLEAN,
72-
description = "true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
72+
description = "True if Template/ISO contains XS/VMWare tools in order to support dynamic scaling of Instance CPU/memory")
7373
private Boolean isDynamicallyScalable;
7474

75-
@Parameter(name = ApiConstants.ROUTING, type = CommandType.BOOLEAN, description = "true if the template type is routing i.e., if template is used to deploy router")
75+
@Parameter(name = ApiConstants.ROUTING, type = CommandType.BOOLEAN, description = "True if the Template type is routing i.e., if Template is used to deploy router")
7676
protected Boolean isRoutingType;
7777

7878
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "Details in key/value pairs using format details[i].keyname=keyvalue. Example: details[0].hypervisortoolsversion=xenserver61")
7979
protected Map details;
8080

8181
@Parameter(name = ApiConstants.CLEAN_UP_DETAILS,
8282
type = CommandType.BOOLEAN,
83-
description = "optional boolean field, which indicates if details should be cleaned up or not (if set to true, details removed for this resource, details field ignored; if false or not set, no action)")
83+
description = "Optional boolean field, which indicates if details should be cleaned up or not (if set to true, details removed for this resource, details field ignored; if false or not set, no action)")
8484
private Boolean cleanupDetails;
8585

8686
@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING,

0 commit comments

Comments
 (0)