VM Snapshot support

Ref: https://github.com/harvester/harvester/issues/553

Verify Steps:

  1. Install Harvester with any nodes
  2. Create an Image for VM creation
  3. Create vm1 with the image and an additional data volume disk-1
  4. Login to vm1, execute following commands:
    • fdisk /dev/vdb with new and primary partition
    • mkfs.ext4 /dev/vdb1
    • mkdir vdb && mount -t ext4 /dev/vdb1 vdb
    • ping 127.0.0.1 | tee -a test vdb/test
  5. Navigate to Virtual Machines page, click Take Snapshot button on vm1’s details, named vm1s1
  6. Execute sync on vm1 and Take Snapshot named vm1s2
  7. Interrupt ping... command and rm test && sync, then Take Snapshot named vm1s3
  8. Restore 3 snapshots into New VM: vm1s1r, vm1s2r and vm1s3r
  9. Content of test and vdb/test should be the same in VM, and different in other restored VMs.
  10. Restore snapshots with Replace Existing
  11. Content of test and vdb/test in restored vm1 from the snapshot, should be the same as the VM restored with the same snapshot.