mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
set correct secondary storage host id in snapshot table
This commit is contained in:
parent
c7d17d2e3c
commit
1e7399dd19
@ -110,7 +110,7 @@ public class SnapshotVO implements Snapshot {
|
||||
|
||||
public SnapshotVO() { }
|
||||
|
||||
public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String path, String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType, Long secHostId) {
|
||||
public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String path, String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType ) {
|
||||
this.dataCenterId = dcId;
|
||||
this.accountId = accountId;
|
||||
this.domainId = domainId;
|
||||
@ -125,7 +125,6 @@ public class SnapshotVO implements Snapshot {
|
||||
this.prevSnapshotId = 0;
|
||||
this.hypervisorType = hypervisorType;
|
||||
this.version = "2.2";
|
||||
this.secHostId = secHostId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -581,6 +581,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
||||
snapshot.setSwiftId(1L);
|
||||
snapshot.setSwiftName(backedUpSnapshotUuid);
|
||||
} else {
|
||||
snapshot.setSecHostId(secHost.getId());
|
||||
snapshot.setBackupSnapshotId(backedUpSnapshotUuid);
|
||||
}
|
||||
if (answer.isFull()) {
|
||||
@ -1279,12 +1280,8 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
||||
// user
|
||||
Type snapshotType = getSnapshotType(policyId);
|
||||
HypervisorType hypervisorType = this._volsDao.getHypervisorType(volumeId);
|
||||
HostVO ssHost = _hostDao.findSecondaryStorageHost(volume.getDataCenterId());
|
||||
if( ssHost == null ) {
|
||||
throw new CloudRuntimeException("There is no secondary storage in this zone :" + volume.getDataCenterId());
|
||||
}
|
||||
SnapshotVO snapshotVO = new SnapshotVO(volume.getDataCenterId(), volume.getAccountId(), volume.getDomainId(), volume.getId(), volume.getDiskOfferingId(), null, snapshotName,
|
||||
(short) snapshotType.ordinal(), snapshotType.name(), volume.getSize(), hypervisorType, ssHost.getId());
|
||||
(short) snapshotType.ordinal(), snapshotType.name(), volume.getSize(), hypervisorType);
|
||||
SnapshotVO snapshot = _snapshotDao.persist(snapshotVO);
|
||||
|
||||
if (snapshot != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user