Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions engine/schema/src/main/java/com/cloud/storage/VolumeVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class VolumeVO implements Volume {
@Column(name = "id")
long id;

@Column(name = "previous_id")
private long previousId;

@Column(name = "name")
String name;

Expand Down Expand Up @@ -677,4 +680,12 @@ public void setExternalUuid(String externalUuid) {
public String getEncryptFormat() { return encryptFormat; }

public void setEncryptFormat(String encryptFormat) { this.encryptFormat = encryptFormat; }

public long getPreviousId() {
return previousId;
}

public void setPreviousId(long previousId) {
this.previousId = previousId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_data', 'removed', 'datetime COM
UPDATE `cloud`.`configuration` SET
`options` = 'FirstFitRouting,RandomAllocator,TestingAllocator,FirstFitAllocator,RecreateHostAllocator'
WHERE `name` = 'host.allocators.order';

CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('volumes','previous_id', 'bigint(20) unsigned DEFAULT NULL');
Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,8 @@ private void handlePostMigration(boolean success, Map<VolumeInfo, VolumeInfo> sr
if (success) {
VolumeVO volumeVO = _volumeDao.findById(destVolumeInfo.getId());
volumeVO.setFormat(ImageFormat.QCOW2);
volumeVO.setPreviousId(srcVolumeInfo.getId());

_volumeDao.update(volumeVO.getId(), volumeVO);

_volumeService.copyPoliciesBetweenVolumesAndDestroySourceVolumeAfterMigration(Event.OperationSuccessed, null, srcVolumeInfo, destVolumeInfo, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ protected VolumeVO duplicateVolumeOnAnotherStorage(Volume volume, StoragePool po
newVol.setPassphraseId(volume.getPassphraseId());
newVol.setEncryptFormat(volume.getEncryptFormat());
}
newVol.setPreviousId(volume.getId());
return volDao.persist(newVol);
}

Expand Down