-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix KVM incremental volume snapshot migration between secondary storages #12086
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
base: 4.22
Are you sure you want to change the base?
Changes from 3 commits
7087d4d
79ec1c7
cb075ec
2efacdd
2c1a815
d91ef4b
516a953
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // | ||
| // 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 com.cloud.agent.api; | ||
|
|
||
| import com.cloud.utils.Pair; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class MigrateBetweenSecondaryStoragesCommandAnswer extends Answer { | ||
|
|
||
| List<Pair<Long, String>> migratedResourcesIdAndCheckpointPath; | ||
|
|
||
| public MigrateBetweenSecondaryStoragesCommandAnswer() { | ||
| } | ||
|
|
||
| public MigrateBetweenSecondaryStoragesCommandAnswer(MigrateSnapshotsBetweenSecondaryStoragesCommand cmd, boolean success, String result, List<Pair<Long, String>> migratedResourcesIdAndCheckpointPath) { | ||
| super(cmd, success, result); | ||
| this.migratedResourcesIdAndCheckpointPath = migratedResourcesIdAndCheckpointPath; | ||
| } | ||
|
|
||
| public List<Pair<Long, String>> getMigratedResources() { | ||
| return migratedResourcesIdAndCheckpointPath; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // 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 com.cloud.agent.api; | ||
|
|
||
| import com.cloud.agent.api.to.DataStoreTO; | ||
| import com.cloud.agent.api.to.DataTO; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Set; | ||
|
|
||
| public class MigrateSnapshotsBetweenSecondaryStoragesCommand extends Command { | ||
|
|
||
| DataStoreTO srcDataStore; | ||
| DataStoreTO destDataStore; | ||
| List<DataTO> snapshotChain; | ||
| Set<Long> snapshotsIdToMigrate; | ||
|
hsato03 marked this conversation as resolved.
Outdated
|
||
|
|
||
| public MigrateSnapshotsBetweenSecondaryStoragesCommand() { | ||
| } | ||
|
|
||
| public MigrateSnapshotsBetweenSecondaryStoragesCommand(List<DataTO> snapshotChain, DataStoreTO srcDataStore, DataStoreTO destDataStore, Set<Long> snapshotsIdToMigrate) { | ||
| this.srcDataStore = srcDataStore; | ||
| this.destDataStore = destDataStore; | ||
| this.snapshotChain = snapshotChain; | ||
| this.snapshotsIdToMigrate = snapshotsIdToMigrate; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean executeInSequence() { | ||
| return false; | ||
| } | ||
|
|
||
| public List<DataTO> getSnapshotChain() { | ||
| return snapshotChain; | ||
| } | ||
|
|
||
| public Set<Long> getSnapshotsIdToMigrate() { | ||
| return snapshotsIdToMigrate; | ||
| } | ||
|
|
||
| public DataStoreTO getSrcDataStore() { | ||
| return srcDataStore; | ||
| } | ||
|
|
||
| public DataStoreTO getDestDataStore() { | ||
| return destDataStore; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -233,6 +233,9 @@ public interface StorageManager extends StorageService { | |
| "while adding a new Secondary Storage. If the copy operation fails, the system falls back to downloading the template from the source URL.", | ||
| true, ConfigKey.Scope.Zone, null); | ||
|
|
||
| ConfigKey<Integer> AgentMaxDataMigrationWaitTime = new ConfigKey<>("Advanced", Integer.class, "agent.max.data.migration.wait.time", "3600", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to have a single configuration for secondary storage template, snapshot and volume migration. Templates, volumes and non-incremental snapshots will use |
||
| "The maximum time (in seconds) that the secondary storage data migration command sent to the KVM Agent will be executed before a timeout occurs.", true, ConfigKey.Scope.Cluster); | ||
|
|
||
| /** | ||
| * should we execute in sequence not involving any storages? | ||
| * @return tru if commands should execute in sequence | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.