Merge pull request #732 from ustcweizhou/revert-volume-snapshot-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 <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c0a0aec0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c0a0aec0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c0a0aec0

Branch: refs/heads/master
Commit: c0a0aec0f9041a3577d96d69260c7aa33482199d
Parents: f732c7d 312cb87
Author: Wei Zhou <[email protected]>
Authored: Tue Sep 1 16:18:19 2015 +0200
Committer: Wei Zhou <[email protected]>
Committed: Tue Sep 1 16:18:40 2015 +0200

----------------------------------------------------------------------
 api/src/com/cloud/storage/Volume.java           |  5 ++
 .../storage/snapshot/SnapshotApiService.java    |  2 +-
 .../user/snapshot/RevertSnapshotCmd.java        | 18 +++-
 .../storage/command/RevertSnapshotCommand.java  | 49 ++++++++++
 .../api/storage/PrimaryDataStoreDriver.java     |  2 +-
 .../subsystem/api/storage/SnapshotService.java  |  2 +-
 .../subsystem/api/storage/SnapshotStrategy.java |  2 +-
 .../datastore/db/SnapshotDataStoreDao.java      |  3 +
 .../snapshot/SnapshotDataFactoryImpl.java       |  5 +-
 .../storage/snapshot/SnapshotServiceImpl.java   |  8 +-
 .../storage/snapshot/SnapshotStrategyBase.java  |  4 +-
 .../snapshot/StorageSystemSnapshotStrategy.java | 54 +++++++++--
 .../snapshot/XenserverSnapshotStrategy.java     |  2 +-
 .../image/db/SnapshotDataStoreDaoImpl.java      | 14 +++
 .../LibvirtRevertSnapshotCommandWrapper.java    | 95 ++++++++++++++++++++
 .../ElastistorPrimaryDataStoreDriver.java       |  2 +-
 .../CloudStackPrimaryDataStoreDriverImpl.java   | 24 ++++-
 .../driver/NexentaPrimaryDataStoreDriver.java   |  2 +-
 .../SamplePrimaryDataStoreDriverImpl.java       |  2 +-
 .../driver/SolidFirePrimaryDataStoreDriver.java |  2 +-
 scripts/storage/qcow2/managesnapshot.sh         | 18 +++-
 .../storage/snapshot/SnapshotManagerImpl.java   | 28 ++++--
 ui/css/cloudstack3.css                          |  2 +
 ui/scripts/storage.js                           |  3 +
 24 files changed, 315 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


Reply via email to