-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CloudStack Backup & Recovery Framework #3553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
ccec1bc
feature: VM Backup and Recovery
yadvr 6e8778b
remove id req.
yadvr b75f35e
apidoc: fix section name
yadvr 21509bd
don't allow duplicates by name in the same zone
yadvr 3edec49
implement the asyncjob based scheduler design in db
yadvr 6646353
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr f1b957b
fix missing methods
yadvr cff613d
schedule apis
yadvr 9f6a2e6
more apis, backend support and refactorings
yadvr 4e1cf0d
add assignment/removal APIs
yadvr 5a0bdb1
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 97b7b69
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr e536282
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr a2e6452
list api pagination and searching etc.
yadvr 50c44a6
api layer changes and refactorings
yadvr 33d580d
minor fixes
yadvr 73f3d58
fix deletion corner cases
yadvr 25b658c
handle case of force vm removal from offering to delete job/backups f…
yadvr 8308241
backup scheduled crud apis
yadvr 63b41d2
apidocs comments
yadvr aebb61a
major refactorings per new spec updates
yadvr 57d6c1f
more refactorings
yadvr ad5d882
more refactorings
yadvr 8c7d42f
api and schema refactorings, end to end
yadvr a57ae37
cleanup: remove unused class
yadvr 8b0fa1b
fix both metrics and backup sync in the thread
yadvr b66e8d7
misc fixes
yadvr 00c87b8
fixes
yadvr 4746d05
fix bugz
yadvr 0d3934e
more fixes
yadvr cf9cbfc
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 0c2ec55
refactorings and fixes
yadvr 14330ab
missing declr.
yadvr a2a5436
minor fixes
yadvr 2c8095b
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 0dbf44a
implement backup schedule execution logic using timer and locks
yadvr 47c255b
return backupoffering name/id in list VMs api for UI
yadvr 6eee0eb
offerings fixes
yadvr 1a866b9
ui fixes
yadvr cd5f983
fixes
yadvr a6cf24c
rename to id instead of backupid for consistency
yadvr 65f2d25
fix GC logic for veeam
yadvr a355c33
minor fix
yadvr 5003d24
minor fixes from self review
yadvr e3c500a
vmware: fix issue, find including removed for volume of an expunged VM
yadvr 7bb19a1
bugfix - restore expunged vm case wip
yadvr 4bbf1e5
fixes
yadvr b6a2db1
fixes fixes fixes
yadvr 50deb58
handle many edge cases around VM restoration of an expunged VM
yadvr c8e368c
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 8e1fe3a
add ui button/forms
yadvr b776650
backup schedule ui finish testing+fixes
yadvr 8f0c511
more edge case fixes
yadvr cc2055e
allow granularity if user-driven backups (adhoc+scheduled) are allowed
yadvr f32d5b1
fix edge case when veeam job+backups are removed but not synced
yadvr c20fe2c
fix build issue
yadvr b014532
use row-lock based VM instance updation
yadvr 81e85ce
fix usage record generation, track backup offering in helper table
yadvr 7f6577e
fixes
yadvr 4e2be13
test+travis
yadvr 48122fa
meorefixes
yadvr b3bb5cd
ffffixes
yadvr a4ccfea
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr b56149f
fix setting enable/revert, to make it pass on travis
yadvr dd50888
address review comments
yadvr 5833cf1
fix build
yadvr 71142ad
build fix
yadvr 5220899
Merge branch 'master' into bckuprecframework
yadvr 7677eab
Merge branch 'master' into bckuprecframework
yadvr 3cca470
Merge branch 'master' into bckuprecframework
yadvr d538e0b
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr bc4b125
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr a1e20a5
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 1722125
fix merge conflict issue
yadvr 7e78da1
make veeam password secure
yadvr 03c9104
fix schema issue in B&R
yadvr 4d9fa83
fix issue of VM assignment failure, instead ask users to remove assig…
yadvr a22efef
handle any exception
yadvr efc425f
Merge branch 'master' into bckuprecframework
yadvr 2453d73
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr fa8e78f
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 5b6d8de
veeam fix auth issue per latest 9.x version
yadvr 12d71c4
fix unit test fail
yadvr eb65700
check session id in the constructor which calls authenticate(); fail …
yadvr c71d281
fix auth issue
yadvr 099e18d
add log statement
yadvr 72ab892
fixes
yadvr b9cec97
fix assignment
yadvr 0e134f2
enable disabled cloned job
yadvr f0d1860
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 5e7e3d7
sync without in a transaction, DB updates are not inter-dependent
yadvr f54a473
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr c5c54af
run restore VM operations in background and poll until completion
yadvr 066a439
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr 008fdd1
ui: tell users that only backup has started, not created
yadvr 4f20f76
backup: don't allow backup offering attach for vms not in running, st…
yadvr 9047577
dummy: fix dummy B&R test smoketest
yadvr 7e24faf
veeam: fix potential NPE on no backend jobs
yadvr 15ddbc7
veeam: only discover/list consistent restore points (not corrupt or t…
yadvr 9b0afed
make pipe explicit, guard within parenthesis
yadvr a461606
Merge remote-tracking branch 'origin/master' into bckuprecframework
yadvr b850ba7
escape powershell pipe character
yadvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ public enum ApiCommandJobType { | |
| Volume, | ||
| ConsoleProxy, | ||
| Snapshot, | ||
| Backup, | ||
| Template, | ||
| Iso, | ||
| SystemVm, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
api/src/main/java/org/apache/cloudstack/api/BaseBackupListCmd.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // 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.api; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| import org.apache.cloudstack.api.response.BackupOfferingResponse; | ||
| import org.apache.cloudstack.api.response.ListResponse; | ||
| import org.apache.cloudstack.backup.BackupOffering; | ||
| import org.apache.cloudstack.context.CallContext; | ||
|
|
||
| public abstract class BaseBackupListCmd extends BaseListCmd { | ||
|
|
||
| protected void setupResponseBackupOfferingsList(final List<BackupOffering> offerings, final Integer count) { | ||
| final ListResponse<BackupOfferingResponse> response = new ListResponse<>(); | ||
| final List<BackupOfferingResponse> responses = new ArrayList<>(); | ||
| for (final BackupOffering offering : offerings) { | ||
| if (offering == null) { | ||
nvazquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| continue; | ||
| } | ||
| BackupOfferingResponse backupOfferingResponse = _responseGenerator.createBackupOfferingResponse(offering); | ||
| responses.add(backupOfferingResponse); | ||
| } | ||
| response.setResponses(responses, count); | ||
| response.setResponseName(getCommandName()); | ||
| setResponseObject(response); | ||
| } | ||
|
|
||
| @Override | ||
| public long getEntityOwnerId() { | ||
| return CallContext.current().getCallingAccount().getId(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...src/main/java/org/apache/cloudstack/api/command/admin/backup/DeleteBackupOfferingCmd.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| // 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.api.command.admin.backup; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| import org.apache.cloudstack.acl.RoleType; | ||
| import org.apache.cloudstack.api.APICommand; | ||
| import org.apache.cloudstack.api.ApiConstants; | ||
| import org.apache.cloudstack.api.ApiErrorCode; | ||
| import org.apache.cloudstack.api.BaseCmd; | ||
| import org.apache.cloudstack.api.Parameter; | ||
| import org.apache.cloudstack.api.ServerApiException; | ||
| import org.apache.cloudstack.api.response.BackupOfferingResponse; | ||
| import org.apache.cloudstack.api.response.SuccessResponse; | ||
| import org.apache.cloudstack.backup.BackupManager; | ||
| import org.apache.cloudstack.context.CallContext; | ||
|
|
||
| import com.cloud.exception.ConcurrentOperationException; | ||
| import com.cloud.exception.InsufficientCapacityException; | ||
| import com.cloud.exception.NetworkRuleConflictException; | ||
| import com.cloud.exception.ResourceAllocationException; | ||
| import com.cloud.exception.ResourceUnavailableException; | ||
|
|
||
| @APICommand(name = DeleteBackupOfferingCmd.APINAME, | ||
| description = "Deletes a backup offering", | ||
| responseObject = SuccessResponse.class, since = "4.14.0", | ||
| authorized = {RoleType.Admin}) | ||
| public class DeleteBackupOfferingCmd extends BaseCmd { | ||
| public static final String APINAME = "deleteBackupOffering"; | ||
|
|
||
| @Inject | ||
| private BackupManager backupManager; | ||
|
|
||
| ///////////////////////////////////////////////////// | ||
| //////////////// API parameters ///////////////////// | ||
| //////////////////////////////////////////////////// | ||
|
|
||
| @Parameter(name = ApiConstants.ID, | ||
| type = CommandType.UUID, | ||
| entityType = BackupOfferingResponse.class, | ||
| required = true, | ||
| description = "ID of the backup offering") | ||
| private Long id; | ||
|
|
||
| ///////////////////////////////////////////////////// | ||
| /////////////////// Accessors /////////////////////// | ||
| ///////////////////////////////////////////////////// | ||
|
|
||
| public Long getId() { | ||
| return id; | ||
| } | ||
|
|
||
| ///////////////////////////////////////////////////// | ||
| /////////////// API Implementation/////////////////// | ||
| ///////////////////////////////////////////////////// | ||
|
|
||
| @Override | ||
| public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { | ||
| if (backupManager.deleteBackupOffering(getId())) { | ||
| SuccessResponse response = new SuccessResponse(getCommandName()); | ||
| setResponseObject(response); | ||
| } else { | ||
| throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Unable to remove backup offering: " + getId()); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public String getCommandName() { | ||
| return APINAME.toLowerCase() + BaseCmd.RESPONSE_SUFFIX; | ||
| } | ||
|
|
||
| @Override | ||
| public long getEntityOwnerId() { | ||
| return CallContext.current().getCallingAccount().getId(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spello? back-up versus -off? Or act of aggression ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha :), to keep it abbreviated, like servoff, diskoff etc.