Skip to content

Commit 1fec98a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into instance
2 parents fef53cf + 666784f commit 1fec98a

File tree

23 files changed

+240
-55
lines changed

23 files changed

+240
-55
lines changed

.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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public class ApiConstants {
227227
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
228228
public static final String FORCE_DELETE_HOST = "forcedeletehost";
229229
public static final String FORCE_MS_TO_IMPORT_VM_FILES = "forcemstoimportvmfiles";
230+
public static final String FORCE_UPDATE_OS_TYPE = "forceupdateostype";
230231
public static final String FORMAT = "format";
231232
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
232233
public static final String FOR_SYSTEM_VMS = "forsystemvms";

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/response/BackupScheduleResponse.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929
@EntityReference(value = BackupSchedule.class)
3030
public class BackupScheduleResponse extends BaseResponse {
31+
@SerializedName(ApiConstants.ID)
32+
@Param(description = "ID of the backup schedule.")
33+
private String id;
3134

3235
@SerializedName(ApiConstants.VIRTUAL_MACHINE_NAME)
3336
@Param(description = "name of the VM")
@@ -51,7 +54,11 @@ public class BackupScheduleResponse extends BaseResponse {
5154

5255
@SerializedName(ApiConstants.MAX_BACKUPS)
5356
@Param(description = "maximum number of backups retained")
54-
private Integer maxBakups;
57+
private Integer maxBackups;
58+
59+
public void setId(String id) {
60+
this.id = id;
61+
}
5562

5663
@SerializedName(ApiConstants.QUIESCE_VM)
5764
@Param(description = "quiesce the instance before checkpointing the disks for backup")
@@ -97,8 +104,8 @@ public void setTimezone(String timezone) {
97104
this.timezone = timezone;
98105
}
99106

100-
public void setMaxBakups(Integer maxBakups) {
101-
this.maxBakups = maxBakups;
107+
public void setMaxBackups(Integer maxBackups) {
108+
this.maxBackups = maxBackups;
102109
}
103110

104111
public void setQuiesceVM(Boolean quiesceVM) {

api/src/main/java/org/apache/cloudstack/backup/BackupSchedule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ public interface BackupSchedule extends InternalIdentity {
3232
Long getAsyncJobId();
3333
Integer getMaxBackups();
3434
Boolean getQuiesceVM();
35+
String getUuid();
3536
}

client/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,6 @@
321321
<artifactId>cloud-plugin-hypervisor-ucs</artifactId>
322322
<version>${project.version}</version>
323323
</dependency>
324-
<dependency>
325-
<groupId>org.apache.cloudstack</groupId>
326-
<artifactId>cloud-plugin-hypervisor-ovm</artifactId>
327-
<version>${project.version}</version>
328-
</dependency>
329-
<dependency>
330-
<groupId>org.apache.cloudstack</groupId>
331-
<artifactId>cloud-plugin-hypervisor-ovm3</artifactId>
332-
<version>${project.version}</version>
333-
</dependency>
334324
<dependency>
335325
<groupId>org.apache.cloudstack</groupId>
336326
<artifactId>cloud-plugin-hypervisor-kvm</artifactId>

engine/schema/src/main/java/org/apache/cloudstack/backup/BackupScheduleVO.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.cloudstack.backup;
1919

2020
import java.util.Date;
21+
import java.util.UUID;
2122

2223
import javax.persistence.Column;
2324
import javax.persistence.Entity;
@@ -39,6 +40,9 @@ public class BackupScheduleVO implements BackupSchedule {
3940
@Column(name = "id")
4041
private long id;
4142

43+
@Column(name = "uuid", nullable = false)
44+
private String uuid = UUID.randomUUID().toString();
45+
4246
@Column(name = "vm_id")
4347
private Long vmId;
4448

@@ -88,6 +92,11 @@ public long getId() {
8892
return id;
8993
}
9094

95+
@Override
96+
public String getUuid() {
97+
return uuid;
98+
}
99+
91100
public Long getVmId() {
92101
return vmId;
93102
}

engine/schema/src/main/java/org/apache/cloudstack/backup/dao/BackupScheduleDaoImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ public List<BackupScheduleVO> getSchedulesToExecute(Date currentTimestamp) {
9292
public BackupScheduleResponse newBackupScheduleResponse(BackupSchedule schedule) {
9393
VMInstanceVO vm = vmInstanceDao.findByIdIncludingRemoved(schedule.getVmId());
9494
BackupScheduleResponse response = new BackupScheduleResponse();
95+
response.setId(schedule.getUuid());
9596
response.setVmId(vm.getUuid());
9697
response.setVmName(vm.getHostName());
9798
response.setIntervalType(schedule.getScheduleType());
9899
response.setSchedule(schedule.getSchedule());
99100
response.setTimezone(schedule.getTimezone());
100-
response.setMaxBakups(schedule.getMaxBackups());
101+
response.setMaxBackups(schedule.getMaxBackups());
101102
if (schedule.getQuiesceVM() != null) {
102103
response.setQuiesceVM(schedule.getQuiesceVM());
103104
}

engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ CREATE TABLE IF NOT EXISTS `cloud`.`gui_themes_details` (
230230
CONSTRAINT `fk_gui_themes_details__gui_theme_id` FOREIGN KEY (`gui_theme_id`) REFERENCES `gui_themes`(`id`)
231231
);
232232

233+
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_schedule', 'uuid', 'VARCHAR(40) NOT NULL');
234+
UPDATE `cloud`.`backup_schedule` SET uuid = UUID();
235+
233236
-- Add column max_backup to backup_schedule table
234237
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_schedule', 'max_backups', 'int(8) default NULL COMMENT "maximum number of backups to maintain"');
235238
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_schedule', 'quiescevm', 'tinyint(1) default NULL COMMENT "Quiesce VM before taking backup"');

0 commit comments

Comments
 (0)