From d695e0f5ba06be86134a03f187a7eaeaa6e58bd0 Mon Sep 17 00:00:00 2001 From: anthony Date: Mon, 8 Nov 2010 18:22:44 -0800 Subject: [PATCH] bug 7055: reschedule all policies after management server restart test: 1. create policies for serveral volume. 2. stop management server 3. detele serveral rows in snapshot_schedule 4. start management server 5. check if the deleted row come back status 7055: resolved fixed --- .../com/cloud/storage/snapshot/SnapshotSchedulerImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java index 899772d2320..1f289e786e7 100644 --- a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java @@ -385,6 +385,14 @@ public class SnapshotSchedulerImpl implements SnapshotScheduler { @Override @DB public boolean start() { + + //reschedule all policies after management restart + List policyInstances = _snapshotPolicyDao.listAll(); + for( SnapshotPolicyVO policyInstance : policyInstances) { + if( policyInstance.getId() != Snapshot.MANUAL_POLICY_ID ) { + scheduleNextSnapshotJob(policyInstance); + } + } if (_testTimerTask != null) { _testClockTimer = new Timer("TestClock"); // Run the test clock every 60s. Because every tick is counted as 1 minute.