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 2021/08/11 16:47:24 UTC

[GitHub] [cloudstack] GutoVeronezi 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

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



##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
##########
@@ -1497,8 +1475,43 @@ public Answer createVolume(final CreateObjectCommand cmd) {
         }
     }
 
-    protected static final MessageFormat SnapshotXML = new MessageFormat("   <domainsnapshot>" + "       <name>{0}</name>" + "          <domain>"
-            + "            <uuid>{1}</uuid>" + "        </domain>" + "    </domainsnapshot>");
+    /**
+     * XML to take disk-only snapshot of the VM.<br><br>
+     * 1st parameter: snapshot's name;<br>
+     * 2nd parameter: disk's label (target.dev tag from VM's XML);<br>
+     * 3rd parameter: absolute path to create the snapshot;<br>
+     * 4th parameter: list of disks to avoid on snapshot {@link #TAG_AVOID_DISK_FROM_SNAPSHOT};
+     */
+    private static final String XML_CREATE_SNAPSHOT = "<domainsnapshot><name>%s</name><disks><disk name='%s' snapshot='external'><source file='%s'/></disk>%s</disks>"
+      + "</domainsnapshot>";
+
+    /**
+     * Tag to avoid disk from snapshot.<br><br>
+     * 1st parameter: disk's label (target.dev tag from VM's XML);
+     */
+    private static final String TAG_AVOID_DISK_FROM_SNAPSHOT = "<disk name='%s' snapshot='no' />";
+
+    /**
+     * Virsh command to merge (blockcommit) snapshot into the base file.<br><br>
+     * 1st parameter: VM's name;<br>
+     * 2nd parameter: disk's label (target.dev tag from VM's XML);<br>
+     * 3rd parameter: the absolute path of the base file;
+     */
+    private static final String COMMAND_MERGE_SNAPSHOT = "virsh blockcommit %s %s --base %s --active --wait --delete --pivot";

Review comment:
       Thanks @slavkap, I will make some changes soon.




-- 
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