Skip to content

Commit 152a883

Browse files
authored
Merge branch 'main' into integrate-gpu
2 parents bdc5afc + 666784f commit 152a883

File tree

22 files changed

+240
-53
lines changed

22 files changed

+240
-53
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
@@ -225,6 +225,7 @@ public class ApiConstants {
225225
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
226226
public static final String FORCE_DELETE_HOST = "forcedeletehost";
227227
public static final String FORCE_MS_TO_IMPORT_VM_FILES = "forcemstoimportvmfiles";
228+
public static final String FORCE_UPDATE_OS_TYPE = "forceupdateostype";
228229
public static final String FORMAT = "format";
229230
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
230231
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
public String getVmName() {
5764
return vmName;
@@ -93,7 +100,7 @@ public void setTimezone(String timezone) {
93100
this.timezone = timezone;
94101
}
95102

96-
public void setMaxBakups(Integer maxBakups) {
97-
this.maxBakups = maxBakups;
103+
public void setMaxBackups(Integer maxBackups) {
104+
this.maxBackups = maxBackups;
98105
}
99106
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ public interface BackupSchedule extends InternalIdentity {
3131
Date getScheduledTimestamp();
3232
Long getAsyncJobId();
3333
Integer getMaxBackups();
34+
String getUuid();
3435
}

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

@@ -84,6 +88,11 @@ public long getId() {
8488
return id;
8589
}
8690

91+
@Override
92+
public String getUuid() {
93+
return uuid;
94+
}
95+
8796
public Long getVmId() {
8897
return vmId;
8998
}

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
response.setObjectName("backupschedule");
102103
return response;
103104
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,7 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.service_offering', 'gpu_count', 'int
295295
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.service_offering', 'gpu_display', 'boolean DEFAULT false COMMENT "enable GPU display"');
296296
CALL `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY`('cloud.service_offering','fk_service_offering__vgpu_profile_id');
297297
CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.service_offering', 'fk_service_offering__vgpu_profile_id', '(vgpu_profile_id)', '`vgpu_profile`(`id`)');
298+
299+
-- Add uuid column for backup schedule
300+
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_schedule', 'uuid', 'VARCHAR(40) NOT NULL');
301+
UPDATE `cloud`.`backup_schedule` SET uuid = UUID();

0 commit comments

Comments
 (0)