mirror of https://github.com/apache/cloudstack.git
bug 7386: fixing the recurrent snapshots
status 7386: resolved fixed
This commit is contained in:
parent
ed35b54224
commit
2d6875f711
|
|
@ -120,13 +120,18 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public void create(){
|
||||
long id = _snapshotService.getNextInSequence(this);
|
||||
Long id = _snapshotService.getNextInSequence(this);
|
||||
this.setEntityId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
if (this.getEntityId() == null) {
|
||||
Long id = _snapshotService.getNextInSequence(this);
|
||||
this.setEntityId(id);
|
||||
}
|
||||
|
||||
Snapshot snapshot = _snapshotService.createSnapshot(this);
|
||||
if (snapshot != null) {
|
||||
SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot);
|
||||
|
|
|
|||
|
|
@ -382,7 +382,9 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
|||
throw new CloudRuntimeException("Creating snapshot failed due to " + e.toString());
|
||||
} finally {
|
||||
// Cleanup jobs to do after the snapshot has been created.
|
||||
postCreateSnapshot(volumeId, snapshotId, policyId, backedUp);
|
||||
if( snapshotId != null) {
|
||||
postCreateSnapshot(volumeId, snapshotId, policyId, backedUp);
|
||||
}
|
||||
_volsDao.releaseFromLockTable(volumeId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -223,6 +223,9 @@ public class SnapshotSchedulerImpl implements SnapshotScheduler {
|
|||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("volumeid", ""+volumeId);
|
||||
params.put("policyid", ""+policyId);
|
||||
params.put("ctxUserId", "1");
|
||||
params.put("ctxAccountId", "1");
|
||||
|
||||
AsyncJobVO job = new AsyncJobVO();
|
||||
job.setUserId(userId);
|
||||
// Just have SYSTEM own the job for now. Users won't be able to see this job, but
|
||||
|
|
|
|||
Loading…
Reference in New Issue