Skip to content
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

CLOUDSTACK-5863: revert volume snapshot for KVM/QCOW2 #732

Closed

Conversation

ustcweizhou
Copy link
Contributor

Guys, can you review it? things need to be discussed:
(1) this supports KVM/QCOW2 only. Anyone want to implement for other Hypervisor/format ?
(2) The original data volume (on primary storage) will be removed.
(3) The script uses the default timeout in libvirtComputingResource. Do we need to add one in global configuration (like copy.volume.wait or backup.snapshot.wait, create.volume.from.snapshot.wait)
(4) In scripts/storage/qcow2/managesnapshot.sh, I use "qemu-img convert -f qcow2 -O qcow2" to copy the snapshot from secondary to primary (hence there is no base image file), instead of "cp -f", this is because convert is faster than cp in my testing.

@asfbot
Copy link

asfbot commented Aug 24, 2015

cloudstack-pull-rats #376 SUCCESS
This pull request looks good

@asfbot
Copy link

asfbot commented Aug 24, 2015

cloudstack-pull-analysis #309 SUCCESS
This pull request looks good

@wido
Copy link
Contributor

wido commented Aug 24, 2015

LGTM to me.

We should however stay as far away as possible from invoking all kinds of scripts.

Implementing this for RBD is also a lot easier since you laid some groundwork. The java RBD bindings should be able to do this.

@milamberspace
Copy link
Contributor

LGTM to me too.

Tested on a master test deployment (Ubuntu 14.04 / KVM / NFS)
Success with a manual snapshot from cloudmonkey and web ui
Success on bad condition (error message if the VM is running)

@@ -91,7 +102,6 @@ public void execute() {
boolean result = _snapshotService.revertSnapshot(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
response.setResponseName(getCommandName());
Copy link
Member

Choose a reason for hiding this comment

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

this might cause API response issues.

@rohityadavcloud
Copy link
Member

In general LGTM, please see if you could fix the response class and object of the API (pl see the comments).

@karuturi
Copy link
Member

Can you add some tests please?

@asfbot
Copy link

asfbot commented Aug 28, 2015

cloudstack-pull-rats #432 SUCCESS
This pull request looks good

@ustcweizhou
Copy link
Contributor Author

@bhaisaab I updated this PR . The reponses is changed to SnapshotResponse for backward compatibility.
@karuturi I will add some unit tests for snapshot (create, delete,revert) in another PR.

@wido
Copy link
Contributor

wido commented Aug 28, 2015

LGTM

@asfbot
Copy link

asfbot commented Aug 28, 2015

cloudstack-pull-analysis #365 FAILURE
Looks like there's a problem with this pull request

@ustcweizhou
Copy link
Contributor Author

any other comment about this PR ?
If no, I will merge it into master.

@wido
Copy link
Contributor

wido commented Sep 1, 2015

No, seems good. We can merge this.

@ustcweizhou ustcweizhou closed this Sep 1, 2015
rohityadavcloud pushed a commit to shapeblue/cloudstack that referenced this pull request Sep 1, 2015
…-master

Guys, can you review it? things need to be discussed:
(1) this supports KVM/QCOW2 only. Anyone want to implement for other Hypervisor/format ?
(2) The original data volume (on primary storage) will be removed.
(3) The script uses the default timeout in libvirtComputingResource. Do we need to add one in global configuration (like copy.volume.wait or backup.snapshot.wait, create.volume.from.snapshot.wait)
(4) In scripts/storage/qcow2/managesnapshot.sh, I use "qemu-img convert -f qcow2 -O qcow2" to copy the snapshot from secondary to primary (hence there is no base image file), instead of "cp -f", this is because convert is faster than cp in my testing.

* pr/732:
  CLOUDSTACK-5863: revert volume snapshot for KVM/QCOW2

Signed-off-by: Wei Zhou <w.zhou@tech.leaseweb.com>
@karuturi
Copy link
Member

karuturi commented Sep 8, 2015

@ustcweizhou this caused a new coverity issue. Can you check?

411             SnapshotInfo snapshotOnPrimaryStore = _snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary);
>>>     CID 1323172:  Null pointer dereferences  (NULL_RETURNS)
>>>     Calling a method on null object "snapshotOnPrimaryStore".
412             PrimaryDataStore store = (PrimaryDataStore)snapshotOnPrimaryStore.getDataStore();

rohityadavcloud pushed a commit that referenced this pull request Jan 20, 2021
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants