-
Notifications
You must be signed in to change notification settings - Fork 1.3k
server: fix root disk size on vm reset #4638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6678,6 +6678,12 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final | |
| newVol = volumeMgr.allocateDuplicateVolume(root, null); | ||
| } | ||
|
|
||
| if (userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.ROOT_DISK_SIZE) == null && !newVol.getSize().equals(template.getSize())) { | ||
| VolumeVO resizedVolume = (VolumeVO) newVol; | ||
| resizedVolume.setSize(template.getSize()); | ||
| _volsDao.update(resizedVolume.getId(), resizedVolume); | ||
| } | ||
|
|
||
| // 1. Save usage event and update resource count for user vm volumes | ||
| _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.volume, newVol.isDisplay()); | ||
| _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.primary_storage, newVol.isDisplay(), new Long(newVol.getSize())); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sureshanaparti same object is been cast to VolumeVO and size is updated at 6682-6683. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shwstppr it is possible to handle this case while allocating duplicate volume with template ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sureshanaparti Duplicating using template, won't that affect other existing values of the entry - folder, path, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this comment, if we need to address anything additional pl raise a new PR @shwstppr @sureshanaparti