Support Volume Clone

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

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. Navigate to Volumes, clone disk-0 and disk-1 which attached to vm1 by clicking Clone Volume
  5. Create vm2 with cloned disk-0 and disk-1
  6. vm2 should started successfully
  7. 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 vdb/test
  8. Navigate to Volumes, then clone disk-1 of vm1 into vm1-disk-2
  9. Navigate to Virtual Machines, then update vm1 to add existing volume vm1-disk-2
  10. Login to vm1 then mount /dev/vdb1(disk-1) and /dev/vdc1(disk-2) into vdb and vdc
  11. test file should be appeared in both folders of vdb and vdc
  12. test file should not be empty in both folders of vdb and vdc