Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
3b6b638
테스트
Dajeong-Park Feb 25, 2026
461fb9a
Update UserVmManagerImpl.java
Dajeong-Park Feb 25, 2026
c54d0e7
Update UserVmManagerImpl.java
Dajeong-Park Feb 25, 2026
0ca1041
Update UserVmManagerImpl.java
Dajeong-Park Feb 25, 2026
fed3ef1
Update UserVmManagerImpl.java
Dajeong-Park Feb 25, 2026
05f3c29
Update UserVmManagerImpl.java
Dajeong-Park Feb 25, 2026
1d6855e
Update UserVmManagerImpl.java
Dajeong-Park Feb 25, 2026
f8acd03
Update KVMStorageProcessor.java
Dajeong-Park Feb 25, 2026
fa9300b
Update KVMStorageProcessor.java
Dajeong-Park Feb 26, 2026
4143ebe
test
Dajeong-Park Feb 26, 2026
5241405
Update CloneVM.vue
Dajeong-Park Feb 26, 2026
e162798
Update UserVmManagerImpl.java
Dajeong-Park Feb 26, 2026
b7456ab
Update UserVmManagerImpl.java
Dajeong-Park Feb 26, 2026
4e1edd7
Merge branch 'ablecloud-team:ablestack-europa' into ablestack-europa
Dajeong-Park Mar 16, 2026
2617414
Merge branch 'ablecloud-team:ablestack-europa' into ablestack-europa
Dajeong-Park Apr 1, 2026
e1d2e15
백업 스케줄 구성시 가상머신 선택에 따른 설정 초기화 오류 수정
Dajeong-Park Apr 1, 2026
046f65a
1차 커밋
Dajeong-Park Apr 1, 2026
296ee63
Update FormSchedule.vue
Dajeong-Park Apr 2, 2026
e249dfe
vm_id 컬럼 추가
Dajeong-Park Apr 2, 2026
0982a5a
nasbackup.sh 파일 수정
Dajeong-Park Apr 2, 2026
6dff426
Update BackupManager.java
Dajeong-Park Apr 2, 2026
4b445f0
Update nasbackup.sh
Dajeong-Park Apr 2, 2026
f35c1f6
Update nasbackup.sh
Dajeong-Park Apr 2, 2026
a05c3c0
Update nasbackup.sh
Dajeong-Park Apr 2, 2026
0908acd
rbd의 경우에도 도메인 정보 백업
Dajeong-Park Apr 2, 2026
95e51b8
Update nasbackup.sh
Dajeong-Park Apr 2, 2026
670541e
추가 적용
Dajeong-Park Apr 2, 2026
4ae4535
크로스존 활성화된 경우 고려
Dajeong-Park Apr 2, 2026
085b62a
백업 체인 길이 설정 및 VM스냅샷 관련 예외처리 추가
Dajeong-Park Apr 2, 2026
6bda058
Update CommvaultBackupProvider.java
Dajeong-Park Apr 2, 2026
4075b5f
RBD타입인 경우 파일명 변경
Dajeong-Park Apr 3, 2026
0718ba7
Update NASBackupProvider.java
Dajeong-Park Apr 3, 2026
b32d609
Update LibvirtRestoreBackupCommandWrapper.java
Dajeong-Park Apr 3, 2026
88f6d64
타임아웃 추가
Dajeong-Park Apr 3, 2026
41053d7
raw타입이면 Import하도록 명령어 변경
Dajeong-Park Apr 3, 2026
04568fd
재복원시 오류 수정
Dajeong-Park Apr 3, 2026
17359f6
볼륨 복원 및 연결시 오류 수정
Dajeong-Park Apr 3, 2026
f51db15
Update NASBackupProvider.java
Dajeong-Park Apr 3, 2026
22b3e90
Update NASBackupProvider.java
Dajeong-Park Apr 3, 2026
b7f9614
Update LibvirtRestoreBackupCommandWrapper.java
Dajeong-Park Apr 3, 2026
23ad6cf
UI 빌드오류 및 백업에서 새 인스턴스 생성 시 네트워크 목록 선택오류 수정
Dajeong-Park Apr 3, 2026
c920790
백업에서 새 인스턴스 생성시 네트워크 목록 초기화 오류 수정
Dajeong-Park Apr 6, 2026
d6e3082
쉘 스크립트 -> java로 변경
Dajeong-Park Apr 6, 2026
d7bd12b
스크립트 수정
Dajeong-Park Apr 6, 2026
9872e86
재정리
Dajeong-Park Apr 6, 2026
dd39cc6
쉘 적용
Dajeong-Park Apr 6, 2026
dc9ef2b
로그수정
Dajeong-Park Apr 6, 2026
8755d24
재수정
Dajeong-Park Apr 6, 2026
3f5957d
재수정
Dajeong-Park Apr 6, 2026
ace4606
로그 추가
Dajeong-Park Apr 6, 2026
63a18a8
테스트 로그 추가
Dajeong-Park Apr 6, 2026
b5aa28a
테스트용
Dajeong-Park Apr 6, 2026
fb34740
테스트용
Dajeong-Park Apr 6, 2026
768d6e3
로그 수정
Dajeong-Park Apr 6, 2026
320e9c4
Update nasbackup.sh
Dajeong-Park Apr 6, 2026
a4b3726
Update nasbackup.sh
Dajeong-Park Apr 6, 2026
f44828d
Update nasbackup.sh
Dajeong-Park Apr 6, 2026
dc0e66a
rbd의 경우 meta형식으로 저장
Dajeong-Park Apr 7, 2026
f2e71a0
백업본을 복원하여 스냅샷이 없는 경우 강제 FULL 백업 실행하도록 변경
Dajeong-Park Apr 8, 2026
5f5b174
Update CommvaultBackupProvider.java
Dajeong-Park Apr 8, 2026
baa3bd0
백업삭제시 details 도 삭제되도록 변경
Dajeong-Park Apr 8, 2026
5d19daf
Incremental 백업 시도시 parent 없는 경우 FULL 백업 강제할때 실패한 백업 리스트 삭제하도록 변경
Dajeong-Park Apr 8, 2026
fc4c24f
Update CommvaultBackupProvider.java
Dajeong-Park Apr 8, 2026
a2f878d
중간체인 복원시 diff 못읽어오는 오류 수정
Dajeong-Park Apr 8, 2026
83992e4
복원시 스냅샷 재구성
Dajeong-Park Apr 8, 2026
3278df8
백업 모달에서 Commvault에도 백업 이름과 설명 표시되도록 변경
Dajeong-Park Apr 8, 2026
2aa9970
commvault 백업 삭제시 rbd인 경우 스냅샷 삭제 부분 추가, 백업 체인 있는 경우 삭제 예외처리 추가
Dajeong-Park Apr 9, 2026
b8c1ce0
체크포인트 네임 통일
Dajeong-Park Apr 9, 2026
290dc6b
commvault 복원 오류 수정
Dajeong-Park Apr 9, 2026
47654fb
Update CommvaultBackupProvider.java
Dajeong-Park Apr 9, 2026
b657a39
Update CommvaultBackupProvider.java
Dajeong-Park Apr 9, 2026
1555795
새 인스턴스 생성 시 네트워크 항목 오류 수정
Dajeong-Park Apr 9, 2026
40d16e3
복원 관련 코드 수정
Dajeong-Park Apr 9, 2026
7777bf0
syncBackups 오류수정
Dajeong-Park Apr 9, 2026
adc6550
증분 백업 미적용 오류로 콘텐츠 경로 수정
Dajeong-Park Apr 9, 2026
8acfcb3
중간 체인 복원시 오류 수정
Dajeong-Park Apr 10, 2026
5a6bbf0
증분체인 복원시 특정파일이 아닌 가상머신 전체 폴더 복원되도록 변경 테스트
Dajeong-Park Apr 10, 2026
482c8b4
체인이 다른 호스트에 흩어진 경우 모아서 복원 호출
Dajeong-Park Apr 10, 2026
c8cb8b9
복원시 파라미터 변경
Dajeong-Park Apr 10, 2026
84153ce
클래스 분리
Dajeong-Park Apr 10, 2026
cf7257d
Update AblestackCommvaultRestoreBackupCommand.java
Dajeong-Park Apr 10, 2026
cc82481
pom 변경
Dajeong-Park Apr 10, 2026
4467f5b
재적용
Dajeong-Park Apr 10, 2026
0ce28d2
재수정
Dajeong-Park Apr 10, 2026
c83796d
nas 의 경우 ablestack-nas 소스 타도록 변경
Dajeong-Park Apr 10, 2026
29dd89d
백업 유지갯수에 따라 증분 백업 체인 결정
Dajeong-Park Apr 10, 2026
9022925
Update AblestackNasRestoreBackupCommand.java
Dajeong-Park Apr 10, 2026
2ecf18b
중간체인 복원시 폴더별로 보내도록 변경 테스트
Dajeong-Park Apr 10, 2026
25e05c3
Update LibvirtAblestackNasBackupHelper.java
Dajeong-Park Apr 10, 2026
2ae6e71
빌드오류 수정
Dajeong-Park Apr 10, 2026
5c7ab1a
빌드오류 수정
Dajeong-Park Apr 10, 2026
0f86291
Update AblestackNasBackupProvider.java
Dajeong-Park Apr 10, 2026
3d2849c
빌드오류 수정
Dajeong-Park Apr 10, 2026
ae0103b
재수정
Dajeong-Park Apr 10, 2026
ea1f66c
오류 수정
Dajeong-Park Apr 10, 2026
d17d3da
Update pom.xml
Dajeong-Park Apr 13, 2026
bcfb13c
중간체인 복원시 실패 오류 수정
Dajeong-Park Apr 13, 2026
7b9b233
cloudstack 소스 고려하여 테스트 커밋
Dajeong-Park Apr 13, 2026
332a4b6
Update AblestackCommvaultBackupProvider.java
Dajeong-Park Apr 13, 2026
a8cf750
중간체인으로 복원시 오류 수정
Dajeong-Park Apr 14, 2026
84a38fb
commvault 복원시 오류로 로그추가
Dajeong-Park Apr 14, 2026
9ff29a8
commvault 복원시 체인 중복오류 수정
Dajeong-Park Apr 14, 2026
b1c804d
Update LibvirtAblestackNasRestoreBackupCommandWrapper.java
Dajeong-Park Apr 14, 2026
74d8f5f
복원 후 볼륨 연결 하도록 수정
Dajeong-Park Apr 14, 2026
916ce0c
Merge branch 'ablecloud-team:ablestack-europa' into ablestack-europa
Dajeong-Park Apr 14, 2026
c15f04c
Merge branch 'pr-413' into merge-pr-413
Dajeong-Park Apr 14, 2026
cd5a4b6
Update AblestackNasBackupProvider.java
Dajeong-Park Apr 14, 2026
603266b
Merge pull request #414 from ablecloud-team/ablestack-europa
Dajeong-Park Apr 14, 2026
c0819ee
Merge pull request #415 from Dajeong-Park/ablestack-europa
Dajeong-Park Apr 14, 2026
a3bdec4
복원 오류 수정
Dajeong-Park Apr 14, 2026
017f3ae
Merge branch 'incremental_backup' of https://github.com/Dajeong-Park/…
Dajeong-Park Apr 14, 2026
a001ac8
long타입 null처리
Dajeong-Park Apr 14, 2026
4604782
복원 오류 수정
Dajeong-Park Apr 15, 2026
19c22f0
Update AblestackCommvaultBackupProvider.java
Dajeong-Park Apr 15, 2026
ad502d0
복원 연결 테스트
Dajeong-Park Apr 15, 2026
935e3a7
commvault 복원 전 호스트 용량체크
Dajeong-Park Apr 15, 2026
bf6bb5b
Update AblestackCommvaultBackupProvider.java
Dajeong-Park Apr 15, 2026
1948e8a
Merge branch 'ablecloud-team:ablestack-europa' into ablestack-europa
Dajeong-Park Apr 16, 2026
387e859
Merge branch 'incremental_backup' into ablestack-europa
Dajeong-Park Apr 16, 2026
c1e8bcc
Merge pull request #417 from Dajeong-Park/ablestack-europa
Dajeong-Park Apr 16, 2026
362f1ad
ablestack-nas 추가로 백업 스토리지 용량 조회되지않는 부분 수정
Dajeong-Park Apr 16, 2026
ba8a44b
실행중인 가상머신의 경우 도메인 xml 저장
Dajeong-Park Apr 17, 2026
189da5e
rbd의 경우에도 xml저장하도록 변경
Dajeong-Park Apr 17, 2026
d8447d9
qcow2 증분백업 <->vm 스냅샷 예외처리 추가
Dajeong-Park Apr 17, 2026
783ade7
Revert "qcow2 증분백업 <->vm 스냅샷 예외처리 추가"
Dajeong-Park Apr 17, 2026
d683076
VM 스냅샷 차단 재적용
Dajeong-Park Apr 17, 2026
999ff0e
백업과 볼륨스냅샷, VM스냅샷 예외처리 추가
Dajeong-Park Apr 17, 2026
14b5247
스냅샷 생성시 예외처리 추가
Dajeong-Park Apr 17, 2026
9f30bfa
예외처리시 할당되지않도록
Dajeong-Park Apr 17, 2026
5931d00
호스트 상태에 따라 버튼 비활성화되도록 변경
Dajeong-Park Apr 17, 2026
c66404e
max 항목은 백업 레코드가 아닌 백업체인세트로 설정
Dajeong-Park Apr 17, 2026
92d5c8a
Update BackupManagerTest.java
Dajeong-Park Apr 17, 2026
982f300
백업 스케줄로 실행된 백업은 최초 FULL로 하도록 변경
Dajeong-Park Apr 17, 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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.backup.BackupManager;
import org.apache.cloudstack.backup.BackupProvider;
import org.apache.cloudstack.backup.BackupProviderNameUtils;

import com.cloud.user.Account;

Expand Down Expand Up @@ -70,11 +71,12 @@ private void setupResponse(final List<BackupProvider> providers) {
final ListResponse<BackupProviderResponse> response = new ListResponse<>();
final List<BackupProviderResponse> responses = new ArrayList<>();
for (final BackupProvider provider : providers) {
if (provider == null || (getName() != null && !provider.getName().equals(getName()))) {
final String displayName = provider == null ? null : BackupProviderNameUtils.toDisplayName(provider.getName());
if (provider == null || (getName() != null && !displayName.equalsIgnoreCase(getName()))) {
continue;
}
final BackupProviderResponse backupProviderResponse = new BackupProviderResponse();
backupProviderResponse.setName(provider.getName());
backupProviderResponse.setName(displayName);
backupProviderResponse.setDescription(provider.getDescription());
backupProviderResponse.setObjectName("providers");
responses.add(backupProviderResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.backup.BackupManager;
import org.apache.cloudstack.backup.BackupProvider;
import org.apache.cloudstack.backup.BackupProviderNameUtils;

import com.cloud.user.Account;

Expand Down Expand Up @@ -75,7 +76,7 @@ private void setupResponse(final List<BackupProvider> providers) {
continue;
}
final BackupProviderResponse backupProviderResponse = new BackupProviderResponse();
backupProviderResponse.setName(provider.getName());
backupProviderResponse.setName(BackupProviderNameUtils.toDisplayName(provider.getName()));
backupProviderResponse.setDescription(provider.getDescription());
backupProviderResponse.setObjectName("providers");
responses.add(backupProviderResponse);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.backup;

import com.cloud.vm.VirtualMachine;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

public final class AblestackBackupFrameworkUtils {

private AblestackBackupFrameworkUtils() {
}

public static int getEffectiveIncrementalLimit(final int defaultLimit, final List<Integer> scheduleMaxBackups) {
int effectiveLimit = defaultLimit;
if (scheduleMaxBackups == null) {
return effectiveLimit;
}
for (Integer maxBackups : scheduleMaxBackups) {
if (maxBackups != null && maxBackups > 0) {
effectiveLimit = Math.min(effectiveLimit, maxBackups);
}
}
return effectiveLimit;
}

public static <T extends Backup> int getBackupChainSize(final T latestBackup, final Map<String, ? extends T> backupsByUuid,
final Function<T, String> parentBackupUuidResolver) {
if (latestBackup == null) {
return 0;
}
int chainSize = 1;
T current = latestBackup;
while (current != null) {
final String parentBackupUuid = parentBackupUuidResolver.apply(current);
if (parentBackupUuid == null) {
break;
}
current = backupsByUuid.get(parentBackupUuid);
if (current != null) {
chainSize++;
}
}
return chainSize;
}

public static boolean requiresRunningVmAttach(final VirtualMachine.State vmState) {
return VirtualMachine.State.Running.equals(vmState);
}

public static boolean shouldExecuteRestoreOnSourceHost(final VirtualMachine.State vmState) {
return !requiresRunningVmAttach(vmState);
}

public static BackupRestorePlan createRestorePlan(final boolean attachRequired, final boolean cleanupRequired) {
final List<BackupRestoreStage> stages = new ArrayList<>();
stages.add(BackupRestoreStage.PREPARE_SOURCE);
stages.add(BackupRestoreStage.VALIDATE_CHAIN);
stages.add(BackupRestoreStage.RESTORE_DATA);
if (attachRequired) {
stages.add(BackupRestoreStage.ATTACH_VOLUME);
}
if (cleanupRequired) {
stages.add(BackupRestoreStage.CLEANUP_SOURCE);
}
return new BackupRestorePlan(stages);
}

public static boolean hasRestoreStage(final BackupRestorePlan restorePlan, final BackupRestoreStage stage) {
return restorePlan == null || restorePlan.hasStage(stage);
}

public static List<String> sanitizeChainFiles(final List<String> chainFiles) {
final LinkedHashSet<String> sanitized = new LinkedHashSet<>();
if (chainFiles == null) {
return new ArrayList<>();
}
for (final String chainFile : chainFiles) {
if (StringUtils.isNotBlank(chainFile)) {
sanitized.add(chainFile.trim());
}
}
return new ArrayList<>(sanitized);
}

public static void validateVolumeChainStates(final List<BackupVolumeChainState> volumeChainStates) {
if (volumeChainStates == null || volumeChainStates.isEmpty()) {
throw new IllegalArgumentException("Backup volume chain states cannot be empty");
}
for (final BackupVolumeChainState volumeChainState : volumeChainStates) {
if (volumeChainState == null) {
throw new IllegalArgumentException("Backup volume chain state cannot be null");
}
if (StringUtils.isBlank(volumeChainState.getVolumeUuid())) {
throw new IllegalArgumentException("Backup volume chain state must include a volume UUID");
}
if (sanitizeChainFiles(volumeChainState.getChainFiles()).isEmpty()) {
throw new IllegalArgumentException(String.format("Backup volume chain state for volume [%s] must include at least one chain file",
volumeChainState.getVolumeUuid()));
}
}
}

public static boolean hasUsableVolumeChainStates(final List<BackupVolumeChainState> volumeChainStates) {
try {
validateVolumeChainStates(volumeChainStates);
return true;
} catch (IllegalArgumentException e) {
return false;
}
}
}
32 changes: 19 additions & 13 deletions api/src/main/java/org/apache/cloudstack/backup/BackupManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.cloudstack.api.command.user.backup.ListBackupsCmd;
import org.apache.cloudstack.api.response.BackupResponse;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.framework.config.ValidatedConfigKey;
import org.apache.cloudstack.framework.config.Configurable;

import com.cloud.exception.ResourceUnavailableException;
Expand All @@ -54,11 +53,10 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
"false",
"Is backup and recovery framework enabled.", false, ConfigKey.Scope.Zone);

ConfigKey<String> BackupProviderPlugin = new ValidatedConfigKey<>("Advanced", String.class,
ConfigKey<String> BackupProviderPlugin = new ConfigKey<>("Advanced", String.class,
"backup.framework.provider.plugin",
"dummy",
"The backup and recovery provider plugin. Valid plugin values: dummy, veeam, networker, bx and nas",
true, ConfigKey.Scope.Zone, BackupFrameworkEnabled.key(), value -> validateBackupProviderConfig((String)value));
"The backup and recovery provider plugin.", true, ConfigKey.Scope.Zone, BackupFrameworkEnabled.key());

ConfigKey<Long> BackupSyncPollingInterval = new ConfigKey<>("Advanced", Long.class,
"backup.framework.sync.interval",
Expand All @@ -70,6 +68,23 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
"false",
"Enable volume attach/detach operations for VMs that are assigned to Backup Offerings.", true);

ConfigKey<Boolean> KvmIncrementalBackup = new ConfigKey<>("Advanced", Boolean.class,
"kvm.incremental.backup",
"false",
"Enable KVM incremental backups for supported backup providers.",
false,
ConfigKey.Scope.Cluster,
null);

ConfigKey<Integer> BackupChainSize = new ConfigKey<>(Integer.class,
"backup.chain.size",
"Advanced",
"10",
"Max incremental backup chain size before switching back to a full backup for KVM backup providers.",
true,
ConfigKey.Scope.Global,
null);

ConfigKey<Long> DefaultMaxAccountBackups = new ConfigKey<Long>("Account Defaults", Long.class,
"max.account.backups",
"20",
Expand Down Expand Up @@ -253,13 +268,4 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer

void checkAndRemoveBackupOfferingBeforeExpunge(VirtualMachine vm);

static void validateBackupProviderConfig(String value) {
if (value != null && (value.contains(",") || value.trim().contains(" "))) {
throw new IllegalArgumentException("Multiple backup provider plugins are not supported. Please provide a single plugin value.");
}
List<String> validPlugins = List.of("dummy", "veeam", "networker", "nas", "bx");
if (value != null && !validPlugins.contains(value)) {
throw new IllegalArgumentException("Invalid backup provider plugin: " + value + ". Valid plugin values are: " + String.join(", ", validPlugins));
}
}
}
50 changes: 50 additions & 0 deletions api/src/main/java/org/apache/cloudstack/backup/BackupProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public interface BackupProvider {
*/
Pair<Boolean, Backup> takeBackup(VirtualMachine vm, Boolean quiesceVM);

default Pair<Boolean, Backup> takeBackup(VirtualMachine vm, Boolean quiesceVM, Long backupScheduleId) {
return takeBackup(vm, quiesceVM);
}

/**
* Delete an existing backup
* @param backup The backup to exclude
Expand Down Expand Up @@ -170,4 +174,50 @@ default boolean supportsMemoryVmSnapshot() {
* update commvault backup plan
*/
boolean updateBackupPlan(Long zoneId, String retentionPeriod, String externalId);

default boolean supportsBackgroundSync() {
return true;
}

default boolean supportsBackupMetricsSync() {
return true;
}

default boolean supportsOutOfBandBackupSync() {
return true;
}

default boolean supportsProviderManagedBackupAgents() {
return false;
}

default boolean supportsRetentionPlanUpdate() {
return false;
}

default boolean supportsVolumeLevelChainState() {
return false;
}

default boolean supportsRestorePlan() {
return false;
}

default boolean supportsRestoreChainValidation() {
return false;
}

default boolean supportsPostRestoreMaintenance() {
return false;
}

default void runPostRestoreMaintenance(VirtualMachine vm, Backup backup, boolean volumeOnly) {
}

default boolean supportsBackgroundChainValidation() {
return false;
}

default void validateChains(Long zoneId) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.backup;

import org.apache.commons.lang3.StringUtils;

public final class BackupProviderNameUtils {
public static final String NAS = "nas";
public static final String COMMVAULT = "commvault";
public static final String ABLESTACK_NAS = "ablestack-nas";
public static final String ABLESTACK_COMMVAULT = "ablestack-commvault";

private BackupProviderNameUtils() {
}

public static String canonicalize(final String providerName) {
if (StringUtils.isBlank(providerName)) {
return providerName;
}
if (NAS.equalsIgnoreCase(providerName) || ABLESTACK_NAS.equalsIgnoreCase(providerName)) {
return ABLESTACK_NAS;
}
if (COMMVAULT.equalsIgnoreCase(providerName) || ABLESTACK_COMMVAULT.equalsIgnoreCase(providerName)) {
return ABLESTACK_COMMVAULT;
}
return providerName;
}

public static String toDisplayName(final String providerName) {
if (StringUtils.isBlank(providerName)) {
return providerName;
}
if (ABLESTACK_NAS.equalsIgnoreCase(providerName) || NAS.equalsIgnoreCase(providerName)) {
return NAS;
}
if (ABLESTACK_COMMVAULT.equalsIgnoreCase(providerName) || COMMVAULT.equalsIgnoreCase(providerName)) {
return COMMVAULT;
}
return providerName;
}

public static boolean isNasFamily(final String providerName) {
return ABLESTACK_NAS.equalsIgnoreCase(canonicalize(providerName));
}

public static boolean isCommvaultFamily(final String providerName) {
return ABLESTACK_COMMVAULT.equalsIgnoreCase(canonicalize(providerName));
}
}
Loading
Loading