Add ability to archive snapshots on primary storage#2585
Conversation
|
@syed a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1953 |
|
@syed it seems that you have some compilation errors, can you take a look at them? |
| cmdList.add(CreateSnapshotCmd.class); | ||
| cmdList.add(CreateSnapshotFromVMSnapshotCmd.class); | ||
| cmdList.add(DeleteSnapshotCmd.class); | ||
| cmdList.add(ArchiveSnapshotCmd.class); |
| Snapshot createSnapshot(Long volumeId, Long policyId, Long snapshotId, Account snapshotOwner); | ||
|
|
||
| /** | ||
| * Archives a snpashot from primary storage to secondary storage. |
There was a problem hiding this comment.
Minor: Spelling issue on what should be the word "snapshot".
| snapObj.processEvent(Snapshot.Event.OperationFailed); | ||
| // When error archiving an already existing snapshot, emit OperationNotPerformed. | ||
| // This will ensure that the original snapshot does not get deleted | ||
| if (origState.equals(Snapshot.State.BackedUp)) { |
There was a problem hiding this comment.
Just curious @syed: Have you at least manually run a test case where the snapshot process failed and this logic was executed to see if, in fact, the original snapshot remained usable?
There was a problem hiding this comment.
@mike-tutkowski Yes. That is how I added this check. In the normal scenario, the original snapshot was getting deleted.
| } | ||
|
|
||
| SnapshotInfo snapshotOnSecondary = snapshotSrv.backupSnapshot(snapshotOnPrimary); | ||
| snapshotSrv.deleteSnapshot(snapshotOnPrimary); |
There was a problem hiding this comment.
@syed, I think it would be better to check the status of deleting the snapshot on the primary storage. Due to any reason, if it fails to delete then the user will be informed with a proper error message. Thanks.
There was a problem hiding this comment.
@nitin-maharana That's a good point. I'll catch that here
a2dd376 to
8e80910
Compare
8e80910 to
cd70ede
Compare
|
Closing and re-opening this PR to kick off CI again. |
|
@syed a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2264 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
I have run all of the XenServer-oriented managed storage-related integration tests on this PR. With the exception of two tests (more on that later), all have passed. These are the two tests that failed: I plan to investigate this one soon: test_online_migrate_volume_with_snapshot_from_nfs_storage_to_managed_storage (TestOnlineStorageMigration.TestOnlineStorageMigration) ... === TestName: test_online_migrate_volume_with_snapshot_from_nfs_storage_to_managed_storage | Status : EXCEPTION === This one failed because PR #2761 is not yet merged into master. I plan (just in my sandbox) to merge #2761 into this PR and re-run this test. That way I should be able to see this test pass. test_02_storage_migrate_root_and_data_disks (TestVMMigrationWithStorage.TestVMMigrationWithStorage) ... === TestName: test_02_storage_migrate_root_and_data_disks | Status : EXCEPTION === Here are links to all of the tests I ran for this PR: TestOnlineStorageMigration (second test is one of the failed tests listed above): TestVMMigrationWithStorage (second test is one of the failed tests listed above): TestAddRemoveHosts (all tests passed): TestCapacityManagement (both tests passed): TestManagedSystemVMs (both tests passed): TestSnapshots (all tests passed; during the first run, tests 2 - 4 failed due to an environment issue...I corrected the issue and re-ran those tests; the second results file shows them passing): TestVMSnapshots (both tests passed): TestVolumes (no resigning; all tests passed): TestVolumes (resigning; all tests passed): |
|
I re-ran test_online_migrate_volume_with_snapshot_from_nfs_storage_to_managed_storage (TestOnlineStorageMigration.TestOnlineStorageMigration), which was one of two tests that failed, and it passed: I also went ahead and ran that test scenario manually and it passed. |
|
Trillian test result (tid-2957)
|
|
I merged #2761 into this PR in my sandbox and re-ran test_02_storage_migrate_root_and_data_disks (TestVMMigrationWithStorage.TestVMMigrationWithStorage). The test passed. |
|
The tests that failed for this PR do not seem to be likely because of this PR. That being the case and with all XenServer-oriented managed storage-related integration tests having passed (per above comments), this PR LGTM. We have two LGTMs, CI passed, and integration tests look reasonable (per previous comments). Merging this PR. |
|
@syed a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✖debian. JID-2267 |
|
@mike-tutkowski this PR was merged without a milestone and please ensure that PRs getting merged have a milestone and use the squash+merge option while merging the PR otherwise it creates a complex git history/graph with merge commits that serves no purpose esp for PRs with a single commit. Thanks. |
|
I just saw your comment here, @rhtyd - sounds good. |
Description
This PR adds an API call named
archiveSnapshotwhich takes in a snapshot residing on primary storage and moves it to secondary storage. The main use case for this relates to the use in Managed storage where the storage supports native snapshots. Because of cost and availability reasons, it is useful to move snapshots that are taken on primary storage (native snapshots) to secondary storage.The API takes in a
snapshotid, creates a new snapshot on secondary storage and deletes the snapshot on primary storage.Types of changes
GitHub Issue/PRs
Screenshots (if appropriate):
How Has This Been Tested?
Tested on a local storage cluster (SolidFire) and also added unit tests.
Checklist:
Testing
@blueorangutan package