Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@ public boolean updateUuid(long srcVolId, long destVolId) {
srcVol.setUuid(null);
destVol.setUuid(uuid);
destVol.setInstanceId(instanceId);
// Prevent storage cleanup corner case of ROOT volume deletion
srcVol.setVolumeType(Type.DATADISK);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could that cause any regression, does this save the VO in DB?

Copy link
Copy Markdown
Contributor Author

@nvazquez nvazquez Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently testing for regressions. This saves the removed volume after storage migrations in DB as datadisk. @weizhouapache and I are considering the approach taken on restore VM as well: https://github.com/apache/cloudstack/blob/main/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L7407-L7409

update(srcVolId, srcVol);
update(destVolId, destVol);
_tagsDao.updateResourceId(srcVolId, destVolId, ResourceObjectType.Volume);
Expand Down