Skip to content

Commit db00388

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 5f52664 + 935c568 commit db00388

195 files changed

Lines changed: 5533 additions & 1744 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.

.asf.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ github:
5353
- acs-robot
5454
- gpordeus
5555
- hsato03
56-
- bernardodemarco
5756
- FelipeM525
5857
- lucas-a-martins
5958
- nicoschmdt
6059
- abh1sar
61-
- sudo87
6260
- rosi-shapeblue
61+
- sudo87
6362

6463
protected_branches: ~
6564

.github/linters/.markdown-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ MD046: false
8686

8787
# MD052/reference-links-images Reference links and images should use a label that is defined
8888
MD052: false
89+
90+
# MD059/descriptive-link-text Link text should be descriptive
91+
MD059: false

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ repos:
2525
hooks:
2626
- id: identity
2727
- id: check-hooks-apply
28+
- repo: https://github.com/gitleaks/gitleaks
29+
rev: v8.27.2
30+
hooks:
31+
- id: gitleaks
32+
name: run gitleaks
33+
description: detect hardcoded secrets
2834
- repo: https://github.com/pre-commit/pre-commit-hooks
2935
rev: v4.6.0
3036
hooks:
@@ -87,7 +93,7 @@ repos:
8793
^setup/bindir/cloud-setup-encryption\.in$|
8894
^venv/.*$
8995
- repo: https://github.com/igorshubovych/markdownlint-cli
90-
rev: v0.43.0
96+
rev: v0.45.0
9197
hooks:
9298
- id: markdownlint
9399
name: run markdownlint

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ public class AgentProperties{
155155
*/
156156
public static final Property<Integer> CMDS_TIMEOUT = new Property<>("cmds.timeout", 7200);
157157

158+
/**
159+
* The timeout (in seconds) for the snapshot merge operation, mainly used for classic volume snapshots and disk-only VM snapshots on file-based storage.<br>
160+
* This configuration is only considered if libvirt.events.enabled is also true. <br>
161+
* Data type: Integer.<br>
162+
* Default value: <code>259200</code>
163+
*/
164+
public static final Property<Integer> QCOW2_DELTA_MERGE_TIMEOUT = new Property<>("qcow2.delta.merge.timeout", 60 * 60 * 72);
165+
158166
/**
159167
* This parameter sets the VM migration speed (in mbps). The default value is -1,<br>
160168
* which means that the agent will try to guess the speed of the guest network and consume all possible bandwidth.<br>
@@ -833,7 +841,7 @@ public static class Property <T>{
833841
private T defaultValue;
834842
private Class<T> typeClass;
835843

836-
Property(String name, T value) {
844+
public Property(String name, T value) {
837845
init(name, value);
838846
}
839847

api/src/main/java/com/cloud/storage/VolumeApiService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Volume updateVolume(long volumeId, String path, String state, Long storageId,
137137

138138
void updateDisplay(Volume volume, Boolean displayVolume);
139139

140-
Snapshot allocSnapshotForVm(Long vmId, Long volumeId, String snapshotName) throws ResourceAllocationException;
140+
Snapshot allocSnapshotForVm(Long vmId, Long volumeId, String snapshotName, Long vmSnapshotId) throws ResourceAllocationException;
141141

142142
/**
143143
* Checks if the storage pool supports the disk offering tags.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity
3131
enum State {
3232
Allocated("The VM snapshot is allocated but has not been created yet."), Creating("The VM snapshot is being created."), Ready(
3333
"The VM snapshot is ready to be used."), Reverting("The VM snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
34-
"The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered");
34+
"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.");
3536

3637
String _description;
3738

@@ -60,6 +61,8 @@ public String getDescription() {
6061
s_fsm.addTransition(Expunging, Event.ExpungeRequested, Expunging);
6162
s_fsm.addTransition(Expunging, Event.OperationSucceeded, Removed);
6263
s_fsm.addTransition(Expunging, Event.OperationFailed, Error);
64+
s_fsm.addTransition(Expunging, Event.Hide, Hidden);
65+
s_fsm.addTransition(Hidden, Event.ExpungeRequested, Expunging);
6366
}
6467
}
6568

@@ -68,7 +71,7 @@ enum Type {
6871
}
6972

7073
enum Event {
71-
CreateRequested, OperationFailed, OperationSucceeded, RevertRequested, ExpungeRequested,
74+
CreateRequested, OperationFailed, OperationSucceeded, RevertRequested, ExpungeRequested, Hide,
7275
}
7376

7477
@Override

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ public class ApiConstants {
9090
public static final String CONVERT_INSTANCE_HOST_ID = "convertinstancehostid";
9191
public static final String CONVERT_INSTANCE_STORAGE_POOL_ID = "convertinstancepoolid";
9292
public static final String ENABLED_REVOCATION_CHECK = "enabledrevocationcheck";
93+
public static final String COMBINED_CAPACITY_ORDERING = "COMBINED";
9394
public static final String CONTROLLER = "controller";
9495
public static final String CONTROLLER_UNIT = "controllerunit";
9596
public static final String COPY_IMAGE_TAGS = "copyimagetags";
97+
public static final String CPU_OVERCOMMIT_RATIO = "cpuOvercommitRatio";
9698
public static final String CSR = "csr";
9799
public static final String PRIVATE_KEY = "privatekey";
98100
public static final String DATASTORE_HOST = "datastorehost";
@@ -124,6 +126,7 @@ public class ApiConstants {
124126
public static final String CNI_CONFIG_DETAILS = "cniconfigdetails";
125127
public static final String CNI_CONFIG_NAME = "cniconfigname";
126128
public static final String COMPONENT = "component";
129+
public static final String CPU = "CPU";
127130
public static final String CPU_CORE_PER_SOCKET = "cpucorepersocket";
128131
public static final String CPU_NUMBER = "cpunumber";
129132
public static final String CPU_SPEED = "cpuspeed";
@@ -220,6 +223,7 @@ public class ApiConstants {
220223
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
221224
public static final String FORCE_DELETE_HOST = "forcedeletehost";
222225
public static final String FORCE_MS_TO_IMPORT_VM_FILES = "forcemstoimportvmfiles";
226+
public static final String FORCE_UPDATE_OS_TYPE = "forceupdateostype";
223227
public static final String FORMAT = "format";
224228
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
225229
public static final String FOR_SYSTEM_VMS = "forsystemvms";
@@ -344,6 +348,7 @@ public class ApiConstants {
344348
public static final String MAX_BACKUPS = "maxbackups";
345349
public static final String MAX_CPU_NUMBER = "maxcpunumber";
346350
public static final String MAX_MEMORY = "maxmemory";
351+
public static final String MEMORY_OVERCOMMIT_RATIO = "memoryOvercommitRatio";
347352
public static final String MIN_CPU_NUMBER = "mincpunumber";
348353
public static final String MIN_MEMORY = "minmemory";
349354
public static final String MIGRATION_TYPE = "migrationtype";
@@ -441,6 +446,7 @@ public class ApiConstants {
441446
public static final String PUBLIC_END_PORT = "publicendport";
442447
public static final String PUBLIC_ZONE = "publiczone";
443448
public static final String PURGE_RESOURCES = "purgeresources";
449+
public static final String RAM = "RAM";
444450
public static final String REBALANCE = "rebalance";
445451
public static final String RECEIVED_BYTES = "receivedbytes";
446452
public static final String RECONNECT = "reconnect";

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
5151
description = "the ID of the OS type that best represents the OS of this image.")
5252
private Long osTypeId;
5353

54+
@Parameter(name = ApiConstants.FORCE_UPDATE_OS_TYPE, type = CommandType.BOOLEAN, since = "4.21", description = "Force OS type update. Warning: Updating OS type will " +
55+
"update the guest OS configuration for all the existing Instances deployed with this template/iso, which may affect their behavior.")
56+
private Boolean forceUpdateOsType;
57+
5458
@Parameter(name = ApiConstants.FORMAT, type = CommandType.STRING, description = "the format for the image")
5559
private String format;
5660

@@ -112,6 +116,10 @@ public Long getOsTypeId() {
112116
return osTypeId;
113117
}
114118

119+
public Boolean getForceUpdateOsType() {
120+
return forceUpdateOsType;
121+
}
122+
115123
public Boolean getPasswordEnabled() {
116124
return passwordEnabled;
117125
}

api/src/main/java/org/apache/cloudstack/api/command/user/backup/DeleteBackupScheduleCmd.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
description = "Deletes the backup schedule of a VM",
4444
responseObject = SuccessResponse.class, since = "4.14.0",
4545
authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
46-
public class DeleteBackupScheduleCmd extends BaseCmd {
46+
public class DeleteBackupScheduleCmd extends BaseCmd {
4747

4848
@Inject
4949
private BackupManager backupManager;
@@ -52,17 +52,13 @@ public class DeleteBackupScheduleCmd extends BaseCmd {
5252
//////////////// API parameters /////////////////////
5353
/////////////////////////////////////////////////////
5454

55-
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
56-
type = CommandType.UUID,
57-
entityType = UserVmResponse.class,
58-
description = "ID of the VM")
55+
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class,
56+
description = "ID of the VM from which all backup schedules will be deleted.")
5957
private Long vmId;
6058

61-
@Parameter(name = ApiConstants.ID,
62-
type = CommandType.UUID,
63-
entityType = BackupScheduleResponse.class,
64-
description = "ID of the schedule",
65-
since = "4.20.1")
59+
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = BackupScheduleResponse.class,
60+
since = "4.20.1", description = "ID of the backup schedule to be deleted. It has precedence over the 'virtualmachineid' parameter, " +
61+
"i.e., when the 'id' parameter is specified, the 'virtualmachineid' parameter will be ignored.")
6662
private Long id;
6763

6864
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public ApiCommandResourceType getApiResourceType() {
153153

154154
@Override
155155
public void create() throws ResourceAllocationException {
156-
Snapshot snapshot = this._volumeService.allocSnapshotForVm(getVmId(), getVolumeId(), getSnapshotName());
156+
Snapshot snapshot = this._volumeService.allocSnapshotForVm(getVmId(), getVolumeId(), getSnapshotName(), getVMSnapshotId());
157157
if (snapshot != null) {
158158
this.setEntityId(snapshot.getId());
159159
this.setEntityUuid(snapshot.getUuid());

0 commit comments

Comments
 (0)