Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e6fe72d
Merge pull request #385 from ablecloud-team/ablestack-diplo
Dajeong-Park Dec 8, 2025
40fd2fe
Merge pull request #391 from ablecloud-team/ablestack-diplo
Dajeong-Park Dec 15, 2025
2631293
Merge pull request #394 from ablecloud-team/ablestack-diplo
Dajeong-Park Dec 30, 2025
bea4187
Merge branch 'ablecloud-team:ablestack-diplo' into ablestack-diplo
Dajeong-Park Jan 7, 2026
646e898
Merge branch 'ablecloud-team:ablestack-diplo' into ablestack-diplo
Dajeong-Park Jan 8, 2026
75c6799
다크모드 수정
jschoiRR Jan 9, 2026
7008261
Merge branch 'ablecloud-team:ablestack-diplo' into mold-main#2025
jschoiRR Jan 12, 2026
b42e704
Merge branch 'ablecloud-team:ablestack-diplo' into ablestack-diplo
Dajeong-Park Jan 12, 2026
c38e580
가상머신 목록의 디스플레이명(표시 이름) 항목 추가
jschoiRR Jan 13, 2026
bf3e740
Merge branch 'ablecloud-team:ablestack-diplo' into mold-main#2025
jschoiRR Jan 16, 2026
34e8fce
빌드 오류 수정
jschoiRR Jan 16, 2026
12808ee
빌드오류 수정
jschoiRR Jan 16, 2026
eecff05
Merge branch 'ablecloud-team:ablestack-diplo' into ablestack-diplo
Dajeong-Park Jan 16, 2026
59e51c9
Merge branch 'ablecloud-team:ablestack-diplo' into mold-main#2025
jschoiRR Jan 16, 2026
7e24748
Merge branch 'ablecloud-team:ablestack-diplo' into ablestack-diplo
Dajeong-Park Jan 16, 2026
c585cad
빌드오류 적용
Dajeong-Park Jan 16, 2026
3762f54
Update BackupVO.java
Dajeong-Park Jan 16, 2026
979c859
빌드오류 수정
Dajeong-Park Jan 16, 2026
c51ebf2
빌드 오류 수정
jschoiRR Jan 16, 2026
b3c7a43
빌드 오류 수정
jschoiRR Jan 16, 2026
6470b65
빌드오류 수정
jschoiRR Jan 16, 2026
75b6f7b
빌드 오류 수정
jschoiRR Jan 16, 2026
9d7c9b2
빌드 오류 수정
jschoiRR Jan 16, 2026
674f697
빌드 오류 수정
jschoiRR Jan 16, 2026
8fcc034
Update BackupSchedule.java
Dajeong-Park Jan 19, 2026
78dd41e
Update BackupManagerImpl.java
Dajeong-Park Jan 19, 2026
7a02284
Update VolumeApiServiceImpl.java
Dajeong-Park Jan 19, 2026
46349c2
Update BackupManagerTest.java
Dajeong-Park Jan 19, 2026
c90bc9f
Update BackupManagerTest.java
Dajeong-Park Jan 19, 2026
4b86daa
Update BackupManagerTest.java
Dajeong-Park Jan 19, 2026
ad2cbc7
Update BackupManagerTest.java
Dajeong-Park Jan 19, 2026
1642b48
Revert "Update BackupManagerTest.java"
Dajeong-Park Jan 19, 2026
62e972b
Revert "Update BackupManagerTest.java"
Dajeong-Park Jan 19, 2026
b27cb6d
Revert "Update BackupManagerTest.java"
Dajeong-Park Jan 19, 2026
0bcc18d
Revert "Update BackupManagerTest.java"
Dajeong-Park Jan 19, 2026
062556d
Revert "Update VolumeApiServiceImpl.java"
Dajeong-Park Jan 19, 2026
6ce7bab
Revert "Update BackupManagerImpl.java"
Dajeong-Park Jan 19, 2026
0dfcffb
Revert "Update BackupSchedule.java"
Dajeong-Park Jan 19, 2026
4f50052
Revert "빌드오류 수정"
Dajeong-Park Jan 19, 2026
393fc53
Revert "Update BackupVO.java"
Dajeong-Park Jan 19, 2026
0ad6131
Revert "빌드오류 적용"
Dajeong-Park Jan 19, 2026
e74aac6
Merge pull request #397 from jschoiRR/mold-main#2025
Dajeong-Park Jan 19, 2026
a0d7e43
Fix deletion of backup schedules (#11222)
Dajeong-Park Jan 19, 2026
626ca83
commvault 백업 동기화 설정을 위한 코드 추가
Dajeong-Park Jan 19, 2026
e61f778
테스트 로그 추가
Dajeong-Park Jan 20, 2026
105fec0
풀 스토리지 경로 오류 및 호스트VO 널 처리
Dajeong-Park Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public class EventTypes {

// DISASTER RECOVERY
public static final String EVENT_DISASTER_RECOVERY_CLUSTER = "DISASTER.RECOVERY.CLUSTER";

// Resource Limit
public static final String EVENT_RESOURCE_LIMIT_UPDATE = "RESOURCE.LIMIT.UPDATE";

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/storage/VolumeApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,6 @@ Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account acc
Volume cloneVolumeFromSnapshot(Volume volume, long snapshotId, Long vmId) throws StorageUnavailableException;

Volume updateCompressDedupVolume(UpdateCompressDedupCmd cmd);

Long getVolumePhysicalSize(Storage.ImageFormat format, String path, String chainInfo);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.BackupScheduleResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.backup.BackupManager;
Expand All @@ -51,13 +52,15 @@ public class DeleteBackupScheduleCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////

@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
type = CommandType.UUID,
entityType = UserVmResponse.class,
required = true,
description = "ID of the VM")
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class,
description = "ID of the VM from which all backup schedules will be deleted.")
private Long vmId;

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

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand All @@ -66,14 +69,17 @@ public Long getVmId() {
return vmId;
}

public Long getId() { return id; }


/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
try {
boolean result = backupManager.deleteBackupSchedule(getVmId());
boolean result = backupManager.deleteBackupSchedule(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
response.setResponseName(getCommandName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

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

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

@SerializedName(ApiConstants.MAX_BACKUPS)
@Param(description = "maximum number of backups retained")
private Integer maxBakups;
private Integer maxBackups;

public void setId(String id) {
this.id = id;
}

public String getVmName() {
return vmName;
Expand Down Expand Up @@ -93,7 +100,7 @@ public void setTimezone(String timezone) {
this.timezone = timezone;
}

public void setMaxBakups(Integer maxBakups) {
this.maxBakups = maxBakups;
public void setMaxBackups(Integer maxBackups) {
this.maxBackups = maxBackups;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.cloudstack.api.command.admin.backup.ImportBackupOfferingCmd;
import org.apache.cloudstack.api.command.admin.backup.UpdateBackupOfferingCmd;
import org.apache.cloudstack.api.command.user.backup.CreateBackupScheduleCmd;
import org.apache.cloudstack.api.command.user.backup.DeleteBackupScheduleCmd;
import org.apache.cloudstack.api.command.user.backup.ListBackupOfferingsCmd;
import org.apache.cloudstack.api.command.user.backup.ListBackupsCmd;
import org.apache.cloudstack.framework.config.ConfigKey;
Expand Down Expand Up @@ -159,12 +160,12 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
*/
List<BackupSchedule> listBackupSchedule(Long vmId);

/**
/**
* Deletes VM backup schedule for a VM
* @param vmId
* @param cmd
* @return
*/
boolean deleteBackupSchedule(Long vmId);
boolean deleteBackupSchedule(DeleteBackupScheduleCmd cmd);

/**
* Creates backup of a VM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.cloudstack.backup;

import java.util.Date;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
Expand All @@ -42,6 +43,9 @@ public class BackupScheduleVO implements BackupSchedule {
@Column(name = "vm_id")
private Long vmId;

@Column(name = "uuid", nullable = false)
private String uuid = UUID.randomUUID().toString();

@Column(name = "schedule_type")
private Short scheduleType;

Expand Down Expand Up @@ -84,6 +88,11 @@ public long getId() {
return id;
}

@Override
public String getUuid() {
return uuid;
}

public Long getVmId() {
return vmId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
import org.apache.commons.lang3.StringUtils;

import java.beans.Transient;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.persistence.Column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ public List<BackupScheduleVO> getSchedulesToExecute(Date currentTimestamp) {
public BackupScheduleResponse newBackupScheduleResponse(BackupSchedule schedule) {
VMInstanceVO vm = vmInstanceDao.findByIdIncludingRemoved(schedule.getVmId());
BackupScheduleResponse response = new BackupScheduleResponse();
response.setId(schedule.getUuid());
response.setVmId(vm.getUuid());
response.setVmName(vm.getHostName());
response.setIntervalType(schedule.getScheduleType());
response.setSchedule(schedule.getSchedule());
response.setTimezone(schedule.getTimezone());
response.setMaxBakups(schedule.getMaxBackups());
response.setMaxBackups(schedule.getMaxBackups());
response.setObjectName("backupschedule");
return response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.console_session', 'console_endpoint_

-- Add client_address column to cloud.console_session table
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.console_session', 'client_address', 'VARCHAR(45)');

CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_schedule', 'uuid', 'VARCHAR(40) NOT NULL');
UPDATE `cloud`.`backup_schedule` SET uuid = UUID();
Original file line number Diff line number Diff line change
Expand Up @@ -2445,4 +2445,12 @@ private Optional<AttributeConverter<Object, Object>> getConverter(Field field) {
}
}

public static class SumCount {
public long sum;
public long count;

public SumCount() {
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, String volumeU
}

@Override
public boolean takeBackup(VirtualMachine vm) {
public Pair<Boolean, Backup> takeBackup(VirtualMachine vm) {
String hostName = null;
try {
String commvaultServer = getUrlDomain(CommvaultUrl.value());
Expand Down Expand Up @@ -821,7 +821,7 @@ public boolean takeBackup(VirtualMachine vm) {
}
}
LOG.error("Failed to request createSnapshot Mold-API.");
return false;
return new Pair<>(false, null);
} else {
JSONObject jsonObject = new JSONObject(createSnapResult);
String jobId = jsonObject.get("jobid").toString();
Expand All @@ -843,7 +843,7 @@ public boolean takeBackup(VirtualMachine vm) {
}
}
LOG.error("createSnapshot Mold-API async job resulted in failure.");
return false;
return new Pair<>(false, null);
}
checkResult.put(vol.getId(), snapId);
SnapshotDataStoreVO snapshotStore = snapshotStoreDao.findLatestSnapshotForVolume(vol.getId(), DataStoreRole.Primary);
Expand Down Expand Up @@ -1001,7 +1001,7 @@ public boolean takeBackup(VirtualMachine vm) {
command = String.format(RM_COMMAND, storagePath + "/" + vm.getInstanceName());
executeDeleteXmlCommand(hostVO, credentials.first(), credentials.second(), sshPort, command);
}
return true;
return new Pair<>(true, backup);
} else {
// 백업 실패
if (!checkResult.isEmpty()) {
Expand All @@ -1018,7 +1018,7 @@ public boolean takeBackup(VirtualMachine vm) {
executeDeleteXmlCommand(hostVO, credentials.first(), credentials.second(), sshPort, command);
}
LOG.error("createBackup commvault api resulted in " + jobStatus);
return false;
return new Pair<>(false, null);
}
} else {
// 백업 실패
Expand All @@ -1036,7 +1036,7 @@ public boolean takeBackup(VirtualMachine vm) {
executeDeleteXmlCommand(hostVO, credentials.first(), credentials.second(), sshPort, command);
}
LOG.error("createBackup commvault api resulted in " + jobStatus);
return false;
return new Pair<>(false, null);
}
} else {
// 백업 실패
Expand All @@ -1054,7 +1054,7 @@ public boolean takeBackup(VirtualMachine vm) {
executeDeleteXmlCommand(hostVO, credentials.first(), credentials.second(), sshPort, command);
}
LOG.error("failed request createBackup commvault api");
return false;
return new Pair<>(false, null);
}
} else {
// 백업 경로 업데이트 실패
Expand All @@ -1072,7 +1072,7 @@ public boolean takeBackup(VirtualMachine vm) {
executeDeleteXmlCommand(hostVO, credentials.first(), credentials.second(), sshPort, command);
}
LOG.error("updateBackupSet commvault api resulted in failure.");
return false;
return new Pair<>(false, null);
}
}

Expand Down Expand Up @@ -1559,4 +1559,16 @@ public static boolean versionCheck(String csVersionInfo) {
}
return true;
}

@Override
public List<Backup.RestorePoint> listRestorePoints(VirtualMachine vm) {
return null;
}


@Override
public Backup createNewBackupEntryForRestorePoint(Backup.RestorePoint restorePoint, VirtualMachine vm, Backup.Metric metric) {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
import com.cloud.hypervisor.Hypervisor;
import com.cloud.storage.ScopeType;
import com.cloud.storage.Storage;
import com.cloud.storage.StoragePoolHostVO;
import com.cloud.storage.Volume;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.StoragePoolHostDao;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.utils.Pair;
import com.cloud.utils.component.AdapterBase;
Expand Down Expand Up @@ -84,9 +82,6 @@ public class NASBackupProvider extends AdapterBase implements BackupProvider, Co
@Inject
private VolumeDao volumeDao;

@Inject
private StoragePoolHostDao storagePoolHostDao;

@Inject
private VMInstanceDao vmInstanceDao;

Expand Down Expand Up @@ -268,12 +263,28 @@ private List<String> getVolumePaths(List<VolumeVO> volumes) {
return volumePaths;
}

private String getVolumePathPrefix(StoragePoolVO storagePool) {
String volumePathPrefix;
if (ScopeType.HOST.equals(storagePool.getScope()) ||
Storage.StoragePoolType.SharedMountPoint.equals(storagePool.getPoolType()) ||
Storage.StoragePoolType.RBD.equals(storagePool.getPoolType())) {
volumePathPrefix = storagePool.getPath();
} else {
// Should be Storage.StoragePoolType.NetworkFilesystem
volumePathPrefix = String.format("/mnt/%s", storagePool.getUuid());
}
return volumePathPrefix;
}

@Override
public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, String volumeUuid, String hostIp, String dataStoreUuid, Pair<String, VirtualMachine.State> vmNameAndState) {
final VolumeVO volume = volumeDao.findByUuid(volumeUuid);
final VirtualMachine backupSourceVm = vmInstanceDao.findById(backup.getVmId());
final StoragePoolHostVO dataStore = storagePoolHostDao.findByUuid(dataStoreUuid);
final HostVO hostVO = hostDao.findByIp(hostIp);
final StoragePoolVO pool = primaryDataStoreDao.findByUuid(dataStoreUuid);
HostVO hostVO = hostDao.findByIp(hostIp);
if(hostVO == null) {
hostVO = hostDao.findByName(hostIp);
}

Optional<Backup.VolumeInfo> matchingVolume = getBackedUpVolumeInfo(backupSourceVm.getBackupVolumeList(), volumeUuid);
Long backedUpVolumeSize = matchingVolume.isPresent() ? matchingVolume.get().getSize() : 0L;
Expand All @@ -291,7 +302,7 @@ public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, String volumeU
restoredVolume.setUuid(volumeUUID);
restoredVolume.setRemoved(null);
restoredVolume.setDisplayVolume(true);
restoredVolume.setPoolId(dataStore.getPoolId());
restoredVolume.setPoolId(pool.getId());
restoredVolume.setPath(restoredVolume.getUuid());
restoredVolume.setState(Volume.State.Copying);
restoredVolume.setFormat(Storage.ImageFormat.QCOW2);
Expand All @@ -303,7 +314,7 @@ public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, String volumeU
restoreCommand.setBackupRepoType(backupRepository.getType());
restoreCommand.setBackupRepoAddress(backupRepository.getAddress());
restoreCommand.setVmName(vmNameAndState.first());
restoreCommand.setVolumePaths(Collections.singletonList(String.format("%s/%s", dataStore.getLocalPath(), volumeUUID)));
restoreCommand.setVolumePaths(Collections.singletonList(String.format("%s/%s", getVolumePathPrefix(pool), volumeUUID)));
restoreCommand.setDiskType(volume.getVolumeType().name().toLowerCase(Locale.ROOT));
restoreCommand.setVmExists(null);
restoreCommand.setVmState(vmNameAndState.second());
Expand Down Expand Up @@ -461,6 +472,10 @@ public String getConfigComponentName() {
return BackupService.class.getSimpleName();
}

@Override
public void syncBackups(VirtualMachine vm, Backup.Metric metric) {
}

@Override
public boolean checkBackupAgent(final Long zoneId) { return true; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.dao.VMInstanceDao;

import org.apache.cloudstack.backup.dao.BackupDao;
import org.apache.cloudstack.backup.dao.BackupOfferingDaoImpl;
import org.apache.cloudstack.backup.networker.NetworkerClient;
Expand Down Expand Up @@ -624,4 +625,8 @@ public List<Backup.RestorePoint> listRestorePoints(VirtualMachine vm) {

@Override
public boolean updateBackupPlan(final Long zoneId, final String retentionPeriod, final String externalId) { return true; }

@Override
public void syncBackups(VirtualMachine vm, Backup.Metric metric) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ public String getDescription() {
return "Veeam Backup Plugin";
}

@Override
public void syncBackups(VirtualMachine vm, Backup.Metric metric) {
}

@Override
public boolean checkBackupAgent(final Long zoneId) { return true; }

Expand Down
Loading
Loading