-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix KVM incremental volume snapshot creation #12666
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
base: 4.22
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -2093,8 +2093,25 @@ protected void rebaseSnapshot(SnapshotObjectTO snapshotObjectTO, KVMStoragePool | |
| QemuImg qemuImg = new QemuImg(wait); | ||
| qemuImg.rebase(snapshotFile, parentSnapshotFile, PhysicalDiskFormat.QCOW2.toString(), false); | ||
| } catch (LibvirtException | QemuImgException e) { | ||
| logger.error("Exception while rebasing incremental snapshot [{}] due to: [{}].", snapshotName, e.getMessage(), e); | ||
| throw new CloudRuntimeException(e); | ||
| if (!StringUtils.contains(e.getMessage(), "Is another process using the image")) { | ||
| logger.error("Exception while rebasing incremental snapshot [{}] due to: [{}].", snapshotName, e.getMessage(), e); | ||
| throw new CloudRuntimeException(e); | ||
| } | ||
| retryRebase(snapshotName, wait, e, snapshotFile, parentSnapshotFile); | ||
| } | ||
| } | ||
|
|
||
| private void retryRebase(String snapshotName, int wait, Exception e, QemuImgFile snapshotFile, QemuImgFile parentSnapshotFile) { | ||
| logger.warn("Libvirt still has not released the lock, will wait 60 seconds and try again later."); | ||
| try { | ||
| Thread.sleep(60*1000); | ||
JoaoJandre marked this conversation as resolved.
Show resolved
Hide resolved
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. is it required to keep this wait time configurable?
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. We could make it configurable. Although this is already a edge case. I'll create a property in agent.properties for it. |
||
| QemuImg qemuImg = new QemuImg(wait); | ||
JoaoJandre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| qemuImg.rebase(snapshotFile, parentSnapshotFile, PhysicalDiskFormat.QCOW2.toString(), false); | ||
| } catch (LibvirtException | QemuImgException | InterruptedException ex) { | ||
JoaoJandre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| logger.error("Unable to rebase snapshot [{}].", snapshotName, ex); | ||
| CloudRuntimeException cre = new CloudRuntimeException(ex); | ||
| cre.addSuppressed(e); | ||
| throw cre; | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
@JoaoJandre is this string case sensitive? can you paste the sample error message here. thanks.
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 :