You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/03/03 09:04:25 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #5297: KVM disk-only based snapshot of volumes instead of taking VM's full snapshot and extracting disks

weizhouapache commented on a change in pull request #5297:
URL: https://github.com/apache/cloudstack/pull/5297#discussion_r818447192



##########
File path: scripts/storage/qcow2/managesnapshot.sh
##########
@@ -226,34 +226,10 @@ backup_snapshot() {
       return 2
     fi
   elif [ -f ${disk} ]; then
-    # Does the snapshot exist?
-    qemuimg_ret=$($qemu_img snapshot $forceShareFlag -l $disk 2>&1)
-    ret_code=$?
-    if [ $ret_code -gt 0 ] && [[ $qemuimg_ret == *"snapshot: invalid option -- 'U'"* ]]
-    then
-      forceShareFlag=""
-      qemuimg_ret=$($qemu_img snapshot $forceShareFlag -l $disk)
-      ret_code=$?
-    fi
-    if [ $ret_code -gt 0 ] || [[ ! $qemuimg_ret == *"$snapshotname"* ]]
-    then
-      printf "there is no $snapshotname on disk $disk\n" >&2
-      return 1
-    fi
 
-    qemuimg_ret=$($qemu_img convert $forceShareFlag -f qcow2 -O qcow2 -l snapshot.name=$snapshotname $disk $destPath/$destName 2>&1 > /dev/null)
+    cp "$disk" "${destPath}/${destName}"

Review comment:
       @rohityadavcloud 
   yes
   from my understanding, `cp` is OK in some scenarios, but `qemu-img convert` is required to (1) convert image to another format; (2) convert a image with backing file (template image) to a single image; (2) convert a image with snapshots to a single image;
   
   the sucess of operations does not mean that the generated templates are good.
   we need to test this. cc @GutoVeronezi 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org