You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2017/02/08 08:14:46 UTC
[3/3] git commit: updated refs/heads/master to 25f1552
Merge release branch 4.9 to master
This closes #1644
* 4.9:
CLOUDSTACK-4858 Honors the snapshot.backup.rightafter configuration variable Unhides snapshot.backup.rightafter from global configuration
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/25f1552e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/25f1552e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/25f1552e
Branch: refs/heads/master
Commit: 25f1552e371543512d58becdf5e44aab4478e45f
Parents: e303baa c101817
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Wed Feb 8 12:37:21 2017 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Wed Feb 8 13:43:02 2017 +0530
----------------------------------------------------------------------
.../orchestration/VolumeOrchestrator.java | 23 ++++++++++++++++++++
.../SnapshotStateMachineManagerImpl.java | 1 +
.../snapshot/XenserverSnapshotStrategy.java | 19 +++++++++++++++-
server/src/com/cloud/configuration/Config.java | 2 +-
.../storage/snapshot/SnapshotManagerImpl.java | 8 ++++++-
.../com/cloud/template/TemplateManagerImpl.java | 20 +++++++++++++++++
.../cloud/template/TemplateManagerImplTest.java | 9 ++++++++
7 files changed, 79 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25f1552e/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --cc engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 32cb19b,ea6a66d..4405d98
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@@ -187,7 -182,7 +190,9 @@@ public class VolumeOrchestrator extend
@Inject
StorageManager storageMgr;
@Inject
+ protected UserVmCloneSettingDao _vmCloneSettingDao;
++ @Inject
+ StorageStrategyFactory _storageStrategyFactory;
private final StateMachine2<Volume.State, Volume.Event, Volume> _volStateMachine;
protected List<StoragePoolAllocator> _storagePoolAllocators;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25f1552e/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
----------------------------------------------------------------------
diff --cc engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
index 16a47c6,2686e40..94e9f43
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
@@@ -380,10 -375,26 +381,26 @@@ public class XenserverSnapshotStrategy
}
}
- snapshot = result.getSnashot();
+ snapshot = result.getSnapshot();
DataStore primaryStore = snapshot.getDataStore();
+ boolean backupFlag = Boolean.parseBoolean(configDao.getValue(Config.BackupSnapshotAfterTakingSnapshot.toString()));
- SnapshotInfo backupedSnapshot = backupSnapshot(snapshot);
+ SnapshotInfo backupedSnapshot;
+ if(backupFlag) {
+ backupedSnapshot = backupSnapshot(snapshot);
+ } else {
+ // Fake it to get the transitions to fire in the proper order
+ s_logger.debug("skipping backup of snapshot due to configuration "+Config.BackupSnapshotAfterTakingSnapshot.toString());
+
+ SnapshotObject snapObj = (SnapshotObject)snapshot;
+ try {
+ snapObj.processEvent(Snapshot.Event.OperationNotPerformed);
+ } catch (NoTransitionException e) {
+ s_logger.debug("Failed to change state: " + snapshot.getId() + ": " + e.toString());
+ throw new CloudRuntimeException(e.toString());
+ }
+ backupedSnapshot = snapshot;
+ }
try {
SnapshotInfo parent = snapshot.getParent();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25f1552e/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25f1552e/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25f1552e/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25f1552e/server/test/com/cloud/template/TemplateManagerImplTest.java
----------------------------------------------------------------------
diff --cc server/test/com/cloud/template/TemplateManagerImplTest.java
index 61a8a4a,e6e9edd..3039b8b
--- a/server/test/com/cloud/template/TemplateManagerImplTest.java
+++ b/server/test/com/cloud/template/TemplateManagerImplTest.java
@@@ -163,8 -163,8 +164,11 @@@ public class TemplateManagerImplTest
SnapshotDao snapshotDao;
@Inject
+ VMTemplateDetailsDao tmpltDetailsDao;
+
++ @Inject
+ StorageStrategyFactory storageStrategyFactory;
+
public class CustomThreadPoolExecutor extends ThreadPoolExecutor {
AtomicInteger ai = new AtomicInteger(0);
public CustomThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,