{"id":192,"date":"2017-06-30T23:47:49","date_gmt":"2017-06-30T23:47:49","guid":{"rendered":"http:\/\/info.ffteixeira.net\/2017\/06\/30\/kvm-virt-manager-take-a-snapshot-of-qcow2-disk\/"},"modified":"2017-06-30T23:47:49","modified_gmt":"2017-06-30T23:47:49","slug":"kvm-virt-manager-take-a-snapshot-of-qcow2-disk","status":"publish","type":"post","link":"https:\/\/blog.ffteixeira.net\/?p=192","title":{"rendered":"KVM (virt-manager) take a snapshot of qcow2 disk."},"content":{"rendered":"<p><strong>Take A Snapshot<\/strong><\/p>\n<p>&nbsp;To list a kvm vm on Linux based server <strong>[VM ID]<\/strong>, more <a href=\"http:\/\/blog.ffteixeira.net\/?q=content\/linux-list-kvm-vm-guest-using-virsh-command\">info<\/a><\/p>\n<p><strong><code>virsh list&nbsp; <\/code><\/strong><\/p>\n<p>If your KVM guests are now running with Qcow2 disk images, you can take an internal snapshot of the guest with the following command:<\/p>\n<p><strong><code>virsh snapshot-create [VM ID] &nbsp;<\/code><\/strong><\/p>\n<p>Alternatively, you can create a file with the following contents<\/p>\n<p><em><code>&lt;domainsnapshot&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;name&gt;Name for the snapshot&lt;\/name&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;description&gt;Description for the snapshot&lt;\/description&gt;<br \/>&lt;\/domainsnapshot&gt;<\/code><\/em><\/p>\n<p>Then pass it to the snapshotting command.<\/p>\n<p><strong><code>virsh snapshot-create [VM ID] [filepath] &nbsp;<\/code><\/strong><\/p>\n<p>You can take snapshots of guests whilst they are running. Whilst the snapshot is being taken, the guest will be &quot;paused&quot;. The &quot;state&quot; of the guest is also saved.<\/p>\n<p><strong>List Snapshots<\/strong><br \/>One can list a virtual machine&#039;s snapshots with<\/p>\n<p><code><strong>sudo virsh snapshot-list [VM ID] &nbsp;<\/strong><\/code><\/p>\n<p>Which will output something like:<\/p>\n<p><em>&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Creation Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&nbsp;1422179589&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2015-01-25 09:53:09 +0000 running<\/em><\/p>\n<p><strong>Restore Snapshot<\/strong><\/p>\n<p>If you want to &quot;revert&quot;, &quot;go to&quot;, or &quot;restore&quot; a previous snapshot, then execute the following command:<\/p>\n<p><strong><code>virsh snapshot-revert [VM ID] [Snapshot Name] &nbsp;<\/code><\/strong><\/p>\n<p><strong>Delete Snapshot<\/strong><\/p>\n<p><code><strong>virsh snapshot-delete [VM ID] [Snapshot Name]&nbsp; <\/strong><\/code><\/p>\n<p><a href=\"http:\/\/blog.programster.org\/qcow2-conversion-and-snapshotting\/\" target=\"_blank\" rel=\"noopener noreferrer\">Credits<\/a> | <a href=\"http:\/\/itdesignhouse.com\/creating-restoring-deleting-snapshots-kvm\/\" target=\"_blank\" rel=\"noopener noreferrer\">Tips<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Take A Snapshot &nbsp;To list a kvm vm on Linux based server [VM ID], more info virsh list&nbsp; If your KVM guests are now running with Qcow2 disk images, you can take an internal snapshot of the guest with the &hellip; <a href=\"https:\/\/blog.ffteixeira.net\/?p=192\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[21,44,45],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-kvm","tag-virt-manager","tag-virtualization"],"_links":{"self":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192"}],"version-history":[{"count":0,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}