Skip to content

Commit 7913153

Browse files
author
shan.wu
committed
<fix>[snapshot]: fix UndoSnapshotCreation error on sblk
1.deactive snapshot lv on other host before committing volume. 2.do not resize qcow2, only resize snapshot lv before committing volume. Resolves/Related: ZSTAC-77942 Change-Id: I767861677267636b677578636267746c62777479
1 parent f758a66 commit 7913153

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

plugin/kvm/src/main/java/org/zstack/kvm/KVMAgentCommands.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4008,6 +4008,15 @@ public static class BlockCommitVolumeCmd extends AgentCommand implements HasThre
40084008
private String top;
40094009
@GrayVersion(value = "5.0.0")
40104010
private String base;
4011+
private Boolean live;
4012+
4013+
public Boolean getLive() {
4014+
return live;
4015+
}
4016+
4017+
public void setLive(Boolean live) {
4018+
this.live = live;
4019+
}
40114020

40124021
public String getVmUuid() {
40134022
return vmUuid;

plugin/kvm/src/main/java/org/zstack/kvm/KVMHost.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,8 @@ private void doCommitVolume(final CommitVolumeOnHypervisorMsg msg, final NoError
10231023
if (state != VmInstanceState.Running && state != VmInstanceState.Stopped && state != VmInstanceState.Paused) {
10241024
throw new OperationFailureException(operr("vm[uuid:%s] is not Running or Stopped, current state[%s]", msg.getVmUuid(), state));
10251025
}
1026+
1027+
cmd.setLive(state == VmInstanceState.Running || state == VmInstanceState.Paused);
10261028
}
10271029

10281030
cmd.setVmUuid(msg.getVmUuid());

0 commit comments

Comments
 (0)