bug 11217: add secondary storage id into snapshot, if it's an empty snapshot

status 11217: resolved fixed
This commit is contained in:
Edison Su 2011-08-24 10:40:12 -07:00
parent 97b148b03d
commit af0d150ac1
1 changed files with 2 additions and 0 deletions

View File

@ -275,10 +275,12 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
if (preSnapshotPath != null && preSnapshotPath.equals(answer.getSnapshotPath())) {
// empty snapshot
s_logger.debug("CreateSnapshot: this is empty snapshot ");
HostVO secHost = getSecHost(volumeId, volume.getDataCenterId());
snapshot.setPath(preSnapshotPath);
snapshot.setBackupSnapshotId(preSnapshotVO.getBackupSnapshotId());
snapshot.setStatus(Snapshot.Status.BackedUp);
snapshot.setPrevSnapshotId(preId);
snapshot.setSecHostId(secHost.getId());
_snapshotDao.update(snapshotId, snapshot);
} else {
long preSnapshotId = 0;